]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/String.c
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Library / BaseLib / String.c
index 4151e0e7ac5866d992694c8e83fb78ffed3713dc..e7fe513aeca185d02dd6fcb2036fe1e34250dab6 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Unicode and ASCII string primitives.\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
@@ -73,7 +73,7 @@ StrCpy (
 /**\r
   [ATTENTION] This function will be deprecated for security reason.\r
 \r
-  Copies up to a specified length from one Null-terminated Unicode string  to \r
+  Copies up to a specified length from one Null-terminated Unicode string  to\r
   another Null-terminated Unicode string and returns the new Unicode string.\r
 \r
   This function copies the contents of the Unicode string Source to the Unicode\r
@@ -89,7 +89,7 @@ StrCpy (
   If Length > 0 and Source is NULL, then ASSERT().\r
   If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Length is greater than \r
+  If PcdMaximumUnicodeStringLength is not zero, and Length is greater than\r
   PcdMaximumUnicodeStringLength, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
   PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,\r
@@ -188,7 +188,7 @@ StrLen (
   Returns the size of a Null-terminated Unicode string in bytes, including the\r
   Null terminator.\r
 \r
-  This function returns the size, in bytes, of the Null-terminated Unicode string \r
+  This function returns the size, in bytes, of the Null-terminated Unicode string\r
   specified by String.\r
 \r
   If String is NULL, then ASSERT().\r
@@ -262,7 +262,7 @@ StrCmp (
 /**\r
   Compares up to a specified length the contents of two Null-terminated Unicode strings,\r
   and returns the difference between the first mismatched Unicode characters.\r
-  \r
+\r
   This function compares the Null-terminated Unicode string FirstString to the\r
   Null-terminated Unicode string SecondString. At most, Length Unicode\r
   characters will be compared. If Length is 0, then 0 is returned. If\r
@@ -382,8 +382,8 @@ StrCat (
 /**\r
   [ATTENTION] This function will be deprecated for security reason.\r
 \r
-  Concatenates up to a specified length one Null-terminated Unicode to the end \r
-  of another Null-terminated Unicode string, and returns the concatenated \r
+  Concatenates up to a specified length one Null-terminated Unicode to the end\r
+  of another Null-terminated Unicode string, and returns the concatenated\r
   Unicode string.\r
 \r
   This function concatenates two Null-terminated Unicode strings. The contents\r
@@ -399,7 +399,7 @@ StrCat (
   If Length > 0 and Source is NULL, then ASSERT().\r
   If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Length is greater than \r
+  If PcdMaximumUnicodeStringLength is not zero, and Length is greater than\r
   PcdMaximumUnicodeStringLength, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and Destination contains more\r
   than PcdMaximumUnicodeStringLength Unicode characters, not including the\r
@@ -492,13 +492,13 @@ StrStr (
   while (*String != L'\0') {\r
     SearchStringTmp = SearchString;\r
     FirstMatch = String;\r
-    \r
-    while ((*String == *SearchStringTmp) \r
+\r
+    while ((*String == *SearchStringTmp)\r
             && (*String != L'\0')) {\r
       String++;\r
       SearchStringTmp++;\r
-    } \r
-    \r
+    }\r
+\r
     if (*SearchStringTmp == L'\0') {\r
       return (CHAR16 *) FirstMatch;\r
     }\r
@@ -516,7 +516,7 @@ StrStr (
 /**\r
   Check if a Unicode character is a decimal character.\r
 \r
-  This internal function checks if a Unicode character is a \r
+  This internal function checks if a Unicode character is a\r
   decimal character. The valid decimal character is from\r
   L'0' to L'9'.\r
 \r
@@ -536,7 +536,7 @@ InternalIsDecimalDigitCharacter (
 }\r
 \r
 /**\r
-  Convert a Unicode character to upper case only if \r
+  Convert a Unicode character to upper case only if\r
   it maps to a valid small-case ASCII character.\r
 \r
   This internal function only deal with Unicode character\r
@@ -568,7 +568,7 @@ InternalCharToUpper (
 \r
   This internal function only deal with Unicode character\r
   which maps to a valid hexadecimal ASII character, i.e.\r
-  L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other \r
+  L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other\r
   Unicode character, the value returned does not make sense.\r
 \r
   @param  Char  The character to convert.\r
@@ -592,8 +592,8 @@ InternalHexCharToUintn (
 /**\r
   Check if a Unicode character is a hexadecimal character.\r
 \r
-  This internal function checks if a Unicode character is a \r
-  decimal character.  The valid hexadecimal character is \r
+  This internal function checks if a Unicode character is a\r
+  decimal character.  The valid hexadecimal character is\r
   L'0' to L'9', L'a' to L'f', or L'A' to L'F'.\r
 \r
 \r
@@ -703,7 +703,7 @@ StrDecimalToUint64 (
   )\r
 {\r
   UINT64     Result;\r
-  \r
+\r
   StrDecimalToUint64S (String, (CHAR16 **) NULL, &Result);\r
   return Result;\r
 }\r
@@ -806,7 +806,7 @@ StrHexToUint64 (
 /**\r
   Check if a ASCII character is a decimal character.\r
 \r
-  This internal function checks if a Unicode character is a \r
+  This internal function checks if a Unicode character is a\r
   decimal character. The valid decimal character is from\r
   '0' to '9'.\r
 \r
@@ -828,8 +828,8 @@ InternalAsciiIsDecimalDigitCharacter (
 /**\r
   Check if a ASCII character is a hexadecimal character.\r
 \r
-  This internal function checks if a ASCII character is a \r
-  decimal character.  The valid hexadecimal character is \r
+  This internal function checks if a ASCII character is a\r
+  decimal character.  The valid hexadecimal character is\r
   L'0' to L'9', L'a' to L'f', or L'A' to L'F'.\r
 \r
 \r
@@ -915,7 +915,7 @@ UnicodeStrToAsciiStr (
   ReturnValue = Destination;\r
   while (*Source != '\0') {\r
     //\r
-    // If any Unicode characters in Source contain \r
+    // If any Unicode characters in Source contain\r
     // non-zero value in the upper 8 bits, then ASSERT().\r
     //\r
     ASSERT (*Source < 0x100);\r
@@ -987,7 +987,7 @@ AsciiStrCpy (
 /**\r
   [ATTENTION] This function will be deprecated for security reason.\r
 \r
-  Copies up to a specified length one Null-terminated ASCII string to another \r
+  Copies up to a specified length one Null-terminated ASCII string to another\r
   Null-terminated ASCII string and returns the new ASCII string.\r
 \r
   This function copies the contents of the ASCII string Source to the ASCII\r
@@ -1000,7 +1000,7 @@ AsciiStrCpy (
   If Destination is NULL, then ASSERT().\r
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and Length is greater than \r
+  If PcdMaximumAsciiStringLength is not zero, and Length is greater than\r
   PcdMaximumAsciiStringLength, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero, and Source contains more than\r
   PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,\r
@@ -1176,7 +1176,7 @@ AsciiStrCmp (
 \r
   @param  Chr   one Ascii character\r
 \r
-  @return The uppercase value of Ascii character \r
+  @return The uppercase value of Ascii character\r
 \r
 **/\r
 CHAR8\r
@@ -1193,7 +1193,7 @@ InternalBaseLibAsciiToUpper (
 \r
   This internal function only deal with Unicode character\r
   which maps to a valid hexadecimal ASII character, i.e.\r
-  '0' to '9', 'a' to 'f' or 'A' to 'F'. For other \r
+  '0' to '9', 'a' to 'f' or 'A' to 'F'. For other\r
   ASCII character, the value returned does not make sense.\r
 \r
   @param  Char  The character to convert.\r
@@ -1285,7 +1285,7 @@ AsciiStriCmp (
 \r
   If Length > 0 and FirstString is NULL, then ASSERT().\r
   If Length > 0 and SecondString is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and Length is greater than \r
+  If PcdMaximumAsciiStringLength is not zero, and Length is greater than\r
   PcdMaximumAsciiStringLength, then ASSERT().\r
   If PcdMaximumAsciiStringLength is not zero, and FirstString contains more than\r
   PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,\r
@@ -1297,7 +1297,7 @@ AsciiStriCmp (
   @param  FirstString   A pointer to a Null-terminated ASCII string.\r
   @param  SecondString  A pointer to a Null-terminated ASCII string.\r
   @param  Length        The maximum number of ASCII characters for compare.\r
-  \r
+\r
   @retval ==0       FirstString is identical to SecondString.\r
   @retval !=0       FirstString is not identical to SecondString.\r
 \r
@@ -1386,8 +1386,8 @@ AsciiStrCat (
 /**\r
   [ATTENTION] This function will be deprecated for security reason.\r
 \r
-  Concatenates up to a specified length one Null-terminated ASCII string to \r
-  the end of another Null-terminated ASCII string, and returns the \r
+  Concatenates up to a specified length one Null-terminated ASCII string to\r
+  the end of another Null-terminated ASCII string, and returns the\r
   concatenated ASCII string.\r
 \r
   This function concatenates two Null-terminated ASCII strings. The contents\r
@@ -1491,13 +1491,13 @@ AsciiStrStr (
   while (*String != '\0') {\r
     SearchStringTmp = SearchString;\r
     FirstMatch = String;\r
-    \r
-    while ((*String == *SearchStringTmp) \r
+\r
+    while ((*String == *SearchStringTmp)\r
             && (*String != '\0')) {\r
       String++;\r
       SearchStringTmp++;\r
-    } \r
-    \r
+    }\r
+\r
     if (*SearchStringTmp == '\0') {\r
       return (CHAR8 *) FirstMatch;\r
     }\r
@@ -1549,7 +1549,7 @@ AsciiStrDecimalToUintn (
   )\r
 {\r
   UINTN     Result;\r
-  \r
+\r
   AsciiStrDecimalToUintnS (String, (CHAR8 **) NULL, &Result);\r
   return Result;\r
 }\r
@@ -1592,7 +1592,7 @@ AsciiStrDecimalToUint64 (
   )\r
 {\r
   UINT64     Result;\r
-  \r
+\r
   AsciiStrDecimalToUint64S (String, (CHAR8 **) NULL, &Result);\r
   return Result;\r
 }\r