]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BasePrintLib/PrintLib.c
Update function description to be consistent with code definition: HEX_RADIX => RADIX...
[mirror_edk2.git] / MdePkg / Library / BasePrintLib / PrintLib.c
index 2066c7a1ddd186731d97e4ea5da344449a8c96ae..1faf51a560b11a784d1b71ebf33b83bb3991bb9d 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
   Base Print Library instance implementation.\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
+  Copyright (c) 2006 - 2009, Intel Corporation<BR>\r
+  Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.<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
 \r
 #include "PrintLibInternal.h"\r
 \r
+//\r
+// Declare a VA_LIST global variable that is used in calls to BasePrintLibSPrintMarker()\r
+// when the BASE_LIST parameter is valid and the VA_LIST parameter is ignored.  \r
+// A NULL VA_LIST can not be passed into  BasePrintLibSPrintMarker() because some \r
+// compilers define VA_LIST to be a structure.\r
+//\r
+VA_LIST gNullVaList;\r
+\r
 #define ASSERT_UNICODE_BUFFER(Buffer) ASSERT ((((UINTN) (Buffer)) & 0x01) == 0)\r
 \r
 /**\r
@@ -109,7 +118,7 @@ UnicodeBSPrint (
 {\r
   ASSERT_UNICODE_BUFFER (StartOfBuffer);\r
   ASSERT_UNICODE_BUFFER (FormatString);\r
-  return BasePrintLibSPrintMarker ((CHAR8 *)StartOfBuffer, BufferSize >> 1, FORMAT_UNICODE | OUTPUT_UNICODE, (CHAR8 *)FormatString, NULL, Marker);\r
+  return BasePrintLibSPrintMarker ((CHAR8 *)StartOfBuffer, BufferSize >> 1, FORMAT_UNICODE | OUTPUT_UNICODE, (CHAR8 *)FormatString, gNullVaList, Marker);\r
 }\r
 \r
 /**\r
@@ -250,7 +259,7 @@ UnicodeBSPrintAsciiFormat (
   )\r
 {\r
   ASSERT_UNICODE_BUFFER (StartOfBuffer);\r
-  return BasePrintLibSPrintMarker ((CHAR8 *)StartOfBuffer, BufferSize >> 1, OUTPUT_UNICODE, FormatString, NULL, Marker);\r
+  return BasePrintLibSPrintMarker ((CHAR8 *)StartOfBuffer, BufferSize >> 1, OUTPUT_UNICODE, FormatString, gNullVaList, Marker);\r
 }\r
 \r
 /**\r
@@ -319,18 +328,18 @@ UnicodeSPrintAsciiFormat (
   If Width is 0, PREFIX_ZERO is ignored in Flags.\r
   If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas\r
   are inserted every 3rd digit starting from the right.\r
-  If HEX_RADIX is set in Flags, then the output buffer will be \r
+  If RADIX_HEX is set in Flags, then the output buffer will be \r
   formatted in hexadecimal format.\r
-  If Value is < 0 and HEX_RADIX is not set in Flags, then the fist character in Buffer is a '-'.\r
+  If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.\r
   If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, \r
   then Buffer is padded with '0' characters so the combination of the optional '-' \r
   sign character, '0' characters, digit characters for Value, and the Null-terminator\r
   add up to Width characters.\r
-  If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().\r
+  If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().\r
   If Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
   If unsupported bits are set in Flags, then ASSERT().\r
-  If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().\r
+  If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().\r
   If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()\r
 \r
   @param  Buffer  Pointer to the output buffer for the produced Null-terminated\r
@@ -441,7 +450,7 @@ AsciiBSPrint (
   IN  BASE_LIST     Marker\r
   )\r
 {\r
-  return BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, 0, FormatString, NULL, Marker);\r
+  return BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, 0, FormatString, gNullVaList, Marker);\r
 }\r
 \r
 /**\r
@@ -581,7 +590,7 @@ AsciiBSPrintUnicodeFormat (
   )\r
 {\r
   ASSERT_UNICODE_BUFFER (FormatString);\r
-  return BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, FORMAT_UNICODE, (CHAR8 *)FormatString, NULL, Marker);\r
+  return BasePrintLibSPrintMarker (StartOfBuffer, BufferSize, FORMAT_UNICODE, (CHAR8 *)FormatString, gNullVaList, Marker);\r
 }\r
 \r
 /**\r
@@ -651,9 +660,9 @@ AsciiSPrintUnicodeFormat (
   If Width is 0, PREFIX_ZERO is ignored in Flags.\r
   If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas\r
   are inserted every 3rd digit starting from the right.\r
-  If HEX_RADIX is set in Flags, then the output buffer will be \r
+  If RADIX_HEX is set in Flags, then the output buffer will be \r
   formatted in hexadecimal format.\r
-  If Value is < 0 and HEX_RADIX is not set in Flags, then the fist character in Buffer is a '-'.\r
+  If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.\r
   If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, \r
   then Buffer is padded with '0' characters so the combination of the optional '-' \r
   sign character, '0' characters, digit characters for Value, and the Null-terminator\r
@@ -661,7 +670,7 @@ AsciiSPrintUnicodeFormat (
   \r
   If Buffer is NULL, then ASSERT().\r
   If unsupported bits are set in Flags, then ASSERT().\r
-  If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().\r
+  If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().\r
   If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()\r
 \r
   @param  Buffer  Pointer to the output buffer for the produced Null-terminated\r