]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Use standard VA_LIST to pass variable argument list.
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 16 Jul 2008 03:04:53 +0000 (03:04 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 16 Jul 2008 03:04:53 +0000 (03:04 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5485 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
MdeModulePkg/Universal/SetupBrowserDxe/Ui.h

index 2a4eb9e80ebe67f892c20cadf7324363a571431f..740ac27a7a2f141483d745ec54aaa3dec57d86d7 100644 (file)
@@ -694,14 +694,14 @@ GetToken (
 \r
   @param RequestedWidth  The width of the pop-up.\r
   @param NumberOfLines   The number of lines.\r
-  @param ArrayOfStrings  The array of string to be printed.\r
+  @param Marker          The variable argument list for the list of string to be printed.\r
 \r
 **/\r
 VOID\r
 CreateSharedPopUp (\r
   IN  UINTN                       RequestedWidth,\r
   IN  UINTN                       NumberOfLines,\r
-  IN  CHAR16                      **ArrayOfStrings\r
+  IN  VA_LIST                     Marker\r
   )\r
 ;\r
 \r
@@ -739,7 +739,6 @@ CreateDialog (
   IN  UINTN                       MaximumStringSize,\r
   OUT CHAR16                      *StringBuffer,\r
   OUT EFI_INPUT_KEY               *KeyValue,\r
-  IN  CHAR16                      *String,\r
   ...\r
   )\r
 ;\r
index a66e94647503d9abae3e2b00c677d4eefbba163e..bfe2137b7490cf135b0588e4e6c5a3c31cda4902 100644 (file)
@@ -548,7 +548,6 @@ UiAddMenuOption (
   @param  StringBuffer           The passed in pointer to the buffer which will\r
                                  hold the typed in string if HotKey is FALSE\r
   @param  KeyValue               The EFI_KEY value returned if HotKey is TRUE..\r
-  @param  String                 Pointer to the first string in the list\r
   @param  ...                    A series of (quantity == NumberOfLines) text\r
                                  strings which will be used to construct the dialog\r
                                  box\r
@@ -566,11 +565,11 @@ CreateDialog (
   IN  UINTN                       MaximumStringSize,\r
   OUT CHAR16                      *StringBuffer,\r
   OUT EFI_INPUT_KEY               *KeyValue,\r
-  IN  CHAR16                      *String,\r
   ...\r
   )\r
 {\r
   VA_LIST       Marker;\r
+  VA_LIST       MarkerBackup;\r
   UINTN         Count;\r
   EFI_INPUT_KEY Key;\r
   UINTN         LargestString;\r
@@ -600,7 +599,8 @@ CreateDialog (
   ASSERT (TempString);\r
   ASSERT (BufferedString);\r
 \r
-  VA_START (Marker, String);\r
+  VA_START (Marker, KeyValue);\r
+  MarkerBackup = Marker;\r
 \r
   //\r
   // Zero the outgoing buffer\r
@@ -621,16 +621,13 @@ CreateDialog (
   //\r
   gST->ConOut->EnableCursor (gST->ConOut, FALSE);\r
 \r
-  LargestString = (GetStringWidth (String) / 2);\r
+  LargestString = 0;\r
 \r
-  if (*String == L' ') {\r
-    InputOffset = 1;\r
-  }\r
   //\r
   // Determine the largest string in the dialog box\r
   // Notice we are starting with 1 since String is the first string\r
   //\r
-  for (Count = 1; Count < NumberOfLines; Count++) {\r
+  for (Count = 0; Count < NumberOfLines; Count++) {\r
     StackString = VA_ARG (Marker, CHAR16 *);\r
 \r
     if (StackString[0] == L' ') {\r
@@ -653,7 +650,7 @@ CreateDialog (
   //\r
   // Display the Popup\r
   //\r
-  CreateSharedPopUp (LargestString, NumberOfLines, &String);\r
+  CreateSharedPopUp (LargestString, NumberOfLines, MarkerBackup);\r
 \r
   //\r
   // Take the first key typed and report it back?\r
@@ -752,14 +749,14 @@ CreateDialog (
 \r
   @param RequestedWidth  The width of the pop-up.\r
   @param NumberOfLines   The number of lines.\r
-  @param ArrayOfStrings  The array of string to be printed.\r
+  @param Marker          The variable argument list for the list of string to be printed.\r
 \r
 **/\r
 VOID\r
 CreateSharedPopUp (\r
   IN  UINTN                       RequestedWidth,\r
   IN  UINTN                       NumberOfLines,\r
-  IN  CHAR16                      **ArrayOfStrings\r
+  IN  VA_LIST                     Marker\r
   )\r
 {\r
   UINTN   Index;\r
@@ -776,8 +773,6 @@ CreateSharedPopUp (
   DimensionsWidth   = gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn;\r
   DimensionsHeight  = gScreenDimensions.BottomRow - gScreenDimensions.TopRow;\r
 \r
-  Count = 0;\r
-\r
   gST->ConOut->SetAttribute (gST->ConOut, POPUP_TEXT | POPUP_BACKGROUND);\r
 \r
   if ((RequestedWidth + 2) > DimensionsWidth) {\r
@@ -804,9 +799,10 @@ CreateSharedPopUp (
   Character = BOXDRAW_DOWN_LEFT;\r
   PrintChar (Character);\r
   Character = BOXDRAW_VERTICAL;\r
-  for (Index = Top; Index + 2 < Bottom; Index++) {\r
-    String = ArrayOfStrings[Count];\r
-    Count++;\r
+\r
+  Count = 0;\r
+  for (Index = Top; Index + 2 < Bottom; Index++, Count++) {\r
+    String = VA_ARG (Marker, CHAR16*);\r
 \r
     //\r
     // This will clear the background of the line - we never know who might have been\r
@@ -858,7 +854,6 @@ CreateSharedPopUp (
 \r
   @param RequestedWidth  The width of the pop-up.\r
   @param NumberOfLines   The number of lines.\r
-  @param ArrayOfStrings  The array of string to be printed.\r
   @param ...             A series of text strings that displayed in the pop-up.\r
 \r
 **/\r
@@ -866,11 +861,16 @@ VOID
 CreatePopUp (\r
   IN  UINTN                       RequestedWidth,\r
   IN  UINTN                       NumberOfLines,\r
-  IN  CHAR16                      *ArrayOfStrings,\r
   ...\r
   )\r
 {\r
-  CreateSharedPopUp (RequestedWidth, NumberOfLines, &ArrayOfStrings);\r
+  VA_LIST Marker;\r
+\r
+  VA_START (Marker, NumberOfLines);\r
+  \r
+  CreateSharedPopUp (RequestedWidth, NumberOfLines, Marker);\r
+\r
+  VA_END (Marker);\r
 }\r
 \r
 \r
index 6e6b8975c17bcd2af65c4762e84c19df9f35262e..444961c9ddf2f59f78acecec71d05307a08188ff 100644 (file)
@@ -364,7 +364,6 @@ UiWaitForSingleEvent (
 \r
   @param RequestedWidth  The width of the pop-up.\r
   @param NumberOfLines   The number of lines.\r
-  @param ArrayOfStrings  The array of string to be printed.\r
   @param ...             A series of text strings that displayed in the pop-up.\r
 \r
 **/\r
@@ -372,7 +371,6 @@ VOID
 CreatePopUp (\r
   IN  UINTN                       ScreenWidth,\r
   IN  UINTN                       NumberOfLines,\r
-  IN  CHAR16                      *ArrayOfStrings,\r
   ...\r
   )\r
 ;\r