protocol related to this implementation, not in the public spec. So, this \r
library instance is only for this code base.\r
\r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
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
#include <Library/PrintLib.h>\r
\r
#include <Library/BaseLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/DebugLib.h>\r
\r
EFI_PRINT2_PROTOCOL *mPrint2Protocol = NULL;\r
{\r
EFI_STATUS Status;\r
\r
- Status = gBS->LocateProtocol (\r
- &gEfiPrint2ProtocolGuid,\r
- NULL,\r
- (VOID**) &mPrint2Protocol\r
- );\r
+ Status = SystemTable->BootServices->LocateProtocol (\r
+ &gEfiPrint2ProtocolGuid,\r
+ NULL,\r
+ (VOID**) &mPrint2Protocol\r
+ );\r
ASSERT_EFI_ERROR (Status);\r
ASSERT (mPrint2Protocol != NULL);\r
\r
)\r
{\r
VA_LIST Marker;\r
+ UINTN NumberOfPrinted;\r
\r
VA_START (Marker, FormatString);\r
- return UnicodeVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);\r
+ NumberOfPrinted = UnicodeVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);\r
+ VA_END (Marker);\r
+ return NumberOfPrinted;\r
}\r
\r
/**\r
)\r
{\r
VA_LIST Marker;\r
+ UINTN NumberOfPrinted;\r
\r
VA_START (Marker, FormatString);\r
- return UnicodeVSPrintAsciiFormat (StartOfBuffer, BufferSize, FormatString, Marker);\r
+ NumberOfPrinted = UnicodeVSPrintAsciiFormat (StartOfBuffer, BufferSize, FormatString, Marker);\r
+ VA_END (Marker);\r
+ return NumberOfPrinted;\r
}\r
\r
/**\r
)\r
{\r
VA_LIST Marker;\r
+ UINTN NumberOfPrinted;\r
\r
VA_START (Marker, FormatString);\r
- return AsciiVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);\r
+ NumberOfPrinted = AsciiVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);\r
+ VA_END (Marker);\r
+ return NumberOfPrinted;\r
}\r
\r
/**\r
)\r
{\r
VA_LIST Marker;\r
+ UINTN NumberOfPrinted;\r
\r
VA_START (Marker, FormatString);\r
- return AsciiVSPrintUnicodeFormat (StartOfBuffer, BufferSize, FormatString, Marker);\r
+ NumberOfPrinted = AsciiVSPrintUnicodeFormat (StartOfBuffer, BufferSize, FormatString, Marker);\r
+ VA_END (Marker);\r
+ return NumberOfPrinted;\r
}\r
\r
\r
)\r
{\r
VA_LIST Marker;\r
+ UINTN NumberOfPrinted;\r
\r
VA_START (Marker, FormatString);\r
- return InternalPrintLibSPrintMarker (StartOfBuffer, BufferSize, Flags, FormatString, Marker, NULL);\r
+ NumberOfPrinted = InternalPrintLibSPrintMarker (StartOfBuffer, BufferSize, Flags, FormatString, Marker, NULL);\r
+ VA_END (Marker);\r
+ return NumberOfPrinted;\r
}\r
\r
#define WARNING_STATUS_NUMBER 4\r
IN BASE_LIST BaseListMarker OPTIONAL\r
)\r
{\r
- CHAR8 *OriginalBuffer;\r
CHAR8 *EndBuffer;\r
CHAR8 ValueBuffer[MAXIMUM_VALUE_CHARACTERS];\r
UINT32 BytesPerOutputCharacter;\r
UINT32 GuidData1;\r
UINT16 GuidData2;\r
UINT16 GuidData3;\r
- UINT32 LengthToReturn;\r
+ UINTN LengthToReturn;\r
\r
//\r
// If you change this code be sure to match the 2 versions of this function.\r
\r
ASSERT(Flags & COUNT_ONLY_NO_PRINT);\r
\r
- if (Flags & OUTPUT_UNICODE) {\r
+ if ((Flags & OUTPUT_UNICODE) != 0) {\r
BytesPerOutputCharacter = 2;\r
} else {\r
BytesPerOutputCharacter = 1;\r
// Reserve space for the Null terminator.\r
//\r
BufferSize--;\r
- OriginalBuffer = Buffer;\r
\r
//\r
// Set the tag for the end of the input Buffer.\r
//\r
// Clear all the flag bits except those that may have been passed in\r
//\r
- Flags &= (OUTPUT_UNICODE | FORMAT_UNICODE | COUNT_ONLY_NO_PRINT);\r
+ Flags &= (UINTN)(OUTPUT_UNICODE | FORMAT_UNICODE | COUNT_ONLY_NO_PRINT);\r
\r
//\r
// Set the default width to zero, and the default precision to 1\r
//\r
// Flag space, +, 0, L & l are invalid for type p.\r
//\r
- Flags &= ~(PREFIX_BLANK | PREFIX_SIGN | PREFIX_ZERO | LONG_TYPE);\r
+ Flags &= ~(UINTN)(PREFIX_BLANK | PREFIX_SIGN | PREFIX_ZERO | LONG_TYPE);\r
if (sizeof (VOID *) > 4) {\r
Flags |= LONG_TYPE;\r
}\r
if ((Flags & RADIX_HEX) == 0) {\r
Radix = 10;\r
if (Comma) {\r
- Flags &= (~PREFIX_ZERO);\r
+ Flags &= (~(UINTN)PREFIX_ZERO);\r
Precision = 1;\r
}\r
if (Value < 0) {\r
ArgumentString = BASE_ARG (BaseListMarker, CHAR8 *);\r
}\r
if (ArgumentString == NULL) {\r
- Flags &= (~ARGUMENT_UNICODE);\r
+ Flags &= (~(UINTN)ARGUMENT_UNICODE);\r
ArgumentString = "<null string>";\r
}\r
//\r
// Pad before the string\r
//\r
if ((Flags & (PAD_TO_WIDTH | LEFT_JUSTIFY)) == (PAD_TO_WIDTH)) {\r
- if (Flags & COUNT_ONLY_NO_PRINT) {\r
- LengthToReturn += ((Width - Precision) * BytesPerOutputCharacter);\r
- } else {\r
-// Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Precision, ' ', BytesPerOutputCharacter);\r
- }\r
+ LengthToReturn += ((Width - Precision) * BytesPerOutputCharacter);\r
}\r
\r
if (ZeroPad) {\r
if (Prefix != 0) {\r
- if (Flags & COUNT_ONLY_NO_PRINT) {\r
- LengthToReturn += (1 * BytesPerOutputCharacter);\r
- } else {\r
-// Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, Prefix, BytesPerOutputCharacter);\r
- }\r
- }\r
- if (Flags & COUNT_ONLY_NO_PRINT) {\r
- LengthToReturn += ((Precision - Count) * BytesPerOutputCharacter);\r
- } else {\r
-// Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Precision - Count, '0', BytesPerOutputCharacter);\r
+ LengthToReturn += (1 * BytesPerOutputCharacter);\r
}\r
+ LengthToReturn += ((Precision - Count) * BytesPerOutputCharacter);\r
} else {\r
- if (Flags & COUNT_ONLY_NO_PRINT) {\r
- LengthToReturn += ((Precision - Count) * BytesPerOutputCharacter);\r
- } else {\r
-// Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Precision - Count, ' ', BytesPerOutputCharacter);\r
- }\r
+ LengthToReturn += ((Precision - Count) * BytesPerOutputCharacter);\r
if (Prefix != 0) {\r
- if (Flags & COUNT_ONLY_NO_PRINT) {\r
- LengthToReturn += (1 * BytesPerOutputCharacter);\r
- } else {\r
-// Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, Prefix, BytesPerOutputCharacter);\r
- }\r
+ LengthToReturn += (1 * BytesPerOutputCharacter);\r
}\r
}\r
\r
while (Index < Count) {\r
ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;\r
\r
- if (Flags & COUNT_ONLY_NO_PRINT) {\r
- LengthToReturn += (1 * BytesPerOutputCharacter);\r
- } else {\r
-// Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ArgumentCharacter, BytesPerOutputCharacter);\r
- }\r
+ LengthToReturn += (1 * BytesPerOutputCharacter);\r
ArgumentString += BytesPerArgumentCharacter;\r
Index++;\r
if (Comma) {\r
Digits = 0;\r
Index++;\r
if (Index < Count) {\r
- if (Flags & COUNT_ONLY_NO_PRINT) {\r
- LengthToReturn += (1 * BytesPerOutputCharacter);\r
- } else {\r
-// Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ',', BytesPerOutputCharacter);\r
- }\r
+ LengthToReturn += (1 * BytesPerOutputCharacter);\r
}\r
}\r
}\r
// Pad after the string\r
//\r
if ((Flags & (PAD_TO_WIDTH | LEFT_JUSTIFY)) == (PAD_TO_WIDTH | LEFT_JUSTIFY)) {\r
- if (Flags & COUNT_ONLY_NO_PRINT) {\r
- LengthToReturn += ((Width - Precision) * BytesPerOutputCharacter);\r
- } else {\r
-// Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Precision, ' ', BytesPerOutputCharacter);\r
- }\r
+ LengthToReturn += ((Width - Precision) * BytesPerOutputCharacter);\r
}\r
\r
//\r