diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-12-01 02:32:12 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-12-01 02:32:12 +0000 |
commit | ac7e320cb8326befd240020db709151884c889bc (patch) | |
tree | 0244f130be9838647093dbabad4ee7d0d7b5348a /MdeModulePkg/Universal/SetupBrowserDxe/Expression.c | |
parent | 48bd50c5a1e4c31818bba1d2ce88f9270b2f2440 (diff) | |
download | edk2-platforms-ac7e320cb8326befd240020db709151884c889bc.tar.xz |
Remove NibbleToHexChar() function from BaseLib
Move IsHexDigit, BufToHexString, HexStringToBuf from BaseLib to MdeModulePkg IfrSupportLib. The reason is:
1) IsHexDigit function provides the logic to check Hex Digit and convert it to Decimal value, which is required by IScsi LUN and HII user input. But this logic is not provided by any functions in MdeLib. So, it can't be deleted. It is moved to IfrSupportLib.
2) BufToHexString function converts a array of buffers to hex string. If the buffer length is less than sizeof (UINT64), it can be directly replaced by UnicodeValueToString(). But HII modules may use BufToHexString to convert the buffers whose length > sizeof (UINT64). For example:
.\MdeModulePkg\Universal\HiiDatabaseDxe\ConfigRouting.c line 201, 1148
.\Universal\SetupBrowserDxe\Setup.c line line 1457, 1503
Like this case, it is not easy to use UnicodeValueToString to replace BufToHexString. So, BufToHexString is still kept. Because such usages are in HII modules, this function is moved to IfrSupportLib.
3) HexStringToBuf is moved to IfrSupportLib. The reason is similar to BufToHexString.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6782 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/Expression.c')
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Expression.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c index a56c7318b4..5044fd1642 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c @@ -619,7 +619,6 @@ IfrToUint ( EFI_HII_VALUE Value;
CHAR16 *String;
CHAR16 *StringPtr;
- UINTN BufferSize;
Status = PopExpression (&Value);
if (EFI_ERROR (Status)) {
@@ -636,19 +635,19 @@ IfrToUint ( if (String == NULL) {
return EFI_NOT_FOUND;
}
-
+
IfrStrToUpper (String);
StringPtr = StrStr (String, L"0X");
if (StringPtr != NULL) {
//
// Hex string
//
- BufferSize = sizeof (UINT64);
- Status = HexStringToBuf ((UINT8 *) &Result->Value.u64, &BufferSize, StringPtr + 2, NULL);
+ Result->Value.u64 = StrHexToUint64 (String);
} else {
//
- // BUGBUG: Need handle decimal string
+ // decimal string
//
+ Result->Value.u64 = StrDecimalToUint64 (String);
}
FreePool (String);
} else {
|