From 1db1f6adb4591671c044dc18d82f89845c60ecfa Mon Sep 17 00:00:00 2001 From: qwang12 Date: Wed, 16 Jul 2008 03:06:59 +0000 Subject: [PATCH] Clean up IfrSupportLib. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5487 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Include/Library/IfrSupportLib.h | 11 +++++++--- MdePkg/Library/HiiLib/HiiLib.c | 2 +- MdePkg/Library/IfrSupportLib/UefiIfrForm.c | 25 +++++++++++++--------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/MdePkg/Include/Library/IfrSupportLib.h b/MdePkg/Include/Library/IfrSupportLib.h index f4f7a1907b..953cd47314 100644 --- a/MdePkg/Include/Library/IfrSupportLib.h +++ b/MdePkg/Include/Library/IfrSupportLib.h @@ -431,6 +431,7 @@ CreateStringOpCode ( **/ VOID +EFIAPI ToLower ( IN OUT CHAR16 *Str ) @@ -494,7 +495,9 @@ HexStringToBuffer ( @retval EFI_SUCCESS Routine success. @retval EFI_BUFFER_TOO_SMALL The string buffer is too small. -**/EFI_STATUS +**/ +EFI_STATUS +EFIAPI ConfigStringToUnicode ( IN OUT CHAR16 *UnicodeString, IN OUT UINTN *StrBufferLen, @@ -518,7 +521,9 @@ ConfigStringToUnicode ( @retval EFI_SUCCESS Routine success. @retval EFI_BUFFER_TOO_SMALL The string buffer is too small. -**/EFI_STATUS +**/ +EFI_STATUS +EFIAPI UnicodeToConfigString ( IN OUT CHAR16 *ConfigString, IN OUT UINTN *StrBufferLen, @@ -640,7 +645,7 @@ SetBrowserData ( @param NumberOfLines The number of lines for the dialog box @param KeyValue The EFI_KEY value returned if HotKey is TRUE.. @param String Pointer to the first string in the list - @param ... A series of (quantity == NumberOfLines) text + @param ... A series of (quantity == NumberOfLines - 1) text strings which will be used to construct the dialog box diff --git a/MdePkg/Library/HiiLib/HiiLib.c b/MdePkg/Library/HiiLib/HiiLib.c index a178012b6e..be3a31704d 100644 --- a/MdePkg/Library/HiiLib/HiiLib.c +++ b/MdePkg/Library/HiiLib/HiiLib.c @@ -78,7 +78,7 @@ EFI_HII_PACKAGE_LIST_HEADER * InternalHiiLibPreparePackages ( IN UINTN NumberOfPackages, IN CONST EFI_GUID *GuidId, - VA_LIST Marker + IN VA_LIST Marker ) { EFI_HII_PACKAGE_LIST_HEADER *PackageListHeader; diff --git a/MdePkg/Library/IfrSupportLib/UefiIfrForm.c b/MdePkg/Library/IfrSupportLib/UefiIfrForm.c index d0da744240..179fc1cb9f 100644 --- a/MdePkg/Library/IfrSupportLib/UefiIfrForm.c +++ b/MdePkg/Library/IfrSupportLib/UefiIfrForm.c @@ -18,7 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // // Fake // -UINT16 mFakeConfigHdr[] = L"GUID=00000000000000000000000000000000&NAME=0000&PATH=0"; +GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT16 mFakeConfigHdr[] = L"GUID=00000000000000000000000000000000&NAME=0000&PATH=0"; /** Draw a dialog and return the selected key. @@ -26,7 +26,7 @@ UINT16 mFakeConfigHdr[] = L"GUID=00000000000000000000000000000000&NAME=0000&PATH @param NumberOfLines The number of lines for the dialog box @param KeyValue The EFI_KEY value returned if HotKey is TRUE.. @param String Pointer to the first string in the list - @param ... A series of (quantity == NumberOfLines) text + @param ... A series of (quantity == NumberOfLines - 1) text strings which will be used to construct the dialog box @@ -109,6 +109,7 @@ IfrLibCreatePopUp ( LargestString = StringLen; } } + VA_END (Marker); if ((LargestString + 2) > DimensionsWidth) { LargestString = DimensionsWidth - 2; @@ -250,6 +251,7 @@ SwapBuffer ( **/ VOID +EFIAPI ToLower ( IN OUT CHAR16 *Str ) @@ -292,7 +294,7 @@ BufferToHexString ( StrBufferLen = BufferSize * sizeof (CHAR16) + 1; Status = BufToHexString (Str, &StrBufferLen, NewBuffer, BufferSize); - gBS->FreePool (NewBuffer); + FreePool (NewBuffer); // // Convert the uppercase to lowercase since is defined in lowercase format. // @@ -354,6 +356,7 @@ HexStringToBuffer ( **/ EFI_STATUS +EFIAPI ConfigStringToUnicode ( IN OUT CHAR16 *UnicodeString, IN OUT UINTN *StrBufferLen, @@ -413,6 +416,7 @@ ConfigStringToUnicode ( **/ EFI_STATUS +EFIAPI UnicodeToConfigString ( IN OUT CHAR16 *ConfigString, IN OUT UINTN *StrBufferLen, @@ -566,6 +570,7 @@ ConstructConfigHdr ( **/ BOOLEAN +EFIAPI FindBlockName ( IN OUT CHAR16 *String, UINTN Offset, @@ -644,7 +649,7 @@ GetBrowserData ( ) { EFI_STATUS Status; - CHAR16 *ConfigHdr; + CONST CHAR16 *ConfigHdr; CHAR16 *ConfigResp; CHAR16 *StringPtr; UINTN HeaderLen; @@ -688,7 +693,7 @@ GetBrowserData ( VariableName ); if (Status == EFI_BUFFER_TOO_SMALL) { - gBS->FreePool (ConfigResp); + FreePool (ConfigResp); ConfigResp = AllocateZeroPool (BufferLen + HeaderLen); StringPtr = ConfigResp + HeaderLen; @@ -705,7 +710,7 @@ GetBrowserData ( ); } if (EFI_ERROR (Status)) { - gBS->FreePool (ConfigResp); + FreePool (ConfigResp); return Status; } CopyMem (ConfigResp, ConfigHdr, HeaderLen * sizeof (UINT16)); @@ -720,7 +725,7 @@ GetBrowserData ( BufferSize, &Progress ); - gBS->FreePool (ConfigResp); + FreePool (ConfigResp); return Status; } @@ -756,7 +761,7 @@ SetBrowserData ( ) { EFI_STATUS Status; - CHAR16 *ConfigHdr; + CONST CHAR16 *ConfigHdr; CHAR16 *ConfigResp; CHAR16 *StringPtr; UINTN HeaderLen; @@ -825,7 +830,7 @@ SetBrowserData ( &Progress ); if (EFI_ERROR (Status)) { - gBS->FreePool (ConfigResp); + FreePool (ConfigResp); return Status; } @@ -845,6 +850,6 @@ SetBrowserData ( NULL, NULL ); - gBS->FreePool (ConfigResp); + FreePool (ConfigResp); return Status; } -- 2.39.2