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/BaseLib/QuickSort.c | |
parent | 1436aea4d5707e672672a11bda72be2c63c936c3 (diff) | |
download | edk2-2f88bd3a1296c522317f1c21377876de63de5be7.tar.gz |
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/BaseLib/QuickSort.c')
-rw-r--r-- | MdePkg/Library/BaseLib/QuickSort.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/MdePkg/Library/BaseLib/QuickSort.c b/MdePkg/Library/BaseLib/QuickSort.c index a825c072b0..d9f0e9a0f4 100644 --- a/MdePkg/Library/BaseLib/QuickSort.c +++ b/MdePkg/Library/BaseLib/QuickSort.c @@ -34,16 +34,16 @@ VOID
EFIAPI
QuickSort (
- IN OUT VOID *BufferToSort,
- IN CONST UINTN Count,
- IN CONST UINTN ElementSize,
- IN BASE_SORT_COMPARE CompareFunction,
- OUT VOID *BufferOneElement
+ IN OUT VOID *BufferToSort,
+ IN CONST UINTN Count,
+ IN CONST UINTN ElementSize,
+ IN BASE_SORT_COMPARE CompareFunction,
+ OUT VOID *BufferOneElement
)
{
- VOID *Pivot;
- UINTN LoopCount;
- UINTN NextSwapLocation;
+ VOID *Pivot;
+ UINTN LoopCount;
+ UINTN NextSwapLocation;
ASSERT (BufferToSort != NULL);
ASSERT (CompareFunction != NULL);
@@ -59,7 +59,7 @@ QuickSort ( //
// pick a pivot (we choose last element)
//
- Pivot = ((UINT8*) BufferToSort + ((Count - 1) * ElementSize));
+ Pivot = ((UINT8 *)BufferToSort + ((Count - 1) * ElementSize));
//
// Now get the pivot such that all on "left" are below it
@@ -69,13 +69,13 @@ QuickSort ( //
// if the element is less than or equal to the pivot
//
- if (CompareFunction ((VOID*) ((UINT8*) BufferToSort + ((LoopCount) * ElementSize)), Pivot) <= 0){
+ if (CompareFunction ((VOID *)((UINT8 *)BufferToSort + ((LoopCount) * ElementSize)), Pivot) <= 0) {
//
// swap
//
- CopyMem (BufferOneElement, (UINT8*) BufferToSort + (NextSwapLocation * ElementSize), ElementSize);
- CopyMem ((UINT8*) BufferToSort + (NextSwapLocation * ElementSize), (UINT8*) BufferToSort + ((LoopCount) * ElementSize), ElementSize);
- CopyMem ((UINT8*) BufferToSort + ((LoopCount)*ElementSize), BufferOneElement, ElementSize);
+ CopyMem (BufferOneElement, (UINT8 *)BufferToSort + (NextSwapLocation * ElementSize), ElementSize);
+ CopyMem ((UINT8 *)BufferToSort + (NextSwapLocation * ElementSize), (UINT8 *)BufferToSort + ((LoopCount) * ElementSize), ElementSize);
+ CopyMem ((UINT8 *)BufferToSort + ((LoopCount)*ElementSize), BufferOneElement, ElementSize);
//
// increment NextSwapLocation
@@ -83,12 +83,13 @@ QuickSort ( NextSwapLocation++;
}
}
+
//
// swap pivot to it's final position (NextSwapLocation)
//
CopyMem (BufferOneElement, Pivot, ElementSize);
- CopyMem (Pivot, (UINT8*) BufferToSort + (NextSwapLocation * ElementSize), ElementSize);
- CopyMem ((UINT8*) BufferToSort + (NextSwapLocation * ElementSize), BufferOneElement, ElementSize);
+ CopyMem (Pivot, (UINT8 *)BufferToSort + (NextSwapLocation * ElementSize), ElementSize);
+ CopyMem ((UINT8 *)BufferToSort + (NextSwapLocation * ElementSize), BufferOneElement, ElementSize);
//
// Now recurse on 2 partial lists. neither of these will have the 'pivot' element
|