]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/UefiSortLib/UefiSortLib.c
MdeModulePkg: Apply uncrustify changes
[mirror_edk2.git] / MdeModulePkg / Library / UefiSortLib / UefiSortLib.c
index 29d8735c226f32c851ae926c15643eabea40b472..0ba12449309a1bd7d27ca5cfba14371bbf11973e 100644 (file)
@@ -19,7 +19,7 @@
 #include <Library/SortLib.h>\r
 #include <Library/DevicePathLib.h>\r
 \r
-STATIC EFI_UNICODE_COLLATION_PROTOCOL   *mUnicodeCollation = NULL;\r
+STATIC EFI_UNICODE_COLLATION_PROTOCOL  *mUnicodeCollation = NULL;\r
 \r
 #define USL_FREE_NON_NULL(Pointer)  \\r
 {                                     \\r
@@ -50,19 +50,19 @@ STATIC EFI_UNICODE_COLLATION_PROTOCOL   *mUnicodeCollation = NULL;
 VOID\r
 EFIAPI\r
 PerformQuickSort (\r
-  IN OUT VOID                           *BufferToSort,\r
-  IN CONST UINTN                        Count,\r
-  IN CONST UINTN                        ElementSize,\r
-  IN       SORT_COMPARE                 CompareFunction\r
+  IN OUT VOID            *BufferToSort,\r
+  IN CONST UINTN         Count,\r
+  IN CONST UINTN         ElementSize,\r
+  IN       SORT_COMPARE  CompareFunction\r
   )\r
 {\r
   VOID  *Buffer;\r
 \r
-  ASSERT(BufferToSort     != NULL);\r
-  ASSERT(CompareFunction  != NULL);\r
+  ASSERT (BufferToSort     != NULL);\r
+  ASSERT (CompareFunction  != NULL);\r
 \r
-  Buffer = AllocateZeroPool(ElementSize);\r
-  ASSERT(Buffer != NULL);\r
+  Buffer = AllocateZeroPool (ElementSize);\r
+  ASSERT (Buffer != NULL);\r
 \r
   QuickSort (\r
     BufferToSort,\r
@@ -72,7 +72,7 @@ PerformQuickSort (
     Buffer\r
     );\r
 \r
-  FreePool(Buffer);\r
+  FreePool (Buffer);\r
   return;\r
 }\r
 \r
@@ -89,8 +89,8 @@ PerformQuickSort (
 INTN\r
 EFIAPI\r
 DevicePathCompare (\r
-  IN  CONST VOID             *Buffer1,\r
-  IN  CONST VOID             *Buffer2\r
+  IN  CONST VOID  *Buffer1,\r
+  IN  CONST VOID  *Buffer2\r
   )\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath1;\r
@@ -100,8 +100,8 @@ DevicePathCompare (
   EFI_STATUS                Status;\r
   INTN                      RetVal;\r
 \r
-  DevicePath1 = *(EFI_DEVICE_PATH_PROTOCOL**)Buffer1;\r
-  DevicePath2 = *(EFI_DEVICE_PATH_PROTOCOL**)Buffer2;\r
+  DevicePath1 = *(EFI_DEVICE_PATH_PROTOCOL **)Buffer1;\r
+  DevicePath2 = *(EFI_DEVICE_PATH_PROTOCOL **)Buffer2;\r
 \r
   if (DevicePath1 == NULL) {\r
     if (DevicePath2 == NULL) {\r
@@ -116,37 +116,41 @@ DevicePathCompare (
   }\r
 \r
   if (mUnicodeCollation == NULL) {\r
-    Status = gBS->LocateProtocol(\r
-      &gEfiUnicodeCollation2ProtocolGuid,\r
-      NULL,\r
-      (VOID**)&mUnicodeCollation);\r
+    Status = gBS->LocateProtocol (\r
+                    &gEfiUnicodeCollation2ProtocolGuid,\r
+                    NULL,\r
+                    (VOID **)&mUnicodeCollation\r
+                    );\r
 \r
-    ASSERT_EFI_ERROR(Status);\r
+    ASSERT_EFI_ERROR (Status);\r
   }\r
 \r
-  TextPath1 = ConvertDevicePathToText(\r
-    DevicePath1,\r
-    FALSE,\r
-    FALSE);\r
+  TextPath1 = ConvertDevicePathToText (\r
+                DevicePath1,\r
+                FALSE,\r
+                FALSE\r
+                );\r
 \r
-  TextPath2 = ConvertDevicePathToText(\r
-    DevicePath2,\r
-    FALSE,\r
-    FALSE);\r
+  TextPath2 = ConvertDevicePathToText (\r
+                DevicePath2,\r
+                FALSE,\r
+                FALSE\r
+                );\r
 \r
   if (TextPath1 == NULL) {\r
     RetVal = -1;\r
   } else if (TextPath2 == NULL) {\r
     RetVal = 1;\r
   } else {\r
-    RetVal = mUnicodeCollation->StriColl(\r
-      mUnicodeCollation,\r
-      TextPath1,\r
-      TextPath2);\r
+    RetVal = mUnicodeCollation->StriColl (\r
+                                  mUnicodeCollation,\r
+                                  TextPath1,\r
+                                  TextPath2\r
+                                  );\r
   }\r
 \r
-  USL_FREE_NON_NULL(TextPath1);\r
-  USL_FREE_NON_NULL(TextPath2);\r
+  USL_FREE_NON_NULL (TextPath1);\r
+  USL_FREE_NON_NULL (TextPath2);\r
 \r
   return (RetVal);\r
 }\r
@@ -164,27 +168,29 @@ DevicePathCompare (
 INTN\r
 EFIAPI\r
 StringNoCaseCompare (\r
-  IN  CONST VOID             *Buffer1,\r
-  IN  CONST VOID             *Buffer2\r
+  IN  CONST VOID  *Buffer1,\r
+  IN  CONST VOID  *Buffer2\r
   )\r
 {\r
-  EFI_STATUS                Status;\r
+  EFI_STATUS  Status;\r
+\r
   if (mUnicodeCollation == NULL) {\r
-    Status = gBS->LocateProtocol(\r
-      &gEfiUnicodeCollation2ProtocolGuid,\r
-      NULL,\r
-      (VOID**)&mUnicodeCollation);\r
+    Status = gBS->LocateProtocol (\r
+                    &gEfiUnicodeCollation2ProtocolGuid,\r
+                    NULL,\r
+                    (VOID **)&mUnicodeCollation\r
+                    );\r
 \r
-    ASSERT_EFI_ERROR(Status);\r
+    ASSERT_EFI_ERROR (Status);\r
   }\r
 \r
-  return (mUnicodeCollation->StriColl(\r
-    mUnicodeCollation,\r
-    *(CHAR16**)Buffer1,\r
-    *(CHAR16**)Buffer2));\r
+  return (mUnicodeCollation->StriColl (\r
+                               mUnicodeCollation,\r
+                               *(CHAR16 **)Buffer1,\r
+                               *(CHAR16 **)Buffer2\r
+                               ));\r
 }\r
 \r
-\r
 /**\r
   Function to compare 2 strings.\r
 \r
@@ -198,11 +204,12 @@ StringNoCaseCompare (
 INTN\r
 EFIAPI\r
 StringCompare (\r
-  IN  CONST VOID                *Buffer1,\r
-  IN  CONST VOID                *Buffer2\r
+  IN  CONST VOID  *Buffer1,\r
+  IN  CONST VOID  *Buffer2\r
   )\r
 {\r
-  return (StrCmp(\r
-    *(CHAR16**)Buffer1,\r
-    *(CHAR16**)Buffer2));\r
+  return (StrCmp (\r
+            *(CHAR16 **)Buffer1,\r
+            *(CHAR16 **)Buffer2\r
+            ));\r
 }\r