summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Foundation
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2010-09-13 10:46:02 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2010-09-13 10:46:02 +0000
commit52fb4d3d133883c6e0e8b8ee8a7af590a920f5eb (patch)
tree0a0dd2d07bd3541d6e577f41c7a9b113a7ead022 /EdkCompatibilityPkg/Foundation
parent0a16169be8fcade376d291fd70371e262b2592ee (diff)
downloadedk2-platforms-52fb4d3d133883c6e0e8b8ee8a7af590a920f5eb.tar.xz
Refine some code to make code run safely.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10873 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Foundation')
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrOpCodeCreation.c8
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/GetPowerOfTwo64.c2
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLib.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrOpCodeCreation.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrOpCodeCreation.c
index 98b949d3b6..30436d5de1 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrOpCodeCreation.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrOpCodeCreation.c
@@ -243,7 +243,7 @@ Returns:
for (Index = 0; Index < OptionCount; Index++) {
OneOfOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;
- OneOfOption.Header.Length = sizeof (EFI_IFR_ONE_OF_OPTION);
+ OneOfOption.Header.Length = (UINT8) sizeof (EFI_IFR_ONE_OF_OPTION);
OneOfOption.Option = OptionsList[Index].StringToken;
OneOfOption.Value = OptionsList[Index].Value;
@@ -255,7 +255,7 @@ Returns:
LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ONE_OF_OPTION));
}
- EndOneOf.Header.Length = sizeof (EFI_IFR_END_ONE_OF);
+ EndOneOf.Header.Length = (UINT8) sizeof (EFI_IFR_END_ONE_OF);
EndOneOf.Header.OpCode = EFI_IFR_END_ONE_OF_OP;
EfiCopyMem (LocalBuffer, &EndOneOf, sizeof (EFI_IFR_END_ONE_OF));
@@ -331,7 +331,7 @@ Returns:
for (Index = 0; Index < OptionCount; Index++) {
OrderedListOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;
- OrderedListOption.Header.Length = sizeof (EFI_IFR_ONE_OF_OPTION);
+ OrderedListOption.Header.Length = (UINT8) sizeof (EFI_IFR_ONE_OF_OPTION);
OrderedListOption.Option = OptionsList[Index].StringToken;
OrderedListOption.Value = OptionsList[Index].Value;
@@ -343,7 +343,7 @@ Returns:
LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ONE_OF_OPTION));
}
- EndOrderedList.Header.Length = sizeof (EFI_IFR_END_ONE_OF);
+ EndOrderedList.Header.Length = (UINT8) sizeof (EFI_IFR_END_ONE_OF);
EndOrderedList.Header.OpCode = EFI_IFR_END_ONE_OF_OP;
EfiCopyMem (LocalBuffer, &EndOrderedList, sizeof (EFI_IFR_END_ONE_OF));
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/GetPowerOfTwo64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/GetPowerOfTwo64.c
index a442d001fd..3a83ed68d7 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/GetPowerOfTwo64.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/GetPowerOfTwo64.c
@@ -45,5 +45,5 @@ GetPowerOfTwo64 (
return 0;
}
- return LShiftU64 (1, HighBitSet64 (Operand));
+ return LShiftU64 (1, (UINTN) HighBitSet64 (Operand));
}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLib.c
index 68366d5a58..ecb55ebb2f 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLib.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLib.c
@@ -424,7 +424,7 @@ BasePrintLibVSPrint (
ArgumentString = StatusString [Index + WARNING_STATUS_NUMBER];
}
} else {
- Index = Status;
+ Index = (UINTN) Status;
if (Index <= WARNING_STATUS_NUMBER) {
ArgumentString = StatusString [Index];
}