summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseLib/Math64.c
diff options
context:
space:
mode:
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-25 06:05:36 +0000
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-25 06:05:36 +0000
commit582510249f2fb1334e507b99421b9485f6b89159 (patch)
treecd9d7414885d26e79565cd12ec241af93dc600f2 /MdePkg/Library/BaseLib/Math64.c
parentba3a1cb5bb97ffdea980f188fbd14b08200aeac6 (diff)
downloadedk2-platforms-582510249f2fb1334e507b99421b9485f6b89159.tar.xz
Make MDE package pass intel IPF compiler with /W4 /WX switched on.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2312 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BaseLib/Math64.c')
-rw-r--r--MdePkg/Library/BaseLib/Math64.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/MdePkg/Library/BaseLib/Math64.c b/MdePkg/Library/BaseLib/Math64.c
index 3312d789ac..514ae99020 100644
--- a/MdePkg/Library/BaseLib/Math64.c
+++ b/MdePkg/Library/BaseLib/Math64.c
@@ -85,10 +85,13 @@ InternalMathARShiftU64 (
IN UINTN Count
)
{
+ INTN TestValue;
+
//
// Test if this compiler supports arithmetic shift
//
- if ((((-1) << (sizeof (-1) * 8 - 1)) >> (sizeof (-1) * 8 - 1)) == -1) {
+ TestValue = (((-1) << (sizeof (-1) * 8 - 1)) >> (sizeof (-1) * 8 - 1));
+ if (TestValue == -1) {
//
// Arithmetic shift is supported
//
@@ -169,10 +172,13 @@ InternalMathSwapBytes64 (
IN UINT64 Operand
)
{
- return (UINT64)(
- ((UINT64)SwapBytes32 ((UINT32)Operand) << 32) |
- ((UINT64)SwapBytes32 ((UINT32)(Operand >> 32)))
- );
+ UINT64 LowerBytes;
+ UINT64 HigherBytes;
+
+ LowerBytes = (UINT64) SwapBytes32 ((UINT32) Operand);
+ HigherBytes = (UINT64) SwapBytes32 ((UINT32) (Operand >> 32));
+
+ return (LowerBytes << 32 | HigherBytes);
}
/**