tests: avoid 'const' discard warnings in mbsstr tests
authorJim Meyering <meyering@redhat.com>
Fri, 11 Jun 2010 07:27:19 +0000 (09:27 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 11 Jun 2010 07:28:09 +0000 (09:28 +0200)
* tests/test-mbsstr1.c (main): Add "const" to avoid trivial warning.
* tests/test-mbsstr2.c (main): Likewise.

ChangeLog
tests/test-mbsstr1.c
tests/test-mbsstr2.c

index 7b10dbf0cb290e15861c3da22af847f97d5dbe9b..5b037a4ccdc1f91c004cdb9d9ad2d8439f547310 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-06-11  Jim Meyering  <meyering@redhat.com>
 
+       tests: avoid 'const' discard warnings in mbsstr tests
+       * tests/test-mbsstr1.c (main): Add "const" to avoid trivial warning.
+       * tests/test-mbsstr2.c (main): Likewise.
+
        test-verify: avoid warning from gcc's -Wmissing-declarations
        * tests/test-verify.c (function): Declare to be static.
 
index e9fb50eadfbab5cf6672a2910897e48e2306d588..2a9e8c4d589f50224f3342f743f6145171b07550 100644 (file)
@@ -58,7 +58,7 @@ main ()
   {
     size_t repeat = 10000;
     size_t m = 1000000;
-    char *needle =
+    const char *needle =
       "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
       "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
     char *haystack = (char *) malloc (m + 1);
@@ -82,7 +82,7 @@ main ()
   {
     size_t repeat = 10000;
     size_t m = 1000000;
-    char *haystack =
+    const char *haystack =
       "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
       "ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB";
     char *needle = (char *) malloc (m + 1);
index 488b21084b0f86c0c8f0d25e29622857f548b142..5e212cb6cda1a5878ab3762488f2b907866de325 100644 (file)
@@ -67,7 +67,7 @@ main ()
   {
     size_t repeat = 10000;
     size_t m = 1000000;
-    char *needle =
+    const char *needle =
       "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
       "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
     char *haystack = (char *) malloc (m + 1);
@@ -91,7 +91,7 @@ main ()
   {
     size_t repeat = 10000;
     size_t m = 1000000;
-    char *haystack =
+    const char *haystack =
       "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
       "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207"
       "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207"