]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/Print.c
Add Missing invocations to VA_END() for VA_START().
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Print.c
index 7bbe6d49ca4ed31480949feb7e1ccc0f3dc09961..eeadf2494fb418bea03076e4452c08aa3e51b530 100644 (file)
@@ -15,8 +15,8 @@ type:
   '%' - Print a %\r
 \r
 \r
-Copyright (c) 2004 - 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -28,24 +28,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "Setup.h"\r
 \r
-/**\r
-  VSPrint worker function that prints a Value as a decimal number in Buffer.\r
-\r
-  @param  Buffer     Location to place ascii decimal number string of Value.\r
-  @param  Flags      Flags to use in printing decimal string, see file header for\r
-                     details.\r
-  @param  Value      Decimal value to convert to a string in Buffer.\r
-\r
-  @return Number of characters printed.\r
-\r
-**/\r
-UINTN\r
-ValueToString (\r
-  IN  OUT CHAR16  *Buffer,\r
-  IN  BOOLEAN     Flags,\r
-  IN  INT64       Value\r
-  );\r
-\r
 /**\r
   The internal function prints to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL\r
   protocol instance.\r
@@ -147,8 +129,8 @@ PrintInternal (
   Out->OutputString (Out, &BackupBuffer[PreviousIndex]);\r
   Count += StrLen (&BackupBuffer[PreviousIndex]);\r
 \r
-  gBS->FreePool (Buffer);\r
-  gBS->FreePool (BackupBuffer);\r
+  FreePool (Buffer);\r
+  FreePool (BackupBuffer);\r
   return Count;\r
 }\r
 \r
@@ -163,15 +145,19 @@ PrintInternal (
 \r
 **/\r
 UINTN\r
+EFIAPI\r
 ConsolePrint (\r
   IN CHAR16   *Fmt,\r
   ...\r
   )\r
 {\r
   VA_LIST Args;\r
+  UINTN   LengthOfPrinted;\r
 \r
   VA_START (Args, Fmt);\r
-  return PrintInternal ((UINTN) -1, (UINTN) -1, gST->ConOut, Fmt, Args);\r
+  LengthOfPrinted = PrintInternal ((UINTN) -1, (UINTN) -1, gST->ConOut, Fmt, Args);\r
+  VA_END (Args);\r
+  return LengthOfPrinted;\r
 }\r
 \r
 \r
@@ -224,6 +210,7 @@ PrintChar (
 \r
 **/\r
 UINTN\r
+EFIAPI\r
 PrintAt (\r
   IN UINTN     Column,\r
   IN UINTN     Row,\r
@@ -232,9 +219,12 @@ PrintAt (
   )\r
 {\r
   VA_LIST Args;\r
+  UINTN   LengthOfPrinted;\r
 \r
   VA_START (Args, Fmt);\r
-  return PrintInternal (Column, Row, gST->ConOut, Fmt, Args);\r
+  LengthOfPrinted = PrintInternal (Column, Row, gST->ConOut, Fmt, Args);\r
+  VA_END (Args);\r
+  return LengthOfPrinted;\r
 }\r
 \r
 \r
@@ -280,70 +270,3 @@ PrintCharAt (
 {\r
   return PrintAt (Column, Row, L"%c", Character);\r
 }\r
-\r
-\r
-/**\r
-  VSPrint worker function that prints a Value as a decimal number in Buffer.\r
-\r
-  @param  Buffer     Location to place ascii decimal number string of Value.\r
-  @param  Flags      Flags to use in printing decimal string, see file header for\r
-                     details.\r
-  @param  Value      Decimal value to convert to a string in Buffer.\r
-\r
-  @return Number of characters printed.\r
-\r
-**/\r
-UINTN\r
-ValueToString (\r
-  IN  OUT CHAR16  *Buffer,\r
-  IN  BOOLEAN     Flags,\r
-  IN  INT64       Value\r
-  )\r
-{\r
-  CHAR16  TempBuffer[30];\r
-  CHAR16  *TempStr;\r
-  CHAR16  *BufferPtr;\r
-  UINTN   Count;\r
-  UINTN   NumberCount;\r
-  UINT32  Remainder;\r
-  BOOLEAN Negative;\r
-\r
-  Negative    = FALSE;\r
-  TempStr     = TempBuffer;\r
-  BufferPtr   = Buffer;\r
-  Count       = 0;\r
-  NumberCount = 0;\r
-\r
-  if (Value < 0) {\r
-    Negative = TRUE;\r
-    Value    = -Value;\r
-  }\r
-\r
-  do {\r
-    Value         = (INT64) DivU64x32Remainder  ((UINT64) Value, 10, &Remainder);\r
-    *(TempStr++)  = (CHAR16) (Remainder + '0');\r
-    Count++;\r
-    NumberCount++;\r
-    if ((Flags & COMMA_TYPE) == COMMA_TYPE) {\r
-      if (NumberCount % 3 == 0 && Value != 0) {\r
-        *(TempStr++) = ',';\r
-        Count++;\r
-      }\r
-    }\r
-  } while (Value != 0);\r
-\r
-  if (Negative) {\r
-    *(BufferPtr++) = '-';\r
-    Count++;\r
-  }\r
-\r
-  //\r
-  // Reverse temp string into Buffer.\r
-  //\r
-  while (TempStr != TempBuffer) {\r
-    *(BufferPtr++) = *(--TempStr);\r
-  }\r
-\r
-  *BufferPtr = 0;\r
-  return Count;\r
-}\r