]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/SwapBytes32.c
1. Port X64, IPF and EBC arch for BaseLib
[mirror_edk2.git] / MdePkg / Library / BaseLib / SwapBytes32.c
index 4e683b09d18d397619d67ef02caecc572480cb15..ee8a60bb4cdcd1bccb3594810ef1200cb966010e 100644 (file)
 \r
 **/\r
 \r
+//\r
+// Include common header file for this module.\r
+//\r
+\r
+\r
 #include "BaseLibInternals.h"\r
 \r
 /**\r
@@ -32,8 +37,11 @@ SwapBytes32 (
   IN      UINT32                    Operand\r
   )\r
 {\r
-  return (UINT32)(\r
-           ((UINT32)SwapBytes16 ((UINT16)Operand) << 16) |\r
-           ((UINT32)SwapBytes16 ((UINT16)(Operand >> 16)))\r
-           );\r
+  UINT32  LowerBytes;\r
+  UINT32  HigherBytes;\r
+\r
+  LowerBytes  = (UINT32) SwapBytes16 ((UINT16) Operand);\r
+  HigherBytes = (UINT32) SwapBytes16 ((UINT16) (Operand >> 16));\r
+\r
+  return (LowerBytes << 16 | HigherBytes);\r
 }\r