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 7b10dbf..5b037a4 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 e9fb50e..2a9e8c4 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 488b210..5e212cb 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"