VOID\r
EFIAPI\r
QuickSort (\r
- IN OUT VOID *BufferToSort,\r
- IN CONST UINTN Count,\r
- IN CONST UINTN ElementSize,\r
- IN BASE_SORT_COMPARE CompareFunction,\r
- OUT VOID *BufferOneElement\r
+ IN OUT VOID *BufferToSort,\r
+ IN CONST UINTN Count,\r
+ IN CONST UINTN ElementSize,\r
+ IN BASE_SORT_COMPARE CompareFunction,\r
+ OUT VOID *BufferOneElement\r
)\r
{\r
- VOID *Pivot;\r
- UINTN LoopCount;\r
- UINTN NextSwapLocation;\r
+ VOID *Pivot;\r
+ UINTN LoopCount;\r
+ UINTN NextSwapLocation;\r
\r
ASSERT (BufferToSort != NULL);\r
ASSERT (CompareFunction != NULL);\r
//\r
// pick a pivot (we choose last element)\r
//\r
- Pivot = ((UINT8*) BufferToSort + ((Count - 1) * ElementSize));\r
+ Pivot = ((UINT8 *)BufferToSort + ((Count - 1) * ElementSize));\r
\r
//\r
// Now get the pivot such that all on "left" are below it\r
//\r
// if the element is less than or equal to the pivot\r
//\r
- if (CompareFunction ((VOID*) ((UINT8*) BufferToSort + ((LoopCount) * ElementSize)), Pivot) <= 0){\r
+ if (CompareFunction ((VOID *)((UINT8 *)BufferToSort + ((LoopCount) * ElementSize)), Pivot) <= 0) {\r
//\r
// swap\r
//\r
- CopyMem (BufferOneElement, (UINT8*) BufferToSort + (NextSwapLocation * ElementSize), ElementSize);\r
- CopyMem ((UINT8*) BufferToSort + (NextSwapLocation * ElementSize), (UINT8*) BufferToSort + ((LoopCount) * ElementSize), ElementSize);\r
- CopyMem ((UINT8*) BufferToSort + ((LoopCount)*ElementSize), BufferOneElement, ElementSize);\r
+ CopyMem (BufferOneElement, (UINT8 *)BufferToSort + (NextSwapLocation * ElementSize), ElementSize);\r
+ CopyMem ((UINT8 *)BufferToSort + (NextSwapLocation * ElementSize), (UINT8 *)BufferToSort + ((LoopCount) * ElementSize), ElementSize);\r
+ CopyMem ((UINT8 *)BufferToSort + ((LoopCount)*ElementSize), BufferOneElement, ElementSize);\r
\r
//\r
// increment NextSwapLocation\r
NextSwapLocation++;\r
}\r
}\r
+\r
//\r
// swap pivot to it's final position (NextSwapLocation)\r
//\r
CopyMem (BufferOneElement, Pivot, ElementSize);\r
- CopyMem (Pivot, (UINT8*) BufferToSort + (NextSwapLocation * ElementSize), ElementSize);\r
- CopyMem ((UINT8*) BufferToSort + (NextSwapLocation * ElementSize), BufferOneElement, ElementSize);\r
+ CopyMem (Pivot, (UINT8 *)BufferToSort + (NextSwapLocation * ElementSize), ElementSize);\r
+ CopyMem ((UINT8 *)BufferToSort + (NextSwapLocation * ElementSize), BufferOneElement, ElementSize);\r
\r
//\r
// Now recurse on 2 partial lists. neither of these will have the 'pivot' element\r