]> 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 041fbc72f0f661c76c0b17f21e7b4b166982326b..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
@@ -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
@@ -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