IntelFrameworkModulePkg: 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: Jeff Fan <jeff.fan@intel.com>
This commit is contained in:
Hao Wu
2017-01-17 09:00:26 +08:00
parent dc6ab283ca
commit 0438f5e287
4 changed files with 40 additions and 13 deletions

View File

@ -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
@ -629,9 +629,16 @@ ConvertProcessorToString (
StringBuffer = AllocateZeroPool (0x20);
ASSERT (StringBuffer != NULL);
Index = UnicodeValueToString (StringBuffer, LEFT_JUSTIFY, FreqMhz / 1000, 3);
UnicodeValueToStringS (StringBuffer, 0x20, LEFT_JUSTIFY, FreqMhz / 1000, 3);
Index = StrnLenS (StringBuffer, 0x20 / sizeof (CHAR16));
StrCatS (StringBuffer, 0x20 / sizeof (CHAR16), L".");
UnicodeValueToString (StringBuffer + Index + 1, PREFIX_ZERO, (FreqMhz % 1000) / 10, 2);
UnicodeValueToStringS (
StringBuffer + Index + 1,
0x20 - sizeof (CHAR16) * (Index + 1),
PREFIX_ZERO,
(FreqMhz % 1000) / 10,
2
);
StrCatS (StringBuffer, 0x20 / sizeof (CHAR16), L" GHz");
*String = (CHAR16 *) StringBuffer;
return ;
@ -655,7 +662,7 @@ ConvertMemorySizeToString (
StringBuffer = AllocateZeroPool (0x20);
ASSERT (StringBuffer != NULL);
UnicodeValueToString (StringBuffer, LEFT_JUSTIFY, MemorySize, 6);
UnicodeValueToStringS (StringBuffer, 0x20, LEFT_JUSTIFY, MemorySize, 6);
StrCatS (StringBuffer, 0x20 / sizeof (CHAR16), L" MB RAM");
*String = (CHAR16 *) StringBuffer;