+2010-06-11 Bruno Haible <bruno@clisp.org>
+
+ Avoid some more warnings from "gcc -Wwrite-strings".
+ * tests/test-argp.c (test_optional): Change 5th and 6th argument type
+ to 'const char *'.
+ * tests/test-c-strstr.c (main): Add 'const' to variable declaration.
+ * tests/test-c-strcasestr.c (main): Likewise.
+ * tests/test-mbscasestr1.c (main): Likewise.
+ * tests/test-mbscasestr2.c (main): Likewise.
+ * tests/test-memmem.c (main): Likewise.
+ * tests/test-strstr.c (main): Likewise.
+ * tests/test-strcasestr.c (main): Likewise.
+
2010-06-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
init.sh: change framework_failure_ to fail with status 99, not 1
void
test_optional (struct argp *argp, int argc, char **argv,
- struct test_args *args, char *val, char *a)
+ struct test_args *args, const char *val, const char *a)
{
int index;
if (argp_parse (argp, argc, argv, 0, &index, args))
{
size_t repeat = 10000;
size_t m = 1000000;
- char *needle =
+ const char *needle =
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaAaaaaaaAAAAaaaaaaa"
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
{
size_t repeat = 10000;
size_t m = 1000000;
- char *haystack =
+ const char *haystack =
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB";
char *needle = (char *) malloc (m + 1);
{
size_t repeat = 10000;
size_t m = 1000000;
- char *needle =
+ const char *needle =
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
char *haystack = (char *) malloc (m + 1);
{
size_t repeat = 10000;
size_t m = 1000000;
- char *haystack =
+ const char *haystack =
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB";
char *needle = (char *) malloc (m + 1);
{
size_t repeat = 10000;
size_t m = 1000000;
- char *needle =
+ const char *needle =
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaAaaaaaaAAAAaaaaaaa"
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
{
size_t repeat = 10000;
size_t m = 1000000;
- char *haystack =
+ const char *haystack =
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB";
char *needle = (char *) malloc (m + 1);
{
size_t repeat = 10000;
size_t m = 1000000;
- char *needle =
+ const char *needle =
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
char *haystack = (char *) malloc (m + 1);
{
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"
{
size_t repeat = 10000;
size_t m = 1000000;
- char *needle =
+ const char *needle =
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
size_t n = strlen (needle);
{
size_t repeat = 10000;
size_t m = 1000000;
- char *haystack =
+ const char *haystack =
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB";
size_t n = strlen (haystack);
/* Test of case-insensitive searching in a string.
- Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007-2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
{
size_t repeat = 10000;
size_t m = 1000000;
- char *needle =
+ const char *needle =
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaAaaaaaaAAAAaaaaaaa"
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
{
size_t repeat = 10000;
size_t m = 1000000;
- char *haystack =
+ const char *haystack =
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB";
char *needle = (char *) malloc (m + 1);
/*
- * Copyright (C) 2004, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ * Copyright (C) 2004, 2007-2010 Free Software Foundation, Inc.
* Written by Bruno Haible and Eric Blake
*
* This program is free software: you can redistribute it and/or modify
{
size_t repeat = 10000;
size_t m = 1000000;
- char *needle =
+ const char *needle =
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
char *haystack = (char *) malloc (m + 1);
{
size_t repeat = 10000;
size_t m = 1000000;
- char *haystack =
+ const char *haystack =
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB";
char *needle = (char *) malloc (m + 1);