MdeModulePkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
/** @file
|
||||
Instance of Print Library based on gEfiPrint2SProtocolGuid.
|
||||
|
||||
Implement the print library instance by wrap the interface
|
||||
Implement the print library instance by wrap the interface
|
||||
provided in the Print2S protocol. This protocol is defined as the internal
|
||||
protocol related to this implementation, not in the public spec. So, this
|
||||
protocol related to this implementation, not in the public spec. So, this
|
||||
library instance is only for this code base.
|
||||
|
||||
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2009 - 2018, Intel Corporation. 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
|
||||
@ -47,13 +47,13 @@ EFI_PRINT2S_PROTOCOL *mPrint2SProtocol = NULL;
|
||||
|
||||
/**
|
||||
The constructor function caches the pointer to Print2S protocol.
|
||||
|
||||
|
||||
The constructor function locates Print2S protocol from protocol database.
|
||||
It will ASSERT() if that operation fails and it will always return EFI_SUCCESS.
|
||||
It will ASSERT() if that operation fails and it will always return EFI_SUCCESS.
|
||||
|
||||
@param ImageHandle The firmware allocated handle for the EFI image.
|
||||
@param SystemTable A pointer to the EFI System Table.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
|
||||
|
||||
**/
|
||||
@ -79,7 +79,7 @@ PrintLibConstructor (
|
||||
|
||||
|
||||
/**
|
||||
Worker function that converts a VA_LIST to a BASE_LIST based on a Null-terminated
|
||||
Worker function that converts a VA_LIST to a BASE_LIST based on a Null-terminated
|
||||
format string.
|
||||
|
||||
@param AsciiFormat TRUE if Format is an ASCII string. FALSE if Format is a Unicode string.
|
||||
@ -151,11 +151,11 @@ DxePrintLibPrint2ProtocolVaListToBaseList (
|
||||
FormatCharacter = ((*Format & 0xff) | ((BytesPerFormatCharacter == 1) ? 0 : (*(Format + 1) << 8))) & FormatMask;
|
||||
|
||||
switch (FormatCharacter) {
|
||||
case '.':
|
||||
case '-':
|
||||
case '+':
|
||||
case ' ':
|
||||
case ',':
|
||||
case '.':
|
||||
case '-':
|
||||
case '+':
|
||||
case ' ':
|
||||
case ',':
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
@ -168,7 +168,7 @@ DxePrintLibPrint2ProtocolVaListToBaseList (
|
||||
case '9':
|
||||
break;
|
||||
case 'L':
|
||||
case 'l':
|
||||
case 'l':
|
||||
Long = TRUE;
|
||||
break;
|
||||
case '*':
|
||||
@ -177,7 +177,7 @@ DxePrintLibPrint2ProtocolVaListToBaseList (
|
||||
case '\0':
|
||||
//
|
||||
// Make no output if Format string terminates unexpectedly when
|
||||
// looking up for flag, width, precision and type.
|
||||
// looking up for flag, width, precision and type.
|
||||
//
|
||||
Format -= BytesPerFormatCharacter;
|
||||
//
|
||||
@ -187,8 +187,8 @@ DxePrintLibPrint2ProtocolVaListToBaseList (
|
||||
Done = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// Handle each argument type
|
||||
//
|
||||
@ -604,26 +604,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().
|
||||
@ -639,7 +639,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.
|
||||
|
||||
**/
|
||||
@ -1083,29 +1083,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().
|
||||
@ -1117,7 +1117,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.
|
||||
|
||||
**/
|
||||
@ -1256,8 +1256,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 mHexStr[] = {'0','1','2','3','4','5','
|
||||
**/
|
||||
CHAR8 *
|
||||
InternalPrintLibValueToString (
|
||||
IN OUT CHAR8 *Buffer,
|
||||
IN INT64 Value,
|
||||
IN OUT CHAR8 *Buffer,
|
||||
IN INT64 Value,
|
||||
IN UINTN Radix
|
||||
)
|
||||
{
|
||||
@ -1279,21 +1279,21 @@ InternalPrintLibValueToString (
|
||||
}
|
||||
|
||||
/**
|
||||
Worker function that produces a Null-terminated string in an output buffer
|
||||
Worker function that produces a Null-terminated string in an output buffer
|
||||
based on a Null-terminated format string and a VA_LIST argument list.
|
||||
|
||||
VSPrint function to process format and place the results in Buffer. Since a
|
||||
VA_LIST is used this routine allows the nesting of Vararg routines. Thus
|
||||
VSPrint function to process format and place the results in Buffer. Since a
|
||||
VA_LIST is used this routine allows the nesting of Vararg routines. Thus
|
||||
this is the main print working routine.
|
||||
|
||||
If COUNT_ONLY_NO_PRINT is set in Flags, Buffer will not be modified at all.
|
||||
|
||||
@param[out] Buffer The character buffer to print the results of the
|
||||
@param[out] Buffer The character buffer to print the results of the
|
||||
parsing of Format into.
|
||||
@param[in] BufferSize The maximum number of characters to put into
|
||||
@param[in] BufferSize The maximum number of characters to put into
|
||||
buffer.
|
||||
@param[in] Flags Initial flags value.
|
||||
Can only have FORMAT_UNICODE, OUTPUT_UNICODE,
|
||||
Can only have FORMAT_UNICODE, OUTPUT_UNICODE,
|
||||
and COUNT_ONLY_NO_PRINT set.
|
||||
@param[in] Format A Null-terminated format string.
|
||||
@param[in] VaListMarker VA_LIST style variable argument list consumed by
|
||||
@ -1317,11 +1317,11 @@ InternalPrintLibSPrintMarker (
|
||||
);
|
||||
|
||||
/**
|
||||
Worker function that produces a Null-terminated string in an output buffer
|
||||
Worker function that produces a Null-terminated string in an output buffer
|
||||
based on a Null-terminated format string and variable argument list.
|
||||
|
||||
VSPrint function to process format and place the results in Buffer. Since a
|
||||
VA_LIST is used this routine allows the nesting of Vararg routines. Thus
|
||||
VSPrint function to process format and place the results in Buffer. Since a
|
||||
VA_LIST is used this routine allows the nesting of Vararg routines. Thus
|
||||
this is the main print working routine
|
||||
|
||||
@param StartOfBuffer The character buffer to print the results of the parsing
|
||||
@ -1407,7 +1407,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 * CONST mStatusString[] = {
|
||||
|
||||
@param Buffer The buffer to place the Unicode or ASCII string.
|
||||
@param EndBuffer The end of the input Buffer. No characters will be
|
||||
placed after that.
|
||||
placed after that.
|
||||
@param Length The count of character to be placed into Buffer.
|
||||
(Negative value indicates no buffer fill.)
|
||||
@param Character The character to be placed into Buffer.
|
||||
@ -1426,7 +1426,7 @@ InternalPrintLibFillBuffer (
|
||||
)
|
||||
{
|
||||
INTN Index;
|
||||
|
||||
|
||||
for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) {
|
||||
*Buffer = (CHAR8) Character;
|
||||
if (Increment != 1) {
|
||||
@ -1439,21 +1439,21 @@ InternalPrintLibFillBuffer (
|
||||
}
|
||||
|
||||
/**
|
||||
Worker function that produces a Null-terminated string in an output buffer
|
||||
Worker function that produces a Null-terminated string in an output buffer
|
||||
based on a Null-terminated format string and a VA_LIST argument list.
|
||||
|
||||
VSPrint function to process format and place the results in Buffer. Since a
|
||||
VA_LIST is used this routine allows the nesting of Vararg routines. Thus
|
||||
VSPrint function to process format and place the results in Buffer. Since a
|
||||
VA_LIST is used this routine allows the nesting of Vararg routines. Thus
|
||||
this is the main print working routine.
|
||||
|
||||
If COUNT_ONLY_NO_PRINT is set in Flags, Buffer will not be modified at all.
|
||||
|
||||
@param[out] Buffer The character buffer to print the results of the
|
||||
@param[out] Buffer The character buffer to print the results of the
|
||||
parsing of Format into.
|
||||
@param[in] BufferSize The maximum number of characters to put into
|
||||
@param[in] BufferSize The maximum number of characters to put into
|
||||
buffer.
|
||||
@param[in] Flags Initial flags value.
|
||||
Can only have FORMAT_UNICODE, OUTPUT_UNICODE,
|
||||
Can only have FORMAT_UNICODE, OUTPUT_UNICODE,
|
||||
and COUNT_ONLY_NO_PRINT set.
|
||||
@param[in] Format A Null-terminated format string.
|
||||
@param[in] VaListMarker VA_LIST style variable argument list consumed by
|
||||
@ -1509,7 +1509,7 @@ InternalPrintLibSPrintMarker (
|
||||
|
||||
//
|
||||
// If you change this code be sure to match the 2 versions of this function.
|
||||
// Nearly identical logic is found in the BasePrintLib and
|
||||
// Nearly identical logic is found in the BasePrintLib and
|
||||
// DxePrintLibPrint2Protocol (both PrintLib instances).
|
||||
//
|
||||
|
||||
@ -1630,24 +1630,24 @@ InternalPrintLibSPrintMarker (
|
||||
Format += BytesPerFormatCharacter;
|
||||
FormatCharacter = ((*Format & 0xff) | ((BytesPerFormatCharacter == 1) ? 0 : (*(Format + 1) << 8))) & FormatMask;
|
||||
switch (FormatCharacter) {
|
||||
case '.':
|
||||
Flags |= PRECISION;
|
||||
case '.':
|
||||
Flags |= PRECISION;
|
||||
break;
|
||||
case '-':
|
||||
Flags |= LEFT_JUSTIFY;
|
||||
case '-':
|
||||
Flags |= LEFT_JUSTIFY;
|
||||
break;
|
||||
case '+':
|
||||
Flags |= PREFIX_SIGN;
|
||||
case '+':
|
||||
Flags |= PREFIX_SIGN;
|
||||
break;
|
||||
case ' ':
|
||||
Flags |= PREFIX_BLANK;
|
||||
case ' ':
|
||||
Flags |= PREFIX_BLANK;
|
||||
break;
|
||||
case ',':
|
||||
Flags |= COMMA_TYPE;
|
||||
case ',':
|
||||
Flags |= COMMA_TYPE;
|
||||
break;
|
||||
case 'L':
|
||||
case 'l':
|
||||
Flags |= LONG_TYPE;
|
||||
case 'l':
|
||||
Flags |= LONG_TYPE;
|
||||
break;
|
||||
case '*':
|
||||
if ((Flags & PRECISION) == 0) {
|
||||
@ -1691,11 +1691,11 @@ InternalPrintLibSPrintMarker (
|
||||
Precision = Count;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case '\0':
|
||||
//
|
||||
// Make no output if Format string terminates unexpectedly when
|
||||
// looking up for flag, width, precision and type.
|
||||
// looking up for flag, width, precision and type.
|
||||
//
|
||||
Format -= BytesPerFormatCharacter;
|
||||
Precision = 0;
|
||||
@ -1706,7 +1706,7 @@ InternalPrintLibSPrintMarker (
|
||||
Done = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Handle each argument type
|
||||
@ -1746,9 +1746,9 @@ InternalPrintLibSPrintMarker (
|
||||
//
|
||||
// 'd', 'u', 'x', and 'X' that are not preceded by 'l' or 'L' are assumed to be type "int".
|
||||
// This assumption is made so the format string definition is compatible with the ANSI C
|
||||
// Specification for formatted strings. It is recommended that the Base Types be used
|
||||
// everywhere, but in this one case, compliance with ANSI C is more important, and
|
||||
// provides an implementation that is compatible with that largest possible set of CPU
|
||||
// Specification for formatted strings. It is recommended that the Base Types be used
|
||||
// everywhere, but in this one case, compliance with ANSI C is more important, and
|
||||
// provides an implementation that is compatible with that largest possible set of CPU
|
||||
// architectures. This is why the type "int" is used in this one case.
|
||||
//
|
||||
if (BaseListMarker == NULL) {
|
||||
@ -1786,9 +1786,9 @@ InternalPrintLibSPrintMarker (
|
||||
//
|
||||
// 'd', 'u', 'x', and 'X' that are not preceded by 'l' or 'L' are assumed to be type "int".
|
||||
// This assumption is made so the format string definition is compatible with the ANSI C
|
||||
// Specification for formatted strings. It is recommended that the Base Types be used
|
||||
// everywhere, but in this one case, compliance with ANSI C is more important, and
|
||||
// provides an implementation that is compatible with that largest possible set of CPU
|
||||
// Specification for formatted strings. It is recommended that the Base Types be used
|
||||
// everywhere, but in this one case, compliance with ANSI C is more important, and
|
||||
// provides an implementation that is compatible with that largest possible set of CPU
|
||||
// architectures. This is why the type "unsigned int" is used in this one case.
|
||||
//
|
||||
Value = (unsigned int)Value;
|
||||
@ -1800,9 +1800,9 @@ InternalPrintLibSPrintMarker (
|
||||
//
|
||||
// 'd', 'u', 'x', and 'X' that are not preceded by 'l' or 'L' are assumed to be type "int".
|
||||
// This assumption is made so the format string definition is compatible with the ANSI C
|
||||
// Specification for formatted strings. It is recommended that the Base Types be used
|
||||
// everywhere, but in this one case, compliance with ANSI C is more important, and
|
||||
// provides an implementation that is compatible with that largest possible set of CPU
|
||||
// Specification for formatted strings. It is recommended that the Base Types be used
|
||||
// everywhere, but in this one case, compliance with ANSI C is more important, and
|
||||
// provides an implementation that is compatible with that largest possible set of CPU
|
||||
// architectures. This is why the type "unsigned int" is used in this one case.
|
||||
//
|
||||
Value = (unsigned int)Value;
|
||||
@ -1816,7 +1816,7 @@ InternalPrintLibSPrintMarker (
|
||||
Count = 0;
|
||||
}
|
||||
ArgumentString = (CHAR8 *)ValueBuffer + Count;
|
||||
|
||||
|
||||
Digits = Count % 3;
|
||||
if (Digits != 0) {
|
||||
Digits = 3 - Digits;
|
||||
@ -1889,7 +1889,7 @@ InternalPrintLibSPrintMarker (
|
||||
GuidData3 = ReadUnaligned16 (&(TmpGuid->Data3));
|
||||
InternalPrintLibSPrint (
|
||||
ValueBuffer,
|
||||
MAXIMUM_VALUE_CHARACTERS,
|
||||
MAXIMUM_VALUE_CHARACTERS,
|
||||
0,
|
||||
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
|
||||
GuidData1,
|
||||
@ -1910,9 +1910,9 @@ InternalPrintLibSPrintMarker (
|
||||
|
||||
case 't':
|
||||
if (BaseListMarker == NULL) {
|
||||
TmpTime = VA_ARG (VaListMarker, TIME *);
|
||||
TmpTime = VA_ARG (VaListMarker, TIME *);
|
||||
} else {
|
||||
TmpTime = BASE_ARG (BaseListMarker, TIME *);
|
||||
TmpTime = BASE_ARG (BaseListMarker, TIME *);
|
||||
}
|
||||
if (TmpTime == NULL) {
|
||||
ArgumentString = "<null time>";
|
||||
@ -1997,7 +1997,7 @@ InternalPrintLibSPrintMarker (
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case '\r':
|
||||
Format += BytesPerFormatCharacter;
|
||||
FormatCharacter = ((*Format & 0xff) | ((BytesPerFormatCharacter == 1) ? 0 : (*(Format + 1) << 8))) & FormatMask;
|
||||
@ -2173,7 +2173,7 @@ InternalPrintLibSPrintMarker (
|
||||
}
|
||||
|
||||
/**
|
||||
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().
|
||||
@ -2186,7 +2186,7 @@ InternalPrintLibSPrintMarker (
|
||||
@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
|
||||
@ -2201,7 +2201,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.
|
||||
@ -2212,7 +2212,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
|
||||
|
Reference in New Issue
Block a user