From a3657e3e7aaaccb1b9ea1b41a72d4564452e272d Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Thu, 25 May 2006 10:13:26 +0000 Subject: =?UTF-8?q?MemoryAllocationLib:=20For=20boundary=20case:=20?= =?UTF-8?q?=E2=80=9CAllocationSize=20+=20OverAllocationSize=20>=3D=204G?= =?UTF-8?q?=E2=80=9D=20DxeMemoryAllocationLib:=20Change=20the=20behavior?= =?UTF-8?q?=20from=20returning=20NULL=20to=20ASSERT=20()=20PeiMemoryAlloca?= =?UTF-8?q?tionLib:=20Add=20ASSERT=20()=20I=20also=20add=20ASSERT=20()=20i?= =?UTF-8?q?n=20Pei=20Service=20AllocatePool=20()=20to=20catch=20if=20alloc?= =?UTF-8?q?ation=20size=20>=2064K=20DebugLib:=20Header=20file=20(DebugLib.?= =?UTF-8?q?h):=20Fix=20an=20issue=20in=20ASSERT=5FPROTOCOL=5FALREADY=5FINS?= =?UTF-8?q?TALLED(Handle,=20Guid).=20In=20contrast=20with=20LocateProtocol?= =?UTF-8?q?=20(),=20the=20first=20&=20second=20parameter=20type=20of=20Han?= =?UTF-8?q?dleProtocol=20()=20is=20EFI=5FHANDLE=20&=20EFI=5FGUID=20respect?= =?UTF-8?q?ively.=20UefiLib:=20For=20UnicodeStringDisplayLength=20(CONST?= =?UTF-8?q?=20CHAR8=20*String),=20return=200=20if=20String=20is=20NULL.=20?= =?UTF-8?q?BasePrintLib:=20Add=20missing=20=E2=80=9CEFIAPI=E2=80=9D=20to?= =?UTF-8?q?=20UnicodeValueToString()=20and=20AsciiValueToString()=20and=20?= =?UTF-8?q?move=20their=20definitions=20from=20PrintLibInternal.c=20to=20P?= =?UTF-8?q?rintLib.c.=20Fix=20the=20comments=20error(Maximum=20Length=20TI?= =?UTF-8?q?ME=E2=80=9D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@275 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/BasePrintLib/PrintLib.c | 24 ++++++++++++++++++++++++ MdePkg/Library/BasePrintLib/PrintLibInternal.c | 23 ----------------------- MdePkg/Library/BasePrintLib/PrintLibInternal.h | 10 +++++++++- 3 files changed, 33 insertions(+), 24 deletions(-) (limited to 'MdePkg/Library/BasePrintLib') diff --git a/MdePkg/Library/BasePrintLib/PrintLib.c b/MdePkg/Library/BasePrintLib/PrintLib.c index 816c887088..bbd0820106 100644 --- a/MdePkg/Library/BasePrintLib/PrintLib.c +++ b/MdePkg/Library/BasePrintLib/PrintLib.c @@ -637,3 +637,27 @@ AsciiSPrintUnicodeFormat ( VA_START (Marker, FormatString); return AsciiVSPrintUnicodeFormat (StartOfBuffer, BufferSize, FormatString, Marker); } + +UINTN +EFIAPI +UnicodeValueToString ( + IN OUT CHAR16 *Buffer, + IN UINTN Flags, + IN INT64 Value, + IN UINTN Width + ) +{ + return BasePrintLibConvertValueToString ((CHAR8 *)Buffer, Flags, Value, Width, 2); +} + +UINTN +EFIAPI +AsciiValueToString ( + IN OUT CHAR8 *Buffer, + IN UINTN Flags, + IN INT64 Value, + IN UINTN Width + ) +{ + return BasePrintLibConvertValueToString ((CHAR8 *)Buffer, Flags, Value, Width, 1); +} diff --git a/MdePkg/Library/BasePrintLib/PrintLibInternal.c b/MdePkg/Library/BasePrintLib/PrintLibInternal.c index 24d8b56598..56d357525c 100644 --- a/MdePkg/Library/BasePrintLib/PrintLibInternal.c +++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.c @@ -128,26 +128,3 @@ BasePrintLibConvertValueToString ( return ((Buffer - OriginalBuffer) / Increment); } - - -UINTN -UnicodeValueToString ( - IN OUT CHAR16 *Buffer, - IN UINTN Flags, - IN INT64 Value, - IN UINTN Width - ) -{ - return BasePrintLibConvertValueToString ((CHAR8 *)Buffer, Flags, Value, Width, 2); -} - -UINTN -AsciiValueToString ( - IN OUT CHAR8 *Buffer, - IN UINTN Flags, - IN INT64 Value, - IN UINTN Width - ) -{ - return BasePrintLibConvertValueToString ((CHAR8 *)Buffer, Flags, Value, Width, 1); -} diff --git a/MdePkg/Library/BasePrintLib/PrintLibInternal.h b/MdePkg/Library/BasePrintLib/PrintLibInternal.h index de08f0edfc..c7fecfd34c 100644 --- a/MdePkg/Library/BasePrintLib/PrintLibInternal.h +++ b/MdePkg/Library/BasePrintLib/PrintLibInternal.h @@ -39,7 +39,7 @@ /// Maximum Length Decimal String = 28 "-9,223,372,036,854,775,808" /// Maximum Length Hexidecimal String = 17 "FFFFFFFFFFFFFFFF" /// Maximum Length GUID = 37 "00000000-0000-0000-0000-000000000000" -/// Maximum Length TIME = 17 "12/12/2006 12:12" +/// Maximum Length TIME = 18 "12/12/2006 12:12" /// #define MAXIMUM_VALUE_CHARACTERS 38 @@ -85,3 +85,11 @@ BasePrintLibValueToString ( IN UINTN Radix ); +UINTN +BasePrintLibConvertValueToString ( + IN OUT CHAR8 *Buffer, + IN UINTN Flags, + IN INT64 Value, + IN UINTN Width, + IN UINTN Increment + ); -- cgit v1.2.3