]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/SwapBytes32.c
Update the text to use "x64" instead of "X64" in MdePkg.
[mirror_edk2.git] / MdePkg / Library / BaseLib / SwapBytes32.c
index 4e683b09d18d397619d67ef02caecc572480cb15..f1a1b8925e1048490d0dc88d29b3f5b7233013a1 100644 (file)
@@ -12,6 +12,9 @@
 \r
 **/\r
 \r
+\r
+\r
+\r
 #include "BaseLibInternals.h"\r
 \r
 /**\r
@@ -21,9 +24,9 @@
   from little endian to big endian or vice versa. The byte swapped value is\r
   returned.\r
 \r
-  @param  Operand A 32-bit unsigned value.\r
+  @param  Value Operand A 32-bit unsigned value.\r
 \r
-  @return The byte swaped Operand.\r
+  @return The byte swapped Operand.\r
 \r
 **/\r
 UINT32\r
@@ -32,8 +35,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