]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
MdeModulePkg: Apply uncrustify changes
[mirror_edk2.git] / MdeModulePkg / Library / PeiDxeDebugLibReportStatusCode / DebugLib.c
index fb47401466b9b8a65ca303c4247fdeb92d118c2b..7ae5b16c8402af6d8e653998b0308746a49a7543 100644 (file)
@@ -25,7 +25,7 @@
 // VA_LIST can not initialize to NULL for all compiler, so we use this to\r
 // indicate a null VA_LIST\r
 //\r
-VA_LIST     mVaListNull;\r
+VA_LIST  mVaListNull;\r
 \r
 /**\r
   Prints a debug message to the debug output device if the specified error level is enabled.\r
@@ -53,7 +53,7 @@ DebugPrint (
   ...\r
   )\r
 {\r
-  VA_LIST         Marker;\r
+  VA_LIST  Marker;\r
 \r
   VA_START (Marker, Format);\r
   DebugVPrint (ErrorLevel, Format, Marker);\r
@@ -84,10 +84,10 @@ DebugPrint (
 **/\r
 VOID\r
 DebugPrintMarker (\r
-  IN  UINTN         ErrorLevel,\r
-  IN  CONST CHAR8   *Format,\r
-  IN  VA_LIST       VaListMarker,\r
-  IN  BASE_LIST     BaseListMarker\r
+  IN  UINTN        ErrorLevel,\r
+  IN  CONST CHAR8  *Format,\r
+  IN  VA_LIST      VaListMarker,\r
+  IN  BASE_LIST    BaseListMarker\r
   )\r
 {\r
   UINT64          Buffer[(EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64)) + 1];\r
@@ -152,8 +152,10 @@ DebugPrintMarker (
   // Copy the Format string into the record. It will be truncated if it's too long.\r
   //\r
   AsciiStrnCpyS (\r
-    FormatString, sizeof(Buffer) - (4 + sizeof(EFI_DEBUG_INFO) + 12 * sizeof(UINT64)),\r
-    Format,       sizeof(Buffer) - (4 + sizeof(EFI_DEBUG_INFO) + 12 * sizeof(UINT64)) - 1\r
+    FormatString,\r
+    sizeof (Buffer) - (4 + sizeof (EFI_DEBUG_INFO) + 12 * sizeof (UINT64)),\r
+    Format,\r
+    sizeof (Buffer) - (4 + sizeof (EFI_DEBUG_INFO) + 12 * sizeof (UINT64)) - 1\r
     );\r
 \r
   //\r
@@ -166,37 +168,41 @@ DebugPrintMarker (
   // Use the actual format string.\r
   //\r
   Format = FormatString;\r
-  for (; *Format != '\0'; Format++) {\r
+  for ( ; *Format != '\0'; Format++) {\r
     //\r
     // Only format with prefix % is processed.\r
     //\r
     if (*Format != '%') {\r
       continue;\r
     }\r
+\r
     Long = FALSE;\r
     //\r
     // Parse Flags and Width\r
     //\r
     for (Format++; TRUE; Format++) {\r
-      if (*Format == '.' || *Format == '-' || *Format == '+' || *Format == ' ') {\r
+      if ((*Format == '.') || (*Format == '-') || (*Format == '+') || (*Format == ' ')) {\r
         //\r
         // These characters in format field are omitted.\r
         //\r
         continue;\r
       }\r
-      if (*Format >= '0' && *Format <= '9') {\r
+\r
+      if ((*Format >= '0') && (*Format <= '9')) {\r
         //\r
         // These characters in format field are omitted.\r
         //\r
         continue;\r
       }\r
-      if (*Format == 'L' || *Format == 'l') {\r
+\r
+      if ((*Format == 'L') || (*Format == 'l')) {\r
         //\r
         // 'L" or "l" in format field means the number being printed is a UINT64\r
         //\r
         Long = TRUE;\r
         continue;\r
       }\r
+\r
       if (*Format == '*') {\r
         //\r
         // '*' in format field means the precision of the field is specified by\r
@@ -207,8 +213,10 @@ DebugPrintMarker (
         } else {\r
           BASE_ARG (BaseListMarkerPointer, UINTN) = BASE_ARG (BaseListMarker, UINTN);\r
         }\r
+\r
         continue;\r
       }\r
+\r
       if (*Format == '\0') {\r
         //\r
         // Make no output if Format string terminates unexpectedly when\r
@@ -216,6 +224,7 @@ DebugPrintMarker (
         //\r
         Format--;\r
       }\r
+\r
       //\r
       // When valid argument type detected or format string terminates unexpectedly,\r
       // the inner loop is done.\r
@@ -229,7 +238,8 @@ DebugPrintMarker (
     if ((*Format == 'p') && (sizeof (VOID *) > 4)) {\r
       Long = TRUE;\r
     }\r
-    if (*Format == 'p' || *Format == 'X' || *Format == 'x' || *Format == 'd' || *Format == 'u') {\r
+\r
+    if ((*Format == 'p') || (*Format == 'X') || (*Format == 'x') || (*Format == 'd') || (*Format == 'u')) {\r
       if (Long) {\r
         if (BaseListMarker == NULL) {\r
           BASE_ARG (BaseListMarkerPointer, INT64) = VA_ARG (VaListMarker, INT64);\r
@@ -243,7 +253,7 @@ DebugPrintMarker (
           BASE_ARG (BaseListMarkerPointer, int) = BASE_ARG (BaseListMarker, int);\r
         }\r
       }\r
-    } else if (*Format == 's' || *Format == 'S' || *Format == 'a' || *Format == 'g' || *Format == 't') {\r
+    } else if ((*Format == 's') || (*Format == 'S') || (*Format == 'a') || (*Format == 'g') || (*Format == 't')) {\r
       if (BaseListMarker == NULL) {\r
         BASE_ARG (BaseListMarkerPointer, VOID *) = VA_ARG (VaListMarker, VOID *);\r
       } else {\r
@@ -310,9 +320,9 @@ DebugPrintMarker (
 VOID\r
 EFIAPI\r
 DebugVPrint (\r
-  IN  UINTN         ErrorLevel,\r
-  IN  CONST CHAR8   *Format,\r
-  IN  VA_LIST       VaListMarker\r
+  IN  UINTN        ErrorLevel,\r
+  IN  CONST CHAR8  *Format,\r
+  IN  VA_LIST      VaListMarker\r
   )\r
 {\r
   DebugPrintMarker (ErrorLevel, Format, VaListMarker, NULL);\r
@@ -338,9 +348,9 @@ DebugVPrint (
 VOID\r
 EFIAPI\r
 DebugBPrint (\r
-  IN  UINTN         ErrorLevel,\r
-  IN  CONST CHAR8   *Format,\r
-  IN  BASE_LIST     BaseListMarker\r
+  IN  UINTN        ErrorLevel,\r
+  IN  CONST CHAR8  *Format,\r
+  IN  BASE_LIST    BaseListMarker\r
   )\r
 {\r
   DebugPrintMarker (ErrorLevel, Format, mVaListNull, BaseListMarker);\r
@@ -375,7 +385,7 @@ DebugAssert (
   IN CONST CHAR8  *Description\r
   )\r
 {\r
-  UINT64                 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof(UINT64)];\r
+  UINT64                 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64)];\r
   EFI_DEBUG_ASSERT_DATA  *AssertData;\r
   UINTN                  HeaderSize;\r
   UINTN                  TotalSize;\r
@@ -387,13 +397,13 @@ DebugAssert (
   //\r
   // Get string size\r
   //\r
-  HeaderSize       = sizeof (EFI_DEBUG_ASSERT_DATA);\r
+  HeaderSize = sizeof (EFI_DEBUG_ASSERT_DATA);\r
   //\r
   // Compute string size of module name enclosed by []\r
   //\r
-  ModuleNameSize   = 2 + AsciiStrSize (gEfiCallerBaseName);\r
-  FileNameSize     = AsciiStrSize (FileName);\r
-  DescriptionSize  = AsciiStrSize (Description);\r
+  ModuleNameSize  = 2 + AsciiStrSize (gEfiCallerBaseName);\r
+  FileNameSize    = AsciiStrSize (FileName);\r
+  DescriptionSize = AsciiStrSize (Description);\r
 \r
   //\r
   // Make sure it will all fit in the passed in buffer.\r
@@ -422,12 +432,13 @@ DebugAssert (
       }\r
     }\r
   }\r
+\r
   //\r
   // Fill in EFI_DEBUG_ASSERT_DATA\r
   //\r
-  AssertData = (EFI_DEBUG_ASSERT_DATA *)Buffer;\r
+  AssertData             = (EFI_DEBUG_ASSERT_DATA *)Buffer;\r
   AssertData->LineNumber = (UINT32)LineNumber;\r
-  TotalSize  = sizeof (EFI_DEBUG_ASSERT_DATA);\r
+  TotalSize              = sizeof (EFI_DEBUG_ASSERT_DATA);\r
 \r
   Temp = (CHAR8 *)(AssertData + 1);\r
 \r
@@ -435,24 +446,24 @@ DebugAssert (
   // Copy Ascii [ModuleName].\r
   //\r
   if (ModuleNameSize != 0) {\r
-    CopyMem(Temp, "[", 1);\r
-    CopyMem(Temp + 1, gEfiCallerBaseName, ModuleNameSize - 3);\r
-    CopyMem(Temp + ModuleNameSize - 2, "] ", 2);\r
+    CopyMem (Temp, "[", 1);\r
+    CopyMem (Temp + 1, gEfiCallerBaseName, ModuleNameSize - 3);\r
+    CopyMem (Temp + ModuleNameSize - 2, "] ", 2);\r
   }\r
 \r
   //\r
   // Copy Ascii FileName including NULL terminator.\r
   //\r
-  Temp = CopyMem (Temp + ModuleNameSize, FileName, FileNameSize);\r
+  Temp                   = CopyMem (Temp + ModuleNameSize, FileName, FileNameSize);\r
   Temp[FileNameSize - 1] = 0;\r
-  TotalSize += (ModuleNameSize + FileNameSize);\r
+  TotalSize             += (ModuleNameSize + FileNameSize);\r
 \r
   //\r
   // Copy Ascii Description include NULL terminator.\r
   //\r
-  Temp = CopyMem (Temp + FileNameSize, Description, DescriptionSize);\r
+  Temp                      = CopyMem (Temp + FileNameSize, Description, DescriptionSize);\r
   Temp[DescriptionSize - 1] = 0;\r
-  TotalSize += DescriptionSize;\r
+  TotalSize                += DescriptionSize;\r
 \r
   REPORT_STATUS_CODE_EX (\r
     (EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED),\r
@@ -474,7 +485,6 @@ DebugAssert (
   }\r
 }\r
 \r
-\r
 /**\r
   Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.\r
 \r
@@ -502,7 +512,6 @@ DebugClearMemory (
   return SetMem (Buffer, Length, PcdGet8 (PcdDebugClearMemoryValue));\r
 }\r
 \r
-\r
 /**\r
   Returns TRUE if ASSERT() macros are enabled.\r
 \r
@@ -519,10 +528,9 @@ DebugAssertEnabled (
   VOID\r
   )\r
 {\r
-  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);\r
+  return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);\r
 }\r
 \r
-\r
 /**\r
   Returns TRUE if DEBUG() macros are enabled.\r
 \r
@@ -539,10 +547,9 @@ DebugPrintEnabled (
   VOID\r
   )\r
 {\r
-  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);\r
+  return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);\r
 }\r
 \r
-\r
 /**\r
   Returns TRUE if DEBUG_CODE() macros are enabled.\r
 \r
@@ -559,10 +566,9 @@ DebugCodeEnabled (
   VOID\r
   )\r
 {\r
-  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
+  return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
 }\r
 \r
-\r
 /**\r
   Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.\r
 \r
@@ -579,7 +585,7 @@ DebugClearMemoryEnabled (
   VOID\r
   )\r
 {\r
-  return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);\r
+  return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);\r
 }\r
 \r
 /**\r
@@ -594,8 +600,8 @@ DebugClearMemoryEnabled (
 BOOLEAN\r
 EFIAPI\r
 DebugPrintLevelEnabled (\r
-  IN  CONST UINTN        ErrorLevel\r
+  IN  CONST UINTN  ErrorLevel\r
   )\r
 {\r
-  return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);\r
+  return (BOOLEAN)((ErrorLevel & PcdGet32 (PcdFixedDebugPrintErrorLevel)) != 0);\r
 }\r