aboutsummaryrefslogtreecommitdiff
path: root/MdePkg/Library/BasePrintLib/PrintLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BasePrintLib/PrintLib.c')
-rw-r--r--MdePkg/Library/BasePrintLib/PrintLib.c63
1 files changed, 28 insertions, 35 deletions
diff --git a/MdePkg/Library/BasePrintLib/PrintLib.c b/MdePkg/Library/BasePrintLib/PrintLib.c
index 35970c05f0cc..267d74404d77 100644
--- a/MdePkg/Library/BasePrintLib/PrintLib.c
+++ b/MdePkg/Library/BasePrintLib/PrintLib.c
@@ -1,15 +1,9 @@
/** @file
Base Print Library instance implementation.
- Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -17,8 +11,8 @@
//
// Declare a VA_LIST global variable that is used in calls to BasePrintLibSPrintMarker()
-// when the BASE_LIST parameter is valid and the VA_LIST parameter is ignored.
-// A NULL VA_LIST can not be passed into BasePrintLibSPrintMarker() because some
+// when the BASE_LIST parameter is valid and the VA_LIST parameter is ignored.
+// A NULL VA_LIST can not be passed into BasePrintLibSPrintMarker() because some
// compilers define VA_LIST to be a structure.
//
VA_LIST gNullVaList;
@@ -355,26 +349,26 @@ UnicodeSPrintAsciiFormat (
[ATTENTION] This function is deprecated for security reason.
Converts a decimal value to a Null-terminated Unicode string.
-
- Converts the decimal number specified by Value to a Null-terminated Unicode
- string specified by Buffer containing at most Width characters. No padding of spaces
+
+ Converts the decimal number specified by Value to a Null-terminated Unicode
+ string specified by Buffer containing at most Width characters. No padding of spaces
is ever performed. If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
The number of Unicode characters in Buffer is returned not including the Null-terminator.
If the conversion contains more than Width characters, then only the first
- Width characters are returned, and the total number of characters
+ Width characters are returned, and the total number of characters
required to perform the conversion is returned.
- Additional conversion parameters are specified in Flags.
-
+ Additional conversion parameters are specified in Flags.
+
The Flags bit LEFT_JUSTIFY is always ignored.
All conversions are left justified in Buffer.
If Width is 0, PREFIX_ZERO is ignored in Flags.
If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
are inserted every 3rd digit starting from the right.
- If RADIX_HEX is set in Flags, then the output buffer will be
+ If RADIX_HEX is set in Flags, then the output buffer will be
formatted in hexadecimal format.
If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.
- If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
- then Buffer is padded with '0' characters so the combination of the optional '-'
+ If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
+ then Buffer is padded with '0' characters so the combination of the optional '-'
sign character, '0' characters, digit characters for Value, and the Null-terminator
add up to Width characters.
If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
@@ -390,7 +384,7 @@ UnicodeSPrintAsciiFormat (
@param Value The 64-bit signed value to convert to a string.
@param Width The maximum number of Unicode characters to place in Buffer, not including
the Null-terminator.
-
+
@return The number of Unicode characters in Buffer not including the Null-terminator.
**/
@@ -793,29 +787,29 @@ AsciiSPrintUnicodeFormat (
[ATTENTION] This function is deprecated for security reason.
Converts a decimal value to a Null-terminated ASCII string.
-
- Converts the decimal number specified by Value to a Null-terminated ASCII string
- specified by Buffer containing at most Width characters. No padding of spaces
+
+ Converts the decimal number specified by Value to a Null-terminated ASCII string
+ specified by Buffer containing at most Width characters. No padding of spaces
is ever performed.
If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
The number of ASCII characters in Buffer is returned not including the Null-terminator.
If the conversion contains more than Width characters, then only the first Width
characters are returned, and the total number of characters required to perform
the conversion is returned.
- Additional conversion parameters are specified in Flags.
+ Additional conversion parameters are specified in Flags.
The Flags bit LEFT_JUSTIFY is always ignored.
All conversions are left justified in Buffer.
If Width is 0, PREFIX_ZERO is ignored in Flags.
If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
are inserted every 3rd digit starting from the right.
- If RADIX_HEX is set in Flags, then the output buffer will be
+ If RADIX_HEX is set in Flags, then the output buffer will be
formatted in hexadecimal format.
If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.
- If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
- then Buffer is padded with '0' characters so the combination of the optional '-'
+ If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
+ then Buffer is padded with '0' characters so the combination of the optional '-'
sign character, '0' characters, digit characters for Value, and the Null-terminator
add up to Width characters.
-
+
If Buffer is NULL, then ASSERT().
If unsupported bits are set in Flags, then ASSERT().
If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
@@ -827,7 +821,7 @@ AsciiSPrintUnicodeFormat (
@param Value The 64-bit signed value to convert to a string.
@param Width The maximum number of ASCII characters to place in Buffer, not including
the Null-terminator.
-
+
@return The number of ASCII characters in Buffer not including the Null-terminator.
**/
@@ -869,8 +863,7 @@ AsciiValueToString (
sign character, '0' characters, digit characters for Value, and the
Null-terminator add up to Width characters.
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If an error would be returned, then the function will also ASSERT().
+ If an error would be returned, then the function will ASSERT().
@param Buffer The pointer to the output buffer for the produced
Null-terminated Ascii string.
@@ -909,7 +902,7 @@ AsciiValueToStringS (
}
/**
- Returns the number of characters that would be produced by if the formatted
+ Returns the number of characters that would be produced by if the formatted
output were produced not including the Null-terminator.
If FormatString is not aligned on a 16-bit boundary, then ASSERT().
@@ -922,7 +915,7 @@ AsciiValueToStringS (
@param[in] FormatString A Null-terminated Unicode format string.
@param[in] Marker VA_LIST marker for the variable argument list.
- @return The number of characters that would be produced, not including the
+ @return The number of characters that would be produced, not including the
Null-terminator.
**/
UINTN
@@ -937,7 +930,7 @@ SPrintLength (
}
/**
- Returns the number of characters that would be produced by if the formatted
+ Returns the number of characters that would be produced by if the formatted
output were produced not including the Null-terminator.
If FormatString is NULL, then ASSERT() and 0 is returned.
@@ -948,7 +941,7 @@ SPrintLength (
@param[in] FormatString A Null-terminated ASCII format string.
@param[in] Marker VA_LIST marker for the variable argument list.
- @return The number of characters that would be produced, not including the
+ @return The number of characters that would be produced, not including the
Null-terminator.
**/
UINTN