summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorZenith432 <zenith432@users.sourceforge.net>2016-05-16 23:52:21 +0800
committerLiming Gao <liming.gao@intel.com>2016-05-18 09:50:44 +0800
commitd3bb711834acd3eda35a07d0be7911bc3dbb9e6f (patch)
tree40a16000cbfd88a1cb866a4fb0683b6cf3636179 /BaseTools
parentb98993580e3c07cfa139ed19b6fb4f1bb4db9edc (diff)
downloadedk2-d3bb711834acd3eda35a07d0be7911bc3dbb9e6f.tar.gz
edk2-d3bb711834acd3eda35a07d0be7911bc3dbb9e6f.tar.bz2
edk2-d3bb711834acd3eda35a07d0be7911bc3dbb9e6f.zip
BaseTools: Eliminate two shift-negative-value in FvLib.c
clang 3.8 flags -Wshift-negative-value warning, which turns fatal due to use of -Werror. Fixes: https://github.com/tianocore/edk2/issues/49 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zenith432 <zenith432@users.sourceforge.net> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/C/Common/FvLib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/BaseTools/Source/C/Common/FvLib.c b/BaseTools/Source/C/Common/FvLib.c
index 938aa098f5..f97a7f21ce 100644
--- a/BaseTools/Source/C/Common/FvLib.c
+++ b/BaseTools/Source/C/Common/FvLib.c
@@ -194,7 +194,7 @@ Returns:
//
// Get next file, compensate for 8 byte alignment if necessary.
//
- *NextFile = (EFI_FFS_FILE_HEADER *) ((((UINTN) CurrentFile - (UINTN) mFvHeader + GetFfsFileLength(CurrentFile) + 0x07) & (-1 << 3)) + (UINT8 *) mFvHeader);
+ *NextFile = (EFI_FFS_FILE_HEADER *) ((((UINTN) CurrentFile - (UINTN) mFvHeader + GetFfsFileLength(CurrentFile) + 0x07) & (~(UINTN) 7)) + (UINT8 *) mFvHeader);
//
// Verify file is in this FV.
@@ -479,7 +479,7 @@ Returns:
//
// Find next section (including compensating for alignment issues.
//
- CurrentSection.CommonHeader = (EFI_COMMON_SECTION_HEADER *) ((((UINTN) CurrentSection.CommonHeader) + GetSectionFileLength(CurrentSection.CommonHeader) + 0x03) & (-1 << 2));
+ CurrentSection.CommonHeader = (EFI_COMMON_SECTION_HEADER *) ((((UINTN) CurrentSection.CommonHeader) + GetSectionFileLength(CurrentSection.CommonHeader) + 0x03) & (~(UINTN) 3));
}
return EFI_NOT_FOUND;