summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Universal/UserInterface/SetupBrowser
diff options
context:
space:
mode:
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-25 06:15:58 +0000
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-25 06:15:58 +0000
commit1cc8ee7861a59532700a6fd1255689576eda0f52 (patch)
tree7708d058115302ba08d7879965e8864467958e93 /EdkModulePkg/Universal/UserInterface/SetupBrowser
parent582510249f2fb1334e507b99421b9485f6b89159 (diff)
downloadedk2-1cc8ee7861a59532700a6fd1255689576eda0f52.zip
edk2-1cc8ee7861a59532700a6fd1255689576eda0f52.tar.gz
edk2-1cc8ee7861a59532700a6fd1255689576eda0f52.tar.bz2
Partially make EdkModulePkg pass intel IPF compiler with /W4 /WX switched on.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2313 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Universal/UserInterface/SetupBrowser')
-rw-r--r--EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Boolean.c11
-rw-r--r--EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/InputHandler.c69
-rw-r--r--EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Presentation.c4
-rw-r--r--EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Print.h2
-rw-r--r--EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/ProcessOptions.c1
-rw-r--r--EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Setup.c5
-rw-r--r--EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c11
7 files changed, 55 insertions, 48 deletions
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Boolean.c b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Boolean.c
index 122da06..d3f77e0 100644
--- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Boolean.c
+++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Boolean.c
@@ -83,6 +83,7 @@ Returns:
mBooleanEvaluationStackEnd = NewStack + StackSizeInBoolean;
}
+STATIC
VOID
InitializeBooleanEvaluator (
VOID
@@ -176,6 +177,7 @@ Returns:
return ReturnValue;
}
+STATIC
EFI_STATUS
GrowBooleanExpression (
IN EFI_INCONSISTENCY_DATA *InconsistentTags,
@@ -212,6 +214,7 @@ GrowBooleanExpression (
return EFI_SUCCESS;
}
+STATIC
VOID
CreateBooleanExpression (
IN EFI_FILE_FORM_TAGS *FileFormTags,
@@ -311,6 +314,7 @@ NextEntry:
GrowBooleanExpression (&FakeInconsistentTags, BooleanExpression, BooleanExpressionLength);
}
+STATIC
EFI_STATUS
BooleanVariableWorker (
IN CHAR16 *VariableName,
@@ -369,6 +373,7 @@ Returns:
return Status;
}
+STATIC
UINT8
PredicateIfrType (
IN EFI_INCONSISTENCY_DATA *Iterator
@@ -416,6 +421,7 @@ Returns:
return 0x2;
}
+STATIC
VOID
PostOrderEvaluate (
IN EFI_FILE_FORM_TAGS *FileFormTags,
@@ -616,7 +622,7 @@ Returns:
break;
case EFI_IFR_NOT_OP:
Operator = PopBool (StackPtr);
- PushBool (StackPtr, !Operator);
+ PushBool (StackPtr, (BOOLEAN) (!Operator));
break;
case EFI_IFR_SUPPRESS_IF_OP:
@@ -1350,11 +1356,12 @@ Returns:
return Operator;
}
- return FALSE;
+ goto Done;
}
Iterator++;
}
+Done:
return FALSE;
}
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/InputHandler.c b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/InputHandler.c
index 466039f..ebf0385 100644
--- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/InputHandler.c
+++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/InputHandler.c
@@ -215,7 +215,6 @@ ReadPassword (
)
{
EFI_STATUS Status;
- UINTN PasswordSize;
UINTN ScreenSize;
CHAR16 NullCharacter;
CHAR16 Space[2];
@@ -234,12 +233,12 @@ ReadPassword (
UINTN DimensionsWidth;
UINTN DimensionsHeight;
EFI_IFR_DATA_ENTRY *DataEntry;
+ UINTN WidthOfString;
DimensionsWidth = gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn;
DimensionsHeight = gScreenDimensions.BottomRow - gScreenDimensions.TopRow;
VariableDefinition = NULL;
- PasswordSize = 0;
NullCharacter = CHAR_NULL;
Space[0] = L' ';
Space[1] = CHAR_NULL;
@@ -309,7 +308,8 @@ Error:
// Upon error, we will likely receive a string to print out
// Display error popup
//
- ScreenSize = EFI_MAX(GetStringWidth (Packet->String), GetStringWidth (gPressEnter)) / 2;
+ WidthOfString = GetStringWidth (Packet->String);
+ ScreenSize = EFI_MAX(WidthOfString, GetStringWidth (gPressEnter)) / 2;
CreatePopUp (ScreenSize, 4, &NullCharacter, Packet->String, gPressEnter, &NullCharacter);
gBS->FreePool (Packet);
@@ -318,9 +318,8 @@ Error:
} while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
}
- gBS->FreePool (TempString);
- gBS->FreePool (TempString2);
- return EFI_NOT_READY;
+ Status = EFI_NOT_READY;
+ goto Done;
}
}
@@ -418,10 +417,12 @@ Error:
if (Confirmation) {
if (EFI_ERROR (Status)) {
if (Packet->String == NULL) {
- ScreenSize = EFI_MAX (GetStringWidth (gConfirmError), GetStringWidth (gPressEnter)) / 2;
+ WidthOfString = GetStringWidth (gConfirmError);
+ ScreenSize = EFI_MAX (WidthOfString, GetStringWidth (gPressEnter)) / 2;
CreatePopUp (ScreenSize, 4, &NullCharacter, gConfirmError, gPressEnter, &NullCharacter);
} else {
- ScreenSize = EFI_MAX (GetStringWidth (Packet->String), GetStringWidth (gPressEnter)) / 2;
+ WidthOfString = GetStringWidth (Packet->String);
+ ScreenSize = EFI_MAX (WidthOfString, GetStringWidth (gPressEnter)) / 2;
CreatePopUp (ScreenSize, 4, &NullCharacter, Packet->String, gPressEnter, &NullCharacter);
gBS->FreePool (Packet);
}
@@ -431,15 +432,13 @@ Error:
Status = WaitForKeyStroke (&Key);
if (Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
- gBS->FreePool (TempString);
- gBS->FreePool (TempString2);
- return EFI_NOT_READY;
+ Status = EFI_NOT_READY;
+ goto Done;
}
} while (1);
} else {
- gBS->FreePool (TempString);
- gBS->FreePool (TempString2);
- return EFI_NOT_READY;
+ Status = EFI_NOT_READY;
+ goto Done;
}
} else {
//
@@ -451,9 +450,8 @@ Error:
}
if (PromptForPassword && EFI_ERROR (Status)) {
- gBS->FreePool (TempString);
- gBS->FreePool (TempString2);
- return EFI_DEVICE_ERROR;
+ Status = EFI_DEVICE_ERROR;
+ goto Done;
}
}
}
@@ -464,19 +462,18 @@ Error:
// Otherwise, kick and error box, and return an error
//
if (StrCmp (TempString, TempString2) == 0) {
- gBS->FreePool (TempString);
- gBS->FreePool (TempString2);
- return EFI_SUCCESS;
+ Status = EFI_SUCCESS;
+ goto Done;
} else {
- ScreenSize = EFI_MAX (GetStringWidth (gConfirmError), GetStringWidth (gPressEnter)) / 2;
+ WidthOfString = GetStringWidth (gConfirmError);
+ ScreenSize = EFI_MAX (WidthOfString, GetStringWidth (gPressEnter)) / 2;
CreatePopUp (ScreenSize, 4, &NullCharacter, gConfirmError, gPressEnter, &NullCharacter);
StringPtr[0] = CHAR_NULL;
do {
Status = WaitForKeyStroke (&Key);
if (Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
- gBS->FreePool (TempString);
- gBS->FreePool (TempString2);
- return EFI_DEVICE_ERROR;
+ Status = EFI_DEVICE_ERROR;
+ goto Done;
}
} while (1);
}
@@ -486,9 +483,8 @@ Error:
//
// I was asked for a password, return it back in StringPtr
//
- gBS->FreePool (TempString);
- gBS->FreePool (TempString2);
- return EFI_SUCCESS;
+ Status = EFI_SUCCESS;
+ goto Done;
} else {
//
// If the two passwords were not the same kick an error popup
@@ -575,6 +571,8 @@ Error:
} while (!ConfirmationComplete);
} while (1);
+
+Done:
gBS->FreePool (TempString);
gBS->FreePool (TempString2);
return Status;
@@ -655,7 +653,6 @@ Returns:
CHAR16 NullCharacter;
CHAR16 *StringPtr;
EFI_FILE_FORM_TAGS *FileFormTags;
- EFI_STATUS Status;
EFI_VARIABLE_DEFINITION *VariableDefinition;
UINTN Loop;
@@ -689,7 +686,7 @@ Returns:
goto TheKey2;
}
- Status = WaitForKeyStroke (&Key);
+ WaitForKeyStroke (&Key);
TheKey2:
switch (Key.UnicodeChar) {
@@ -879,7 +876,7 @@ EnterCarriageReturn:
CreatePopUp (GetStringWidth (StringPtr) / 2, 3, &NullCharacter, StringPtr, &NullCharacter);
do {
- Status = WaitForKeyStroke (&Key);
+ WaitForKeyStroke (&Key);
switch (Key.UnicodeChar) {
@@ -985,7 +982,6 @@ GetSelectionInputPopUp (
OUT UINT16 *KeyValue
)
{
- EFI_STATUS Status;
EFI_INPUT_KEY Key;
UINTN Index;
UINTN TempIndex;
@@ -1005,7 +1001,6 @@ GetSelectionInputPopUp (
UINTN MenuLinesInView;
UINTN PopUpWidth;
CHAR16 Character;
- UINTN FirstOption;
BOOLEAN FirstOptionFoundFlag;
INT32 SavedAttribute;
EFI_TAG TagBackup;
@@ -1017,10 +1012,8 @@ GetSelectionInputPopUp (
BOOLEAN ShowDownArrow;
BOOLEAN ShowUpArrow;
UINTN DimensionsWidth;
- UINTN DimensionsHeight;
DimensionsWidth = gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn;
- DimensionsHeight = gScreenDimensions.BottomRow - gScreenDimensions.TopRow;
TempValue = 0;
TempIndex = 0;
@@ -1050,7 +1043,6 @@ GetSelectionInputPopUp (
Count = 0;
PopUpWidth = 0;
- FirstOption = MenuOption->TagIndex;
FirstOptionFoundFlag = FALSE;
StringPtr = AllocateZeroPool ((gOptionBlockWidth + 1) * 2);
@@ -1066,7 +1058,6 @@ GetSelectionInputPopUp (
if (MenuOption->Tags[Index].Operand == EFI_IFR_ONE_OF_OPTION_OP &&
!MenuOption->Tags[Index].Suppress) {
if (!FirstOptionFoundFlag) {
- FirstOption = Index;
FirstOptionFoundFlag = TRUE;
}
@@ -1309,7 +1300,7 @@ GetSelectionInputPopUp (
KeyInitialized = TRUE;
}
- Status = WaitForKeyStroke (&Key);
+ WaitForKeyStroke (&Key);
TheKey:
switch (Key.UnicodeChar) {
@@ -1553,14 +1544,14 @@ TheKey:
*Value = TempValue;
}
- gST->ConOut->SetAttribute (gST->ConOut, SavedAttribute);
- return EFI_SUCCESS;
+ goto Done;
default:
break;
}
} while (1);
+Done:
gST->ConOut->SetAttribute (gST->ConOut, SavedAttribute);
return EFI_SUCCESS;
}
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Presentation.c b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Presentation.c
index 7b219c8..8c81fd8 100644
--- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Presentation.c
+++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Presentation.c
@@ -348,6 +348,7 @@ DisplayPageFrame (
| ^"=Move Highlight <Spacebar> Toggles Checkbox Esc=Discard Changes |
+------------------------------------------------------------------------------+
*/
+STATIC
UI_MENU_OPTION *
DisplayForm (
OUT UI_MENU_OPTION *Selection,
@@ -796,6 +797,7 @@ Returns:
}
+STATIC
VOID
ExtractFormHandle (
IN UI_MENU_OPTION *Selection,
@@ -851,6 +853,7 @@ ExtractFormHandle (
return ;
}
+STATIC
EFI_STATUS
UpdateNewTagData (
IN UINT8 *FormData,
@@ -1092,6 +1095,7 @@ UpdateNewTagData (
return Status;
}
+STATIC
VOID
ExtractDynamicFormHandle (
IN UI_MENU_OPTION *Selection,
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Print.h b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Print.h
index 86feb88..d055513 100644
--- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Print.h
+++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Print.h
@@ -22,6 +22,8 @@ Abstract:
#ifndef _PRINT_H_
#define _PRINT_H_
+#include "Setup.h"
+
#define LEFT_JUSTIFY 0x01
#define PREFIX_SIGN 0x02
#define PREFIX_BLANK 0x04
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/ProcessOptions.c b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/ProcessOptions.c
index 8a878bc..a2aa50f 100644
--- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/ProcessOptions.c
+++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/ProcessOptions.c
@@ -77,6 +77,7 @@ ExtractNvValue (
return Status;
}
+STATIC
VOID
AdjustNvMap (
IN EFI_FILE_FORM_TAGS *FileFormTags,
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Setup.c b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Setup.c
index f62bc12..407f769 100644
--- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Setup.c
+++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Setup.c
@@ -144,6 +144,7 @@ InstallPrint (
VOID
);
+STATIC
EFI_STATUS
EFIAPI
SendForm (
@@ -189,7 +190,6 @@ Returns:
--*/
{
- EFI_FORM_CONFIGURATION_DATA *FormData;
EFI_FORM_CALLBACK_PROTOCOL *FormCallback;
EFI_FILE_FORM_TAGS *FileFormTagsHead;
UI_MENU_OPTION *Selection;
@@ -279,7 +279,6 @@ Returns:
ASSERT (gPreviousValue != NULL);
}
- FormData = EFI_FORM_DATA_FROM_THIS (This);
Callback = FALSE;
FormCallback = NULL;
@@ -710,6 +709,7 @@ GetTagCount (
(*NumberOfTags)++;
}
+STATIC
VOID
AddNextInconsistentTag (
IN OUT EFI_INCONSISTENCY_DATA **InconsistentTagsPtr
@@ -1643,6 +1643,7 @@ Returns:
return Buffer;
}
+STATIC
EFI_STATUS
PopulateHomePage (
IN UINTN NumberOfIfrImages,
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c
index 369d2b4..854d023 100644
--- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c
+++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c
@@ -211,6 +211,7 @@ Returns:
}
}
+STATIC
VOID
UpdateDateAndTime (
VOID
@@ -492,7 +493,6 @@ Returns:
UINTN Start;
UINTN Top;
UINTN Index;
- EFI_STATUS Status;
BOOLEAN SelectionComplete;
UINTN InputOffset;
UINTN CurrentAttribute;
@@ -570,12 +570,12 @@ Returns:
// Take the first key typed and report it back?
//
if (HotKey) {
- Status = WaitForKeyStroke (&Key);
+ WaitForKeyStroke (&Key);
CopyMem (KeyValue, &Key, sizeof (EFI_INPUT_KEY));
} else {
do {
- Status = WaitForKeyStroke (&Key);
+ WaitForKeyStroke (&Key);
switch (Key.UnicodeChar) {
case CHAR_NULL:
@@ -1046,6 +1046,7 @@ Returns:
return ;
}
+STATIC
BOOLEAN
SelectionsAreValid (
IN UI_MENU_OPTION *MenuOption,
@@ -1068,7 +1069,6 @@ Returns:
EFI_FILE_FORM_TAGS *FileFormTags;
CHAR16 *StringPtr;
CHAR16 NullCharacter;
- EFI_STATUS Status;
UINTN Index;
UINT16 *NvRamMap;
STRING_REF PopUp;
@@ -1103,7 +1103,7 @@ Returns:
CreatePopUp (GetStringWidth (StringPtr) / 2, 3, &NullCharacter, StringPtr, &NullCharacter);
do {
- Status = WaitForKeyStroke (&Key);
+ WaitForKeyStroke (&Key);
switch (Key.UnicodeChar) {
@@ -1284,6 +1284,7 @@ Returns:
}
}
+STATIC
VOID
UpdateOptionSkipLines (
IN EFI_IFR_DATA_ARRAY *PageData,