THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
- Module Name: Math64.c\r
-\r
**/\r
\r
+\r
+\r
+\r
#include "BaseLibInternals.h"\r
\r
/**\r
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
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
\r
**/\r
INT64\r
+EFIAPI\r
InternalMathDivRemS64x64 (\r
IN INT64 Dividend,\r
IN INT64 Divisor,\r