]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/Print.c
Fix AutoUpdateLangVariable() logic to handle the case PlatformLang/Lang is set before...
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Print.c
index d8b42f8973713caf87913917db8ef317fd51dc65..941d0958f99e062c0461b1a5c7bfd38ea4e1ff8d 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 - 2007, 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,9 +145,10 @@ PrintInternal (
 \r
 **/\r
 UINTN\r
+EFIAPI\r
 ConsolePrint (\r
   IN CHAR16   *Fmt,\r
-  IN ...\r
+  ...\r
   )\r
 {\r
   VA_LIST Args;\r
@@ -224,6 +207,7 @@ PrintChar (
 \r
 **/\r
 UINTN\r
+EFIAPI\r
 PrintAt (\r
   IN UINTN     Column,\r
   IN UINTN     Row,\r
@@ -253,7 +237,7 @@ UINTN
 PrintStringAt (\r
   IN UINTN     Column,\r
   IN UINTN     Row,\r
-  CHAR16       *String\r
+  IN CHAR16    *String\r
   )\r
 {\r
   return PrintAt (Column, Row, L"%s", String);\r
@@ -280,70 +264,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