diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2021-12-05 14:54:05 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-07 17:24:28 +0000 |
commit | 2f88bd3a1296c522317f1c21377876de63de5be7 (patch) | |
tree | ba47875489cc5698061275a495983e9dea3be098 /MdePkg/Library/BaseMemoryLib/CopyMem.c | |
parent | 1436aea4d5707e672672a11bda72be2c63c936c3 (diff) | |
download | edk2-2f88bd3a1296c522317f1c21377876de63de5be7.tar.gz edk2-2f88bd3a1296c522317f1c21377876de63de5be7.tar.bz2 edk2-2f88bd3a1296c522317f1c21377876de63de5be7.zip |
MdePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737
Apply uncrustify changes to .c/.h files in the MdePkg package
Cc: Andrew Fish <afish@apple.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'MdePkg/Library/BaseMemoryLib/CopyMem.c')
-rw-r--r-- | MdePkg/Library/BaseMemoryLib/CopyMem.c | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/MdePkg/Library/BaseMemoryLib/CopyMem.c b/MdePkg/Library/BaseMemoryLib/CopyMem.c index 55e8616c98..929f700747 100644 --- a/MdePkg/Library/BaseMemoryLib/CopyMem.c +++ b/MdePkg/Library/BaseMemoryLib/CopyMem.c @@ -11,9 +11,6 @@ **/
-
-
-
#include "MemLibInternals.h"
/**
@@ -29,9 +26,9 @@ VOID *
EFIAPI
InternalMemCopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
+ OUT VOID *DestinationBuffer,
+ IN CONST VOID *SourceBuffer,
+ IN UINTN Length
)
{
//
@@ -39,32 +36,32 @@ InternalMemCopyMem ( // volatile to prevent the optimizer from replacing this function with
// the intrinsic memcpy()
//
- volatile UINT8 *Destination8;
- CONST UINT8 *Source8;
- volatile UINT32 *Destination32;
- CONST UINT32 *Source32;
- volatile UINT64 *Destination64;
- CONST UINT64 *Source64;
- UINTN Alignment;
+ volatile UINT8 *Destination8;
+ CONST UINT8 *Source8;
+ volatile UINT32 *Destination32;
+ CONST UINT32 *Source32;
+ volatile UINT64 *Destination64;
+ CONST UINT64 *Source64;
+ UINTN Alignment;
if ((((UINTN)DestinationBuffer & 0x7) == 0) && (((UINTN)SourceBuffer & 0x7) == 0) && (Length >= 8)) {
if (SourceBuffer > DestinationBuffer) {
- Destination64 = (UINT64*)DestinationBuffer;
- Source64 = (CONST UINT64*)SourceBuffer;
+ Destination64 = (UINT64 *)DestinationBuffer;
+ Source64 = (CONST UINT64 *)SourceBuffer;
while (Length >= 8) {
*(Destination64++) = *(Source64++);
- Length -= 8;
+ Length -= 8;
}
// Finish if there are still some bytes to copy
- Destination8 = (UINT8*)Destination64;
- Source8 = (CONST UINT8*)Source64;
+ Destination8 = (UINT8 *)Destination64;
+ Source8 = (CONST UINT8 *)Source64;
while (Length-- != 0) {
*(Destination8++) = *(Source8++);
}
} else if (SourceBuffer < DestinationBuffer) {
- Destination64 = (UINT64*)((UINTN)DestinationBuffer + Length);
- Source64 = (CONST UINT64*)((UINTN)SourceBuffer + Length);
+ Destination64 = (UINT64 *)((UINTN)DestinationBuffer + Length);
+ Source64 = (CONST UINT64 *)((UINTN)SourceBuffer + Length);
// Destination64 and Source64 were aligned on a 64-bit boundary
// but if length is not a multiple of 8 bytes then they won't be
@@ -72,40 +69,41 @@ InternalMemCopyMem ( Alignment = Length & 0x7;
if (Alignment != 0) {
- Destination8 = (UINT8*)Destination64;
- Source8 = (CONST UINT8*)Source64;
+ Destination8 = (UINT8 *)Destination64;
+ Source8 = (CONST UINT8 *)Source64;
while (Alignment-- != 0) {
*(--Destination8) = *(--Source8);
--Length;
}
- Destination64 = (UINT64*)Destination8;
- Source64 = (CONST UINT64*)Source8;
+
+ Destination64 = (UINT64 *)Destination8;
+ Source64 = (CONST UINT64 *)Source8;
}
while (Length > 0) {
*(--Destination64) = *(--Source64);
- Length -= 8;
+ Length -= 8;
}
}
} else if ((((UINTN)DestinationBuffer & 0x3) == 0) && (((UINTN)SourceBuffer & 0x3) == 0) && (Length >= 4)) {
if (SourceBuffer > DestinationBuffer) {
- Destination32 = (UINT32*)DestinationBuffer;
- Source32 = (CONST UINT32*)SourceBuffer;
+ Destination32 = (UINT32 *)DestinationBuffer;
+ Source32 = (CONST UINT32 *)SourceBuffer;
while (Length >= 4) {
*(Destination32++) = *(Source32++);
- Length -= 4;
+ Length -= 4;
}
// Finish if there are still some bytes to copy
- Destination8 = (UINT8*)Destination32;
- Source8 = (CONST UINT8*)Source32;
+ Destination8 = (UINT8 *)Destination32;
+ Source8 = (CONST UINT8 *)Source32;
while (Length-- != 0) {
*(Destination8++) = *(Source8++);
}
} else if (SourceBuffer < DestinationBuffer) {
- Destination32 = (UINT32*)((UINTN)DestinationBuffer + Length);
- Source32 = (CONST UINT32*)((UINTN)SourceBuffer + Length);
+ Destination32 = (UINT32 *)((UINTN)DestinationBuffer + Length);
+ Source32 = (CONST UINT32 *)((UINTN)SourceBuffer + Length);
// Destination32 and Source32 were aligned on a 32-bit boundary
// but if length is not a multiple of 4 bytes then they won't be
@@ -113,36 +111,38 @@ InternalMemCopyMem ( Alignment = Length & 0x3;
if (Alignment != 0) {
- Destination8 = (UINT8*)Destination32;
- Source8 = (CONST UINT8*)Source32;
+ Destination8 = (UINT8 *)Destination32;
+ Source8 = (CONST UINT8 *)Source32;
while (Alignment-- != 0) {
*(--Destination8) = *(--Source8);
--Length;
}
- Destination32 = (UINT32*)Destination8;
- Source32 = (CONST UINT32*)Source8;
+
+ Destination32 = (UINT32 *)Destination8;
+ Source32 = (CONST UINT32 *)Source8;
}
while (Length > 0) {
*(--Destination32) = *(--Source32);
- Length -= 4;
+ Length -= 4;
}
}
} else {
if (SourceBuffer > DestinationBuffer) {
- Destination8 = (UINT8*)DestinationBuffer;
- Source8 = (CONST UINT8*)SourceBuffer;
+ Destination8 = (UINT8 *)DestinationBuffer;
+ Source8 = (CONST UINT8 *)SourceBuffer;
while (Length-- != 0) {
*(Destination8++) = *(Source8++);
}
} else if (SourceBuffer < DestinationBuffer) {
- Destination8 = (UINT8*)DestinationBuffer + (Length - 1);
- Source8 = (CONST UINT8*)SourceBuffer + (Length - 1);
+ Destination8 = (UINT8 *)DestinationBuffer + (Length - 1);
+ Source8 = (CONST UINT8 *)SourceBuffer + (Length - 1);
while (Length-- != 0) {
*(Destination8--) = *(Source8--);
}
}
}
+
return DestinationBuffer;
}
|