summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Library')
-rw-r--r--MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c4
-rw-r--r--MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c2
-rw-r--r--MdeModulePkg/Library/FileExplorerLib/FileExplorer.c4
-rw-r--r--MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c4
-rw-r--r--MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c4
5 files changed, 9 insertions, 9 deletions
diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
index 71e05bd..d7abcc8 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
@@ -10,7 +10,7 @@
ValidateFmpCapsule(), DisplayCapsuleImage(), ConvertBmpToGopBlt() will
receive untrusted input and do basic validation.
- Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -547,7 +547,7 @@ ConvertBmpToGopBlt (
}
- ImageIndex = (UINTN) (Image - ImageHeader);
+ ImageIndex = (UINTN) Image - (UINTN) ImageHeader;
if ((ImageIndex % 4) != 0) {
//
// Bmp Image starts each row on a 32-bit boundary!
diff --git a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c
index 434736f..6a4d25b 100644
--- a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c
+++ b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c
@@ -226,7 +226,7 @@ DxePrintLibPrint2ProtocolVaListToBaseList (
//
// If BASE_LIST is larger than Size, then return FALSE
//
- if ((UINTN)((UINT8 *)BaseListMarker - (UINT8 *)BaseListStart) > Size) {
+ if (((UINTN)BaseListMarker - (UINTN)BaseListStart) > Size) {
DEBUG ((DEBUG_ERROR, "The input variable argument list is too long. Please consider breaking into multiple print calls.\n"));
return FALSE;
}
diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
index 5eedad7..9182751 100644
--- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
+++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
@@ -728,7 +728,7 @@ LibAppendFileName (
// that overlap.
//
StrCpyS (TmpStr, MaxLen, Ptr + 3);
- StrCpyS (LastSlash, MaxLen - (UINTN) (LastSlash - Str), TmpStr);
+ StrCpyS (LastSlash, MaxLen - ((UINTN) LastSlash - (UINTN) Str) / sizeof (CHAR16), TmpStr);
Ptr = LastSlash;
} else if (*Ptr == '\\' && *(Ptr + 1) == '.' && *(Ptr + 2) == '\\') {
//
@@ -740,7 +740,7 @@ LibAppendFileName (
// that overlap.
//
StrCpyS (TmpStr, MaxLen, Ptr + 2);
- StrCpyS (Ptr, MaxLen - (UINTN) (Ptr - Str), TmpStr);
+ StrCpyS (Ptr, MaxLen - ((UINTN) Ptr - (UINTN) Str) / sizeof (CHAR16), TmpStr);
Ptr = LastSlash;
} else if (*Ptr == '\\') {
LastSlash = Ptr;
diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
index 5698c91..1f8aaf4 100644
--- a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
+++ b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
@@ -1,7 +1,7 @@
/** @file
Save the S3 data to S3 boot script.
- Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -2025,7 +2025,7 @@ S3BootScriptCalculateInsertAddress (
// calculate the Position offset
//
if (Position != NULL) {
- PositionOffset = (UINTN) ((UINT8 *)Position - S3TableBase);
+ PositionOffset = (UINTN)Position - (UINTN)S3TableBase;
//
// If the BeforeOrAfter is FALSE, that means to insert the node right after the node.
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
index 6f705bd..116cf28 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
@@ -1,7 +1,7 @@
/** @file
Load option library functions which relate with creating and processing load options.
-Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -912,7 +912,7 @@ EfiBootManagerVariableToLoadOptionEx (
FilePath = (EFI_DEVICE_PATH_PROTOCOL *) VariablePtr;
VariablePtr += FilePathSize;
- OptionalDataSize = (UINT32) (VariableSize - (UINTN) (VariablePtr - Variable));
+ OptionalDataSize = (UINT32) (VariableSize - ((UINTN) VariablePtr - (UINTN) Variable));
if (OptionalDataSize == 0) {
OptionalData = NULL;
} else {