]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/TianoTools/String/String.c
1. Removed the unnecessary #include statements and include files
[mirror_edk2.git] / Tools / Source / TianoTools / String / String.c
index 10051806ad59e80e38b045a5218f69d74b7f63e8..0e4993a4be429a310a705c913d0e14ee78cff505 100644 (file)
 **/\r
 \r
 #include <assert.h>\r
-#include <Base.h>\r
-#include <UefiBaseTypes.h>\r
-#include <BaseLib.h>\r
-#include <PcdLib.h>\r
-#include <CommonLib.h>\r
-#define _gPcd_FixedAtBuild_PcdMaximumUnicodeStringLength   0\r
-#define _gPcd_FixedAtBuild_PcdMaximumAsciiStringLength   0\r
+\r
+#include <Common/UefiBaseTypes.h>\r
+\r
+#include "CommonLib.h"\r
 \r
 /**\r
   Copies one Null-terminated Unicode string to another Null-terminated Unicode\r
@@ -34,8 +31,6 @@
   If Destination is NULL, then ASSERT().\r
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
 \r
   @param  Destination Pointer to a Null-terminated Unicode string.\r
   @param  Source      Pointer to a Null-terminated Unicode string.\r
@@ -87,8 +82,6 @@ StrCpy (
   If Destination is NULL, then ASSERT().\r
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
 \r
   @param  Destination Pointer to a Null-terminated Unicode string.\r
   @param  Source      Pointer to a Null-terminated Unicode string.\r
@@ -130,7 +123,6 @@ StrnCpy (
     Length--;\r
   }\r
 \r
-  // ZeroMem (Destination, Length * sizeof (*Destination));\r
   memset (Destination, 0, Length * sizeof (*Destination));\r
   return ReturnValue;\r
 }\r
@@ -142,8 +134,6 @@ StrnCpy (
   Unicode string specified by String.\r
 \r
   If String is NULL, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
 \r
   @param  String  Pointer to a Null-terminated Unicode string.\r
 \r
@@ -161,13 +151,7 @@ StrLen (
   ASSERT (String != NULL);\r
 \r
   for (Length = 0; *String != L'\0'; String++, Length++) {\r
-    //\r
-    // If PcdMaximumUnicodeStringLength is not zero,\r
-    // length should not more than PcdMaximumUnicodeStringLength\r
-    //\r
-    if (FixedPcdGet32 (PcdMaximumUnicodeStringLength) != 0) {\r
-      ASSERT (Length < FixedPcdGet32 (PcdMaximumUnicodeStringLength));\r
-    }\r
+    ;\r
   }\r
   return Length;\r
 }\r
@@ -180,8 +164,6 @@ StrLen (
   string specified by String.\r
 \r
   If String is NULL, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
 \r
   @param  String  Pointer to a Null-terminated Unicode string.\r
 \r
@@ -209,10 +191,6 @@ StrSize (
 \r
   If FirstString is NULL, then ASSERT().\r
   If SecondString is NULL, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more\r
-  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more\r
-  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
 \r
   @param  FirstString   Pointer to a Null-terminated Unicode string.\r
   @param  SecondString  Pointer to a Null-terminated Unicode string.\r
@@ -229,7 +207,7 @@ StrCmp (
   )\r
 {\r
   //\r
-  // ASSERT both strings are less long than PcdMaximumUnicodeStringLength\r
+  // ASSERT both strings should never be zero\r
   //\r
   ASSERT (StrSize (FirstString) != 0);\r
   ASSERT (StrSize (SecondString) != 0);\r
@@ -254,10 +232,6 @@ StrCmp (
 \r
   If FirstString is NULL, then ASSERT().\r
   If SecondString is NULL, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more\r
-  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more\r
-  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
 \r
   @param  FirstString   Pointer to a Null-terminated Unicode string.\r
   @param  SecondString  Pointer to a Null-terminated Unicode string.\r
@@ -280,8 +254,7 @@ StrnCmp (
   }\r
 \r
   //\r
-  // ASSERT both strings are less long than PcdMaximumUnicodeStringLength.\r
-  // Length tests are performed inside StrLen().\r
+  // ASSERT both strings should never be zero\r
   //\r
   ASSERT (StrSize (FirstString) != 0);\r
   ASSERT (StrSize (SecondString) != 0);\r
@@ -310,13 +283,6 @@ StrnCmp (
   If Destination is NULL, then ASSERT().\r
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Destination contains more\r
-  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination\r
-  and Source results in a Unicode string with more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
 \r
   @param  Destination Pointer to a Null-terminated Unicode string.\r
   @param  Source      Pointer to a Null-terminated Unicode string.\r
@@ -335,7 +301,6 @@ StrCat (
 \r
   //\r
   // Size of the resulting string should never be zero.\r
-  // PcdMaximumUnicodeStringLength is tested inside StrLen().\r
   //\r
   ASSERT (StrSize (Destination) != 0);\r
   return Destination;\r
@@ -357,13 +322,6 @@ StrCat (
   If Destination is NULL, then ASSERT().\r
   If Source is NULL, then ASSERT().\r
   If Source and Destination overlap, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Destination contains more\r
-  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination\r
-  and Source results in a Unicode string with more than\r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
 \r
   @param  Destination Pointer to a Null-terminated Unicode string.\r
   @param  Source      Pointer to a Null-terminated Unicode string.\r
@@ -385,7 +343,6 @@ StrnCat (
 \r
   //\r
   // Size of the resulting string should never be zero.\r
-  // PcdMaximumUnicodeStringLength is tested inside StrLen().\r
   //\r
   ASSERT (StrSize (Destination) != 0);\r
   return Destination;\r
@@ -402,8 +359,6 @@ StrnCat (
   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 Source contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
 \r
   @param  Destination Pointer to a Null-terminated ASCII string.\r
   @param  Source      Pointer to a Null-terminated ASCII string.\r
@@ -454,8 +409,6 @@ 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 Source contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
 \r
   @param  Destination Pointer to a Null-terminated ASCII string.\r
   @param  Source      Pointer to a Null-terminated ASCII string.\r
@@ -508,8 +461,6 @@ AsciiStrnCpy (
   ASCII string specified by String.\r
 \r
   If String is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and String contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
 \r
   @param  String  Pointer to a Null-terminated ASCII string.\r
 \r
@@ -527,13 +478,7 @@ AsciiStrLen (
   ASSERT (String != NULL);\r
 \r
   for (Length = 0; *String != '\0'; String++, Length++) {\r
-    //\r
-    // If PcdMaximumUnicodeStringLength is not zero,\r
-    // length should not more than PcdMaximumUnicodeStringLength\r
-    //\r
-    if (FixedPcdGet32 (PcdMaximumAsciiStringLength) != 0) {\r
-      ASSERT (Length < FixedPcdGet32 (PcdMaximumAsciiStringLength));\r
-    }\r
+    ;\r
   }\r
   return Length;\r
 }\r
@@ -546,8 +491,6 @@ AsciiStrLen (
   specified by String.\r
 \r
   If String is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and String contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
 \r
   @param  String  Pointer to a Null-terminated ASCII string.\r
 \r
@@ -575,10 +518,6 @@ AsciiStrSize (
 \r
   If FirstString is NULL, then ASSERT().\r
   If SecondString is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and FirstString contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and SecondString contains more\r
-  than PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
 \r
   @param  FirstString   Pointer to a Null-terminated ASCII string.\r
   @param  SecondString  Pointer to a Null-terminated ASCII string.\r
@@ -595,7 +534,7 @@ AsciiStrCmp (
   )\r
 {\r
   //\r
-  // ASSERT both strings are less long than PcdMaximumAsciiStringLength\r
+  // ASSERT both strings should never be zero\r
   //\r
   ASSERT (AsciiStrSize (FirstString));\r
   ASSERT (AsciiStrSize (SecondString));\r
@@ -631,10 +570,6 @@ AsciiToUpper (
 \r
   If FirstString is NULL, then ASSERT().\r
   If SecondString is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and FirstString contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and SecondString contains more\r
-  than PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
 \r
   @param  FirstString   Pointer to a Null-terminated ASCII string.\r
   @param  SecondString  Pointer to a Null-terminated ASCII string.\r
@@ -653,7 +588,7 @@ AsciiStriCmp (
   )\r
 {\r
   //\r
-  // ASSERT both strings are less long than PcdMaximumAsciiStringLength\r
+  // ASSERT both strings should never be zero\r
   //\r
   ASSERT (AsciiStrSize (FirstString));\r
   ASSERT (AsciiStrSize (SecondString));\r
@@ -680,10 +615,6 @@ AsciiStriCmp (
 \r
   If FirstString is NULL, then ASSERT().\r
   If SecondString is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and FirstString contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and SecondString contains more\r
-  than PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
 \r
   @param  FirstString   Pointer to a Null-terminated ASCII string.\r
   @param  SecondString  Pointer to a Null-terminated ASCII string.\r
@@ -701,7 +632,7 @@ AsciiStrnCmp (
   )\r
 {\r
   //\r
-  // ASSERT both strings are less long than PcdMaximumAsciiStringLength\r
+  // ASSERT both strings should never be zero\r
   //\r
   ASSERT (AsciiStrSize (FirstString));\r
   ASSERT (AsciiStrSize (SecondString));\r
@@ -727,13 +658,6 @@ AsciiStrnCmp (
 \r
   If Destination is NULL, then ASSERT().\r
   If Source is NULL, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and Destination contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and Source contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero and concatenating Destination and\r
-  Source results in a ASCII string with more than PcdMaximumAsciiStringLength\r
-  ASCII characters, then ASSERT().\r
 \r
   @param  Destination Pointer to a Null-terminated ASCII string.\r
   @param  Source      Pointer to a Null-terminated ASCII string.\r
@@ -752,7 +676,6 @@ AsciiStrCat (
 \r
   //\r
   // Size of the resulting string should never be zero.\r
-  // PcdMaximumUnicodeStringLength is tested inside StrLen().\r
   //\r
   ASSERT (AsciiStrSize (Destination) != 0);\r
   return Destination;\r
@@ -774,13 +697,6 @@ AsciiStrCat (
   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 Destination contains more\r
-  than PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and Source contains more than\r
-  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
-  If PcdMaximumAsciiStringLength is not zero, and concatenating Destination and\r
-  Source results in a ASCII string with more than PcdMaximumAsciiStringLength\r
-  ASCII characters, then ASSERT().\r
 \r
   @param  Destination Pointer to a Null-terminated ASCII string.\r
   @param  Source      Pointer to a Null-terminated ASCII string.\r
@@ -802,7 +718,6 @@ AsciiStrnCat (
 \r
   //\r
   // Size of the resulting string should never be zero.\r
-  // PcdMaximumUnicodeStringLength is tested inside StrLen().\r
   //\r
   ASSERT (AsciiStrSize (Destination) != 0);\r
   return Destination;\r