Update coding style of Nt32OemHookStatusCodeLib.c
[mirror_edk2.git] / EdkNt32Pkg / Library / Nt32OemHookStatusCodeLib / Nt32OemHookStatusCodeLib.c
index 7596a723df5fc077ad4d8807ed72b8ea4fe98392..a17b466294a6095b7ceed75a9852eb67a2fcfd92 100644 (file)
 \r
 //\r
 // Cache of WinNtThunk protocol \r
 \r
 //\r
 // Cache of WinNtThunk protocol \r
-// \r
+//\r
+STATIC\r
 EFI_WIN_NT_THUNK_PROTOCOL   *mWinNt;\r
 \r
 //\r
 // Cache of standard output handle . \r
 EFI_WIN_NT_THUNK_PROTOCOL   *mWinNt;\r
 \r
 //\r
 // Cache of standard output handle . \r
-// \r
+//\r
+STATIC\r
 HANDLE                      mStdOut;\r
 \r
 /**\r
 HANDLE                      mStdOut;\r
 \r
 /**\r
@@ -33,7 +35,7 @@ HANDLE                      mStdOut;
   @return    Always return EFI_SUCCESS.\r
 \r
 **/\r
   @return    Always return EFI_SUCCESS.\r
 \r
 **/\r
-EFI_SUCCESS\r
+EFI_STATUS\r
 EFIAPI\r
 OemHookStatusCodeInitialize (\r
   VOID\r
 EFIAPI\r
 OemHookStatusCodeInitialize (\r
   VOID\r
@@ -47,11 +49,11 @@ OemHookStatusCodeInitialize (
     // Locate NtThunkPpi for retrieving standard output handle\r
     //\r
     Status = PeiServicesLocatePpi (\r
     // Locate NtThunkPpi for retrieving standard output handle\r
     //\r
     Status = PeiServicesLocatePpi (\r
-              &gPeiNtThunkPpiGuid,\r
-              0,\r
-              NULL,\r
-              (VOID **) &NtThunkPpi\r
-              );\r
+               &gPeiNtThunkPpiGuid,\r
+               0,\r
+               NULL,\r
+               (VOID **) &NtThunkPpi\r
+               );\r
 \r
     ASSERT_EFI_ERROR (Status);\r
 \r
 \r
     ASSERT_EFI_ERROR (Status);\r
 \r
@@ -181,7 +183,14 @@ OemHookStatusCodeReport (
     //\r
     // Print ERROR information into output buffer.\r
     //\r
     //\r
     // Print ERROR information into output buffer.\r
     //\r
-    CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "ERROR: C%x:V%x I%x", CodeType, Value, Instance);\r
+    CharCount = AsciiSPrint (\r
+                  Buffer, \r
+                  EFI_STATUS_CODE_DATA_MAX_SIZE, \r
+                  "ERROR: C%x:V%x I%x", \r
+                  CodeType, \r
+                  Value, \r
+                  Instance\r
+                  );\r
 \r
     //\r
     // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.\r
 \r
     //\r
     // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.\r
@@ -196,7 +205,7 @@ OemHookStatusCodeReport (
                      );\r
     }\r
 \r
                      );\r
     }\r
 \r
-    if (Data) {\r
+    if (Data != NULL) {\r
       CharCount += AsciiSPrint (\r
                      &Buffer[CharCount - 1],\r
                      (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),\r
       CharCount += AsciiSPrint (\r
                      &Buffer[CharCount - 1],\r
                      (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),\r
@@ -211,9 +220,22 @@ OemHookStatusCodeReport (
                    "\n\r"\r
                    );\r
   } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {\r
                    "\n\r"\r
                    );\r
   } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {\r
-    CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "PROGRESS CODE: V%x I%x\n\r", Value, Instance);\r
+    CharCount = AsciiSPrint (\r
+                  Buffer, \r
+                  EFI_STATUS_CODE_DATA_MAX_SIZE, \r
+                  "PROGRESS CODE: V%x I%x\n\r", \r
+                  Value, \r
+                  Instance\r
+                  );\r
   } else {\r
   } else {\r
-    CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "Undefined: C%x:V%x I%x\n\r", CodeType, Value, Instance);\r
+    CharCount = AsciiSPrint (\r
+                  Buffer, \r
+                  EFI_STATUS_CODE_DATA_MAX_SIZE, \r
+                  "Undefined: C%x:V%x I%x\n\r", \r
+                  CodeType, \r
+                  Value, \r
+                  Instance\r
+                  );\r
   }\r
 \r
   //\r
   }\r
 \r
   //\r