MdeModulePkg: Replace [Ascii|Unicode]ValueToString
It is the follow up of commits 51f0ceb..9e32e97 to replace AsciiValueToString/UnicodeValueToString with AsciiValueToStringS/UnicodeValueToStringS. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/** @file
|
||||
FrontPage routines to handle the callbacks and browser calls
|
||||
|
||||
Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2017, 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
|
||||
@@ -408,9 +408,16 @@ ConvertProcessorToString (
|
||||
DestMax = 0x20 / sizeof (CHAR16);
|
||||
StringBuffer = AllocateZeroPool (0x20);
|
||||
ASSERT (StringBuffer != NULL);
|
||||
Index = UnicodeValueToString (StringBuffer, LEFT_JUSTIFY, FreqMhz / 1000, 3);
|
||||
UnicodeValueToStringS (StringBuffer, sizeof (CHAR16) * DestMax, LEFT_JUSTIFY, FreqMhz / 1000, 3);
|
||||
Index = StrnLenS (StringBuffer, DestMax);
|
||||
StrCatS (StringBuffer, DestMax, L".");
|
||||
UnicodeValueToString (StringBuffer + Index + 1, PREFIX_ZERO, (FreqMhz % 1000) / 10, 2);
|
||||
UnicodeValueToStringS (
|
||||
StringBuffer + Index + 1,
|
||||
sizeof (CHAR16) * (DestMax - (Index + 1)),
|
||||
PREFIX_ZERO,
|
||||
(FreqMhz % 1000) / 10,
|
||||
2
|
||||
);
|
||||
StrCatS (StringBuffer, DestMax, L" GHz");
|
||||
*String = (CHAR16 *) StringBuffer;
|
||||
return ;
|
||||
@@ -434,7 +441,7 @@ ConvertMemorySizeToString (
|
||||
|
||||
StringBuffer = AllocateZeroPool (0x24);
|
||||
ASSERT (StringBuffer != NULL);
|
||||
UnicodeValueToString (StringBuffer, LEFT_JUSTIFY, MemorySize, 10);
|
||||
UnicodeValueToStringS (StringBuffer, 0x24, LEFT_JUSTIFY, MemorySize, 10);
|
||||
StrCatS (StringBuffer, 0x24 / sizeof (CHAR16), L" MB RAM");
|
||||
|
||||
*String = (CHAR16 *) StringBuffer;
|
||||
|
Reference in New Issue
Block a user