]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
1) Initialize gBS, gST, gImageHandle in UefiBootServicesTableLib.c to NULL
[mirror_edk2.git] / MdePkg / Library / UefiDebugLibStdErr / DebugLib.c
index 18f651c194520e2bc3b3eb54c69b4da4b744bb90..d2fb46e23f340f2aec64b6dce50101c391f138f0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   UEFI Debug Library that uses PrintLib to send messages to STDERR.\r
 \r
-  Copyright (c) 2006, Intel Corporation<BR>\r
+  Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
   All rights reserved. This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -65,7 +65,7 @@ DebugPrint (
   //\r
   // Send the print string to the Standard Error device\r
   //\r
-  if (gST->StdErr != NULL) {\r
+  if ((gST != NULL) && (gST->StdErr != NULL)) {\r
     gST->StdErr->OutputString (gST->StdErr, Buffer);\r
   }\r
 }\r
@@ -76,7 +76,7 @@ DebugPrint (
   Prints an assert message containing a filename, line number, and description.  \r
   This may be followed by a breakpoint or a dead loop.\r
 \r
-  Print a message of the form \93ASSERT <FileName>(<LineNumber>): <Description>\n\94 \r
+  Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n" \r
   to the debug output device.  If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of \r
   PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if \r
   DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then \r
@@ -85,9 +85,9 @@ DebugPrint (
   DebugAssert() must actively prevent recusrsion.  If DebugAssert() is called while\r
   processing another DebugAssert(), then DebugAssert() must return immediately.\r
 \r
-  If FileName is NULL, then a <FileName> string of \93(NULL) Filename\94 is printed.\r
+  If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.\r
 \r
-  If Description is NULL, then a <Description> string of \93(NULL) Description\94 is printed.\r
+  If Description is NULL, then a <Description> string of "(NULL) Description" is printed.\r
 \r
   @param  FileName     Pointer to the name of the source file that generated the assert condition.\r
   @param  LineNumber   The line number in the source file that generated the assert condition\r
@@ -98,7 +98,7 @@ VOID
 EFIAPI\r
 DebugAssert (\r
   IN CONST CHAR8  *FileName,\r
-  IN INTN         LineNumber,\r
+  IN UINTN        LineNumber,\r
   IN CONST CHAR8  *Description\r
   )\r
 {\r
@@ -112,7 +112,7 @@ DebugAssert (
   //\r
   // Send the print string to the Standard Error device\r
   //\r
-  if (gST->StdErr != NULL) {\r
+  if ((gST != NULL) && (gST->StdErr != NULL)) {\r
     gST->StdErr->OutputString (gST->StdErr, Buffer);\r
   }\r
 \r
@@ -136,7 +136,7 @@ DebugAssert (
 \r
   If Buffer is NULL, then ASSERT().\r
 \r
-  If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
+  If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
 \r
   @param   Buffer  Pointer to the target buffer to fill with PcdDebugClearMemoryValue.\r
   @param   Length  Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. \r
@@ -180,7 +180,7 @@ DebugAssertEnabled (
   VOID\r
   )\r
 {\r
-  return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);\r
+  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);\r
 }\r
 \r
 \r
@@ -201,7 +201,7 @@ DebugPrintEnabled (
   VOID\r
   )\r
 {\r
-  return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);\r
+  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);\r
 }\r
 \r
 \r
@@ -222,7 +222,7 @@ DebugCodeEnabled (
   VOID\r
   )\r
 {\r
-  return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
+  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
 }\r
 \r
 \r
@@ -243,5 +243,5 @@ DebugClearMemoryEnabled (
   VOID\r
   )\r
 {\r
-  return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);\r
+  return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);\r
 }\r