Mercurial > hg > octave-lyh > gnulib-hg
changeset 13408:409615e3437a
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.
author | Jim Meyering <meyering@redhat.com> |
---|---|
date | Fri, 11 Jun 2010 09:27:19 +0200 |
parents | 97b8c45f787e |
children | 7f4981d27433 |
files | ChangeLog tests/test-mbsstr1.c tests/test-mbsstr2.c |
diffstat | 3 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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.
--- a/tests/test-mbsstr1.c +++ b/tests/test-mbsstr1.c @@ -58,7 +58,7 @@ { 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 @@ { size_t repeat = 10000; size_t m = 1000000; - char *haystack = + const char *haystack = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB"; char *needle = (char *) malloc (m + 1);
--- a/tests/test-mbsstr2.c +++ b/tests/test-mbsstr2.c @@ -67,7 +67,7 @@ { 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 @@ { 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"