X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FLibrary%2FBaseLib%2FSwapBytes32.c;h=ee8a60bb4cdcd1bccb3594810ef1200cb966010e;hb=adbcbf8ffcaedab483d23b52e8283aaad74cc807;hp=4e683b09d18d397619d67ef02caecc572480cb15;hpb=878ddf1fc3540a715f63594ed22b6929e881afb4;p=mirror_edk2.git diff --git a/MdePkg/Library/BaseLib/SwapBytes32.c b/MdePkg/Library/BaseLib/SwapBytes32.c index 4e683b09d1..ee8a60bb4c 100644 --- a/MdePkg/Library/BaseLib/SwapBytes32.c +++ b/MdePkg/Library/BaseLib/SwapBytes32.c @@ -12,6 +12,11 @@ **/ +// +// Include common header file for this module. +// + + #include "BaseLibInternals.h" /** @@ -32,8 +37,11 @@ SwapBytes32 ( IN UINT32 Operand ) { - return (UINT32)( - ((UINT32)SwapBytes16 ((UINT16)Operand) << 16) | - ((UINT32)SwapBytes16 ((UINT16)(Operand >> 16))) - ); + UINT32 LowerBytes; + UINT32 HigherBytes; + + LowerBytes = (UINT32) SwapBytes16 ((UINT16) Operand); + HigherBytes = (UINT32) SwapBytes16 ((UINT16) (Operand >> 16)); + + return (LowerBytes << 16 | HigherBytes); }