X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FLibrary%2FDxePrintLibPrint2Protocol%2FPrintLib.c;h=caff0409993091f36ac46c80dea10f711aa30225;hp=4646f18432ec61d616f93a0e4b77ae9c8bed87d1;hb=6e1e5405544724406f07344a5911298c3df44129;hpb=ad9aa87b5604cb17da688d5672b1e72e6ccde3b6 diff --git a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c index 4646f18432..caff040999 100644 --- a/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c +++ b/MdeModulePkg/Library/DxePrintLibPrint2Protocol/PrintLib.c @@ -6,7 +6,7 @@ protocol related to this implementation, not in the public spec. So, this library instance is only for this code base. -Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
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 @@ -24,7 +24,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include -#include #include EFI_PRINT2_PROTOCOL *mPrint2Protocol = NULL; @@ -50,11 +49,11 @@ PrintLibConstructor ( { EFI_STATUS Status; - Status = gBS->LocateProtocol ( - &gEfiPrint2ProtocolGuid, - NULL, - (VOID**) &mPrint2Protocol - ); + Status = SystemTable->BootServices->LocateProtocol ( + &gEfiPrint2ProtocolGuid, + NULL, + (VOID**) &mPrint2Protocol + ); ASSERT_EFI_ERROR (Status); ASSERT (mPrint2Protocol != NULL); @@ -367,9 +366,12 @@ UnicodeSPrint ( ) { VA_LIST Marker; + UINTN NumberOfPrinted; VA_START (Marker, FormatString); - return UnicodeVSPrint (StartOfBuffer, BufferSize, FormatString, Marker); + NumberOfPrinted = UnicodeVSPrint (StartOfBuffer, BufferSize, FormatString, Marker); + VA_END (Marker); + return NumberOfPrinted; } /** @@ -516,9 +518,12 @@ UnicodeSPrintAsciiFormat ( ) { VA_LIST Marker; + UINTN NumberOfPrinted; VA_START (Marker, FormatString); - return UnicodeVSPrintAsciiFormat (StartOfBuffer, BufferSize, FormatString, Marker); + NumberOfPrinted = UnicodeVSPrintAsciiFormat (StartOfBuffer, BufferSize, FormatString, Marker); + VA_END (Marker); + return NumberOfPrinted; } /** @@ -715,9 +720,12 @@ AsciiSPrint ( ) { VA_LIST Marker; + UINTN NumberOfPrinted; VA_START (Marker, FormatString); - return AsciiVSPrint (StartOfBuffer, BufferSize, FormatString, Marker); + NumberOfPrinted = AsciiVSPrint (StartOfBuffer, BufferSize, FormatString, Marker); + VA_END (Marker); + return NumberOfPrinted; } /** @@ -864,9 +872,12 @@ AsciiSPrintUnicodeFormat ( ) { VA_LIST Marker; + UINTN NumberOfPrinted; VA_START (Marker, FormatString); - return AsciiVSPrintUnicodeFormat (StartOfBuffer, BufferSize, FormatString, Marker); + NumberOfPrinted = AsciiVSPrintUnicodeFormat (StartOfBuffer, BufferSize, FormatString, Marker); + VA_END (Marker); + return NumberOfPrinted; } @@ -1057,9 +1068,12 @@ InternalPrintLibSPrint ( ) { VA_LIST Marker; + UINTN NumberOfPrinted; VA_START (Marker, FormatString); - return InternalPrintLibSPrintMarker (StartOfBuffer, BufferSize, Flags, FormatString, Marker, NULL); + NumberOfPrinted = InternalPrintLibSPrintMarker (StartOfBuffer, BufferSize, Flags, FormatString, Marker, NULL); + VA_END (Marker); + return NumberOfPrinted; } #define WARNING_STATUS_NUMBER 4 @@ -1135,7 +1149,6 @@ InternalPrintLibSPrintMarker ( IN BASE_LIST BaseListMarker OPTIONAL ) { - CHAR8 *OriginalBuffer; CHAR8 *EndBuffer; CHAR8 ValueBuffer[MAXIMUM_VALUE_CHARACTERS]; UINT32 BytesPerOutputCharacter; @@ -1186,7 +1199,6 @@ InternalPrintLibSPrintMarker ( // Reserve space for the Null terminator. // BufferSize--; - OriginalBuffer = Buffer; // // Set the tag for the end of the input Buffer. @@ -1223,7 +1235,7 @@ InternalPrintLibSPrintMarker ( // // Clear all the flag bits except those that may have been passed in // - Flags &= (OUTPUT_UNICODE | FORMAT_UNICODE | COUNT_ONLY_NO_PRINT); + Flags &= (UINTN)(OUTPUT_UNICODE | FORMAT_UNICODE | COUNT_ONLY_NO_PRINT); // // Set the default width to zero, and the default precision to 1 @@ -1331,7 +1343,7 @@ InternalPrintLibSPrintMarker ( // // Flag space, +, 0, L & l are invalid for type p. // - Flags &= ~(PREFIX_BLANK | PREFIX_SIGN | PREFIX_ZERO | LONG_TYPE); + Flags &= ~(UINTN)(PREFIX_BLANK | PREFIX_SIGN | PREFIX_ZERO | LONG_TYPE); if (sizeof (VOID *) > 4) { Flags |= LONG_TYPE; } @@ -1379,7 +1391,7 @@ InternalPrintLibSPrintMarker ( if ((Flags & RADIX_HEX) == 0) { Radix = 10; if (Comma) { - Flags &= (~PREFIX_ZERO); + Flags &= (~(UINTN)PREFIX_ZERO); Precision = 1; } if (Value < 0) { @@ -1448,7 +1460,7 @@ InternalPrintLibSPrintMarker ( ArgumentString = BASE_ARG (BaseListMarker, CHAR8 *); } if (ArgumentString == NULL) { - Flags &= (~ARGUMENT_UNICODE); + Flags &= (~(UINTN)ARGUMENT_UNICODE); ArgumentString = ""; } //