]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/Math64.c
Make MDE package pass intel IPF compiler with /W4 /WX switched on.
[mirror_edk2.git] / MdePkg / Library / BaseLib / Math64.c
index 3312d789acf03ef4dc2eab6f91e7d5468c630096..514ae9902086210cae22c386989a4fe2acd724e8 100644 (file)
@@ -85,10 +85,13 @@ InternalMathARShiftU64 (
   IN      UINTN                     Count\r
   )\r
 {\r
+  INTN  TestValue;\r
+\r
   //\r
   // Test if this compiler supports arithmetic shift\r
   //\r
-  if ((((-1) << (sizeof (-1) * 8 - 1)) >> (sizeof (-1) * 8 - 1)) == -1) {\r
+  TestValue = (((-1) << (sizeof (-1) * 8 - 1)) >> (sizeof (-1) * 8 - 1));\r
+  if (TestValue == -1) {\r
     //\r
     // Arithmetic shift is supported\r
     //\r
@@ -169,10 +172,13 @@ InternalMathSwapBytes64 (
   IN      UINT64                    Operand\r
   )\r
 {\r
-  return (UINT64)(\r
-           ((UINT64)SwapBytes32 ((UINT32)Operand) << 32) |\r
-           ((UINT64)SwapBytes32 ((UINT32)(Operand >> 32)))\r
-           );\r
+  UINT64  LowerBytes;\r
+  UINT64  HigherBytes;\r
+\r
+  LowerBytes  = (UINT64) SwapBytes32 ((UINT32) Operand);\r
+  HigherBytes = (UINT64) SwapBytes32 ((UINT32) (Operand >> 32));\r
+\r
+  return (LowerBytes << 32 | HigherBytes);\r
 }\r
 \r
 /**\r