mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
BaseTools: GenFfs/GenFv/GenSec: Fixing Warning 4319 from MSVC
This change fixes a warning newly emitted by the latest MSVC, which now treats this warning as an error and causes the build to fail. This change aligns operand types in bitwise expressions by casting sizeof results to UINT32, and promoting a UINT32 to UINTN where required to correctly apply the bitmask. Signed-off-by: Kun Qin <kun.qin@microsoft.com>
This commit is contained in:
parent
0a3cb1cba0
commit
8c298e1104
3 changed files with 3 additions and 3 deletions
|
|
@ -398,7 +398,7 @@ Returns:
|
|||
// Based on section type to adjust offset? Todo
|
||||
//
|
||||
if ((InputFileAlign [Index] != 0) && (((Size + HeaderSize + TeOffset) % InputFileAlign [Index]) != 0)) {
|
||||
Offset = (Size + sizeof (EFI_COMMON_SECTION_HEADER) + HeaderSize + TeOffset + InputFileAlign [Index] - 1) & ~(InputFileAlign [Index] - 1);
|
||||
Offset = (Size + (UINT32)sizeof (EFI_COMMON_SECTION_HEADER) + HeaderSize + TeOffset + InputFileAlign [Index] - 1) & ~(InputFileAlign [Index] - 1);
|
||||
Offset = Offset - Size - HeaderSize - TeOffset;
|
||||
|
||||
if (FileBuffer != NULL && ((Size + Offset) < *BufferLength)) {
|
||||
|
|
|
|||
|
|
@ -3176,7 +3176,7 @@ Returns:
|
|||
//
|
||||
// Only EFI_FFS_FILE_HEADER is needed for a pad section.
|
||||
//
|
||||
CurrentOffset = (CurrentOffset + FfsHeaderSize + sizeof(EFI_FFS_FILE_HEADER) + FfsAlignment - 1) & ~(FfsAlignment - 1);
|
||||
CurrentOffset = (CurrentOffset + FfsHeaderSize + sizeof(EFI_FFS_FILE_HEADER) + FfsAlignment - 1) & ~(UINTN)(FfsAlignment - 1);
|
||||
CurrentOffset -= FfsHeaderSize;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -538,7 +538,7 @@ Returns:
|
|||
// make sure section data meet its alignment requirement by adding one raw pad section.
|
||||
//
|
||||
if ((InputFileAlign [Index] != 0) && (((Size + HeaderSize + TeOffset) % InputFileAlign [Index]) != 0)) {
|
||||
Offset = (Size + sizeof (EFI_COMMON_SECTION_HEADER) + HeaderSize + TeOffset + InputFileAlign [Index] - 1) & ~(InputFileAlign [Index] - 1);
|
||||
Offset = (Size + (UINT32)sizeof (EFI_COMMON_SECTION_HEADER) + HeaderSize + TeOffset + InputFileAlign [Index] - 1) & ~(InputFileAlign [Index] - 1);
|
||||
Offset = Offset - Size - HeaderSize - TeOffset;
|
||||
|
||||
if (FileBuffer != NULL && ((Size + Offset) < *BufferLength)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue