]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BasePrintLib/PrintLibInternal.c
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Library / BasePrintLib / PrintLibInternal.c
index 6f19b314496b4b190df386697d5e53fc5fda6080..0b4b496ed77d0528ef4c2e9184a501308e43a4c7 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Print Library internal worker functions.\r
 \r
-  Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2018, 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
@@ -83,7 +83,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 * CONST mStatusString[] = {
 \r
   @param  Buffer      The buffer to place the Unicode or ASCII string.\r
   @param  EndBuffer   The end of the input Buffer. No characters will be\r
-                      placed after that. \r
+                      placed after that.\r
   @param  Length      The count of character to be placed into Buffer.\r
                       (Negative value indicates no buffer fill.)\r
   @param  Character   The character to be placed into Buffer.\r
@@ -102,7 +102,7 @@ BasePrintLibFillBuffer (
   )\r
 {\r
   INTN  Index;\r
-  \r
+\r
   for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) {\r
     *Buffer = (CHAR8) Character;\r
     if (Increment != 1) {\r
@@ -128,8 +128,8 @@ BasePrintLibFillBuffer (
 **/\r
 CHAR8 *\r
 BasePrintLibValueToString (\r
-  IN OUT CHAR8  *Buffer, \r
-  IN INT64      Value, \r
+  IN OUT CHAR8  *Buffer,\r
+  IN INT64      Value,\r
   IN UINTN      Radix\r
   )\r
 {\r
@@ -152,23 +152,23 @@ BasePrintLibValueToString (
 \r
 /**\r
   Internal function that converts a decimal value to a Null-terminated string.\r
-  \r
-  Converts the decimal number specified by Value to a Null-terminated  \r
+\r
+  Converts the decimal number specified by Value to a Null-terminated\r
   string specified by Buffer containing at most Width characters.\r
   If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.\r
   The total number of characters placed in Buffer is returned.\r
   If the conversion contains more than Width characters, then only the first\r
-  Width characters are returned, and the total number of characters \r
+  Width characters are returned, and the total number of characters\r
   required to perform the conversion is returned.\r
-  Additional conversion parameters are specified in Flags.  \r
+  Additional conversion parameters are specified in Flags.\r
   The Flags bit LEFT_JUSTIFY is always ignored.\r
   All conversions are left justified in Buffer.\r
   If Width is 0, PREFIX_ZERO is ignored in Flags.\r
   If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas\r
   are inserted every 3rd digit starting from the right.\r
   If Value is < 0, then the fist character in Buffer is a '-'.\r
-  If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, \r
-  then Buffer is padded with '0' characters so the combination of the optional '-' \r
+  If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,\r
+  then Buffer is padded with '0' characters so the combination of the optional '-'\r
   sign character, '0' characters, digit characters for Value, and the Null-terminator\r
   add up to Width characters.\r
 \r
@@ -184,7 +184,7 @@ BasePrintLibValueToString (
   @param  Width     The maximum number of characters to place in Buffer, not including\r
                     the Null-terminator.\r
   @param  Increment The character increment in Buffer.\r
-  \r
+\r
   @return Total number of characters required to perform the conversion.\r
 \r
 **/\r
@@ -222,7 +222,7 @@ BasePrintLibConvertValueToString (
   ASSERT (((Flags & COMMA_TYPE) == 0) || ((Flags & RADIX_HEX) == 0));\r
 \r
   OriginalBuffer = Buffer;\r
-  \r
+\r
   //\r
   // Width is 0 or COMMA_TYPE is set, PREFIX_ZERO is ignored.\r
   //\r
@@ -239,7 +239,7 @@ BasePrintLibConvertValueToString (
   // Set the tag for the end of the input Buffer.\r
   //\r
   EndBuffer = Buffer + Width * Increment;\r
-  \r
+\r
   //\r
   // Convert decimal negative\r
   //\r
@@ -248,21 +248,21 @@ BasePrintLibConvertValueToString (
     Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, '-', Increment);\r
     Width--;\r
   }\r
-  \r
+\r
   //\r
   // Count the length of the value string.\r
   //\r
   Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;\r
   ValueBufferPtr = BasePrintLibValueToString (ValueBuffer, Value, Radix);\r
   Count = ValueBufferPtr - ValueBuffer;\r
-  \r
+\r
   //\r
   // Append Zero\r
   //\r
   if ((Flags & PREFIX_ZERO) != 0) {\r
     Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Count, '0', Increment);\r
   }\r
-  \r
+\r
   //\r
   // Print Comma type for every 3 characters\r
   //\r
@@ -282,7 +282,7 @@ BasePrintLibConvertValueToString (
       }\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Print Null-terminator\r
   //\r
@@ -496,21 +496,21 @@ BasePrintLibConvertValueToStringS (
 }\r
 \r
 /**\r
-  Worker function that produces a Null-terminated string in an output buffer \r
+  Worker function that produces a Null-terminated string in an output buffer\r
   based on a Null-terminated format string and a VA_LIST argument list.\r
 \r
-  VSPrint function to process format and place the results in Buffer. Since a \r
-  VA_LIST is used this routine allows the nesting of Vararg routines. Thus \r
+  VSPrint function to process format and place the results in Buffer. Since a\r
+  VA_LIST is used this routine allows the nesting of Vararg routines. Thus\r
   this is the main print working routine.\r
 \r
   If COUNT_ONLY_NO_PRINT is set in Flags, Buffer will not be modified at all.\r
 \r
-  @param[out] Buffer          The character buffer to print the results of the \r
+  @param[out] Buffer          The character buffer to print the results of the\r
                               parsing of Format into.\r
-  @param[in]  BufferSize      The maximum number of characters to put into \r
+  @param[in]  BufferSize      The maximum number of characters to put into\r
                               buffer.\r
   @param[in]  Flags           Initial flags value.\r
-                              Can only have FORMAT_UNICODE, OUTPUT_UNICODE, \r
+                              Can only have FORMAT_UNICODE, OUTPUT_UNICODE,\r
                               and COUNT_ONLY_NO_PRINT set.\r
   @param[in]  Format          A Null-terminated format string.\r
   @param[in]  VaListMarker    VA_LIST style variable argument list consumed by\r
@@ -566,7 +566,7 @@ BasePrintLibSPrintMarker (
 \r
   //\r
   // If you change this code be sure to match the 2 versions of this function.\r
-  // Nearly identical logic is found in the BasePrintLib and \r
+  // Nearly identical logic is found in the BasePrintLib and\r
   // DxePrintLibPrint2Protocol (both PrintLib instances).\r
   //\r
 \r
@@ -687,24 +687,24 @@ BasePrintLibSPrintMarker (
         Format += BytesPerFormatCharacter;\r
         FormatCharacter = ((*Format & 0xff) | ((BytesPerFormatCharacter == 1) ? 0 : (*(Format + 1) << 8))) & FormatMask;\r
         switch (FormatCharacter) {\r
-        case '.': \r
-          Flags |= PRECISION; \r
+        case '.':\r
+          Flags |= PRECISION;\r
           break;\r
-        case '-': \r
-          Flags |= LEFT_JUSTIFY; \r
+        case '-':\r
+          Flags |= LEFT_JUSTIFY;\r
           break;\r
-        case '+': \r
-          Flags |= PREFIX_SIGN;  \r
+        case '+':\r
+          Flags |= PREFIX_SIGN;\r
           break;\r
-        case ' ': \r
-          Flags |= PREFIX_BLANK; \r
+        case ' ':\r
+          Flags |= PREFIX_BLANK;\r
           break;\r
-        case ',': \r
-          Flags |= COMMA_TYPE; \r
+        case ',':\r
+          Flags |= COMMA_TYPE;\r
           break;\r
         case 'L':\r
-        case 'l': \r
-          Flags |= LONG_TYPE;    \r
+        case 'l':\r
+          Flags |= LONG_TYPE;\r
           break;\r
         case '*':\r
           if ((Flags & PRECISION) == 0) {\r
@@ -748,11 +748,11 @@ BasePrintLibSPrintMarker (
             Precision = Count;\r
           }\r
           break;\r
-       \r
+\r
         case '\0':\r
           //\r
           // Make no output if Format string terminates unexpectedly when\r
-          // looking up for flag, width, precision and type. \r
+          // looking up for flag, width, precision and type.\r
           //\r
           Format   -= BytesPerFormatCharacter;\r
           Precision = 0;\r
@@ -763,7 +763,7 @@ BasePrintLibSPrintMarker (
           Done = TRUE;\r
           break;\r
         }\r
-      } \r
+      }\r
 \r
       //\r
       // Handle each argument type\r
@@ -803,9 +803,9 @@ BasePrintLibSPrintMarker (
           //\r
           // 'd', 'u', 'x', and 'X' that are not preceded by 'l' or 'L' are assumed to be type "int".\r
           // This assumption is made so the format string definition is compatible with the ANSI C\r
-          // Specification for formatted strings.  It is recommended that the Base Types be used \r
-          // everywhere, but in this one case, compliance with ANSI C is more important, and \r
-          // provides an implementation that is compatible with that largest possible set of CPU \r
+          // Specification for formatted strings.  It is recommended that the Base Types be used\r
+          // everywhere, but in this one case, compliance with ANSI C is more important, and\r
+          // provides an implementation that is compatible with that largest possible set of CPU\r
           // architectures.  This is why the type "int" is used in this one case.\r
           //\r
           if (BaseListMarker == NULL) {\r
@@ -843,9 +843,9 @@ BasePrintLibSPrintMarker (
             //\r
             // 'd', 'u', 'x', and 'X' that are not preceded by 'l' or 'L' are assumed to be type "int".\r
             // This assumption is made so the format string definition is compatible with the ANSI C\r
-            // Specification for formatted strings.  It is recommended that the Base Types be used \r
-            // everywhere, but in this one case, compliance with ANSI C is more important, and \r
-            // provides an implementation that is compatible with that largest possible set of CPU \r
+            // Specification for formatted strings.  It is recommended that the Base Types be used\r
+            // everywhere, but in this one case, compliance with ANSI C is more important, and\r
+            // provides an implementation that is compatible with that largest possible set of CPU\r
             // architectures.  This is why the type "unsigned int" is used in this one case.\r
             //\r
             Value = (unsigned int)Value;\r
@@ -857,9 +857,9 @@ BasePrintLibSPrintMarker (
             //\r
             // 'd', 'u', 'x', and 'X' that are not preceded by 'l' or 'L' are assumed to be type "int".\r
             // This assumption is made so the format string definition is compatible with the ANSI C\r
-            // Specification for formatted strings.  It is recommended that the Base Types be used \r
-            // everywhere, but in this one case, compliance with ANSI C is more important, and \r
-            // provides an implementation that is compatible with that largest possible set of CPU \r
+            // Specification for formatted strings.  It is recommended that the Base Types be used\r
+            // everywhere, but in this one case, compliance with ANSI C is more important, and\r
+            // provides an implementation that is compatible with that largest possible set of CPU\r
             // architectures.  This is why the type "unsigned int" is used in this one case.\r
             //\r
             Value = (unsigned int)Value;\r
@@ -873,7 +873,7 @@ BasePrintLibSPrintMarker (
           Count = 0;\r
         }\r
         ArgumentString = (CHAR8 *)ValueBuffer + Count;\r
-        \r
+\r
         Digits = Count % 3;\r
         if (Digits != 0) {\r
           Digits = 3 - Digits;\r
@@ -946,7 +946,7 @@ BasePrintLibSPrintMarker (
           GuidData3 = ReadUnaligned16 (&(TmpGuid->Data3));\r
           BasePrintLibSPrint (\r
             ValueBuffer,\r
-            MAXIMUM_VALUE_CHARACTERS, \r
+            MAXIMUM_VALUE_CHARACTERS,\r
             0,\r
             "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",\r
             GuidData1,\r
@@ -967,9 +967,9 @@ BasePrintLibSPrintMarker (
 \r
       case 't':\r
         if (BaseListMarker == NULL) {\r
-          TmpTime = VA_ARG (VaListMarker, TIME *); \r
+          TmpTime = VA_ARG (VaListMarker, TIME *);\r
         } else {\r
-          TmpTime = BASE_ARG (BaseListMarker, TIME *); \r
+          TmpTime = BASE_ARG (BaseListMarker, TIME *);\r
         }\r
         if (TmpTime == NULL) {\r
           ArgumentString = "<null time>";\r
@@ -1054,7 +1054,7 @@ BasePrintLibSPrintMarker (
         break;\r
       }\r
       break;\r
\r
+\r
     case '\r':\r
       Format += BytesPerFormatCharacter;\r
       FormatCharacter = ((*Format & 0xff) | ((BytesPerFormatCharacter == 1) ? 0 : (*(Format + 1) << 8))) & FormatMask;\r
@@ -1230,11 +1230,11 @@ BasePrintLibSPrintMarker (
 }\r
 \r
 /**\r
-  Worker function that produces a Null-terminated string in an output buffer \r
+  Worker function that produces a Null-terminated string in an output buffer\r
   based on a Null-terminated format string and variable argument list.\r
 \r
-  VSPrint function to process format and place the results in Buffer. Since a \r
-  VA_LIST is used this routine allows the nesting of Vararg routines. Thus \r
+  VSPrint function to process format and place the results in Buffer. Since a\r
+  VA_LIST is used this routine allows the nesting of Vararg routines. Thus\r
   this is the main print working routine\r
 \r
   @param  StartOfBuffer The character buffer to print the results of the parsing\r