diff options
author | Roland McGrath <roland@gnu.org> | 2005-12-27 22:50:12 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2005-12-27 22:50:12 +0000 |
commit | 0317eaecb1f1a0667a18412b2209f0ae70f94420 (patch) | |
tree | bc201bb0f8243a9338befa69b7daf7c990ef82d5 /string | |
parent | 89c47e9c50290dd946ec4ac94baf81ae3d5da493 (diff) | |
download | glibc-0317eaecb1f1a0667a18412b2209f0ae70f94420.tar.gz |
* posix/tst-execle1.c (do_test): Add a const.
* posix/tst-execle2.c (do_test): Likewise.
* posix/transbug.c (run_test): Add some casts.
* posix/bug-regex22.c (main): Likewise.
* posix/bug-regex5.c (main): Likewise.
* wcsmbs/tst-mbsrtowcs.c (main): Likewise.
* string/test-strspn.c (do_test, do_random_tests): Likewise.
* string/test-strrchr.c (do_test, do_random_tests): Likewise.
* string/test-strlen.c (do_random_tests): Likewise.
* string/test-strpbrk.c (do_test, do_random_tests): Likewise.
* string/test-strcmp.c (do_random_tests): Likewise.
* string/test-strchr.c (do_test, do_random_tests): Likewise.
* string/test-strcat.c (do_test, do_random_tests): Likewise.
* string/test-strncpy.c (do_random_tests): Likewise.
* string/test-strcpy.c (do_test, do_random_tests): Likewise.
* string/test-memccpy.c (do_test): Likewise.
* string/test-memmove.c (do_test, do_random_tests): Likewise.
* string/test-memcpy.c (do_test, do_random_tests): Likewise.
* string/test-memcmp.c (do_test, do_random_tests): Likewise.
* string/test-memchr.c (do_test, do_random_tests): Likewise.
* dlfcn/bug-atexit1.c (do_test): Fix up prototype in cast.
* stdio-common/tst-fgets.c (do_test): Add a cast.
* iconvdata/bug-iconv4.c (xiconv): Add a cast.
* locale/programs/simple-hash.c (insert_entry_2): Remove useless casts.
* resolv/herror.c (herror): Remove unused extern decl.
* libio/obprintf.c: Include "strfile.h".
* elf/order2mod2.c (init): Cast ignored value to void.
* stdio-common/tstdiomisc.c: If FLT_EVAL_METHOD is 2, use long
Diffstat (limited to 'string')
-rw-r--r-- | string/test-memccpy.c | 6 | ||||
-rw-r--r-- | string/test-memchr.c | 13 | ||||
-rw-r--r-- | string/test-memcmp.c | 8 | ||||
-rw-r--r-- | string/test-memcpy.c | 10 | ||||
-rw-r--r-- | string/test-memmove.c | 10 | ||||
-rw-r--r-- | string/test-strcat.c | 9 | ||||
-rw-r--r-- | string/test-strchr.c | 14 | ||||
-rw-r--r-- | string/test-strcmp.c | 8 | ||||
-rw-r--r-- | string/test-strcpy.c | 9 | ||||
-rw-r--r-- | string/test-strlen.c | 9 | ||||
-rw-r--r-- | string/test-strncpy.c | 10 | ||||
-rw-r--r-- | string/test-strpbrk.c | 19 | ||||
-rw-r--r-- | string/test-strrchr.c | 16 | ||||
-rw-r--r-- | string/test-strspn.c | 14 |
14 files changed, 84 insertions, 71 deletions
diff --git a/string/test-memccpy.c b/string/test-memccpy.c index b581408f37..26532633df 100644 --- a/string/test-memccpy.c +++ b/string/test-memccpy.c @@ -1,5 +1,5 @@ /* Test and measure memccpy functions. - Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek <jakub@redhat.com>, 1999. @@ -109,8 +109,8 @@ do_test (size_t align1, size_t align2, int c, size_t len, size_t n, if (align2 + len >= page_size) return; - s1 = buf1 + align1; - s2 = buf2 + align2; + s1 = (char *) (buf1 + align1); + s2 = (char *) (buf2 + align2); for (i = 0; i < len - 1; ++i) { diff --git a/string/test-memchr.c b/string/test-memchr.c index df866fe2d7..c233ead5dd 100644 --- a/string/test-memchr.c +++ b/string/test-memchr.c @@ -1,5 +1,5 @@ /* Test and measure memchr functions. - Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek <jakub@redhat.com>, 1999. @@ -89,7 +89,7 @@ do_test (size_t align, size_t pos, size_t len, int seek_char) { buf1[align + pos] = seek_char; buf1[align + len] = -seek_char; - result = buf1 + align + pos; + result = (char *) (buf1 + align + pos); } else { @@ -101,7 +101,7 @@ do_test (size_t align, size_t pos, size_t len, int seek_char) printf ("Length %4zd, alignment %2zd:", pos, align); FOR_EACH_IMPL (impl, 0) - do_one_test (impl, buf1 + align, seek_char, len, result); + do_one_test (impl, (char *) (buf1 + align), seek_char, len, result); if (HP_TIMING_AVAIL) putchar ('\n'); @@ -144,16 +144,17 @@ do_random_tests (void) } if (pos < len) - result = p + pos + align; + result = (char *) (p + pos + align); else result = NULL; FOR_EACH_IMPL (impl, 1) - if (CALL (impl, p + align, seek_char, len) != result) + if (CALL (impl, (char *) (p + align), seek_char, len) != result) { error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %d, %zd, %zd) %p != %p, p %p", n, impl->name, align, seek_char, len, pos, - CALL (impl, p + align, seek_char, len), result, p); + CALL (impl, (char *) (p + align), seek_char, len), + result, p); ret = 1; } } diff --git a/string/test-memcmp.c b/string/test-memcmp.c index 89c104386b..af07a5e599 100644 --- a/string/test-memcmp.c +++ b/string/test-memcmp.c @@ -1,5 +1,5 @@ /* Test and measure memcmp functions. - Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek <jakub@redhat.com>, 1999. @@ -88,8 +88,8 @@ do_test (size_t align1, size_t align2, size_t len, int exp_result) if (align2 + len >= page_size) return; - s1 = buf1 + align1; - s2 = buf2 + align2; + s1 = (char *) (buf1 + align1); + s2 = (char *) (buf2 + align2); for (i = 0; i < len; i++) s1[i] = s2[i] = 1 + 23 * i % 255; @@ -161,7 +161,7 @@ do_random_tests (void) FOR_EACH_IMPL (impl, 1) { - r = CALL (impl, p1 + align1, p2 + align2, len); + r = CALL (impl, (char *) (p1 + align1), (char *) (p2 + align2), len); /* Test whether on 64-bit architectures where ABI requires callee to promote has the promotion been done. */ asm ("" : "=g" (r) : "0" (r)); diff --git a/string/test-memcpy.c b/string/test-memcpy.c index adc90da767..7b0723a65a 100644 --- a/string/test-memcpy.c +++ b/string/test-memcpy.c @@ -1,5 +1,5 @@ /* Test and measure memcpy functions. - Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek <jakub@redhat.com>, 1999. @@ -102,8 +102,8 @@ do_test (size_t align1, size_t align2, size_t len) if (align2 + len >= page_size) return; - s1 = buf1 + align1; - s2 = buf2 + align2; + s1 = (char *) (buf1 + align1); + s2 = (char *) (buf2 + align2); for (i = 0, j = 1; i < len; i++, j += 23) s1[i] = j; @@ -190,7 +190,9 @@ do_random_tests (void) if (j > size2) j = size2; memset (p2, c, j); - res = CALL (impl, p2 + align2, p1 + align1, len); + res = (unsigned char *) CALL (impl, + (char *) (p2 + align2), + (char *) (p1 + align1), len); if (res != MEMCPY_RESULT (p2 + align2, len)) { error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd) %p != %p", diff --git a/string/test-memmove.c b/string/test-memmove.c index 9531aa82d8..2f3a8f7631 100644 --- a/string/test-memmove.c +++ b/string/test-memmove.c @@ -101,8 +101,8 @@ do_test (size_t align1, size_t align2, size_t len) if (align2 + len >= page_size) return; - s1 = buf1 + align1; - s2 = buf2 + align2; + s1 = (char *) (buf1 + align1); + s2 = (char *) (buf2 + align2); for (i = 0, j = 1; i < len; i++, j += 23) s1[i] = j; @@ -111,7 +111,7 @@ do_test (size_t align1, size_t align2, size_t len) printf ("Length %4zd, alignment %2zd/%2zd:", len, align1, align2); FOR_EACH_IMPL (impl, 0) - do_one_test (impl, s2, buf2 + align1, s1, len); + do_one_test (impl, s2, (char *) (buf2 + align1), s1, len); if (HP_TIMING_AVAIL) putchar ('\n'); @@ -179,7 +179,9 @@ do_random_tests (void) { memset (p2 + dststart, c, dstend - dststart); memcpy (p2 + srcstart, p1 + srcstart, srcend - srcstart); - res = CALL (impl, p2 + align2, p2 + align1, len); + res = (unsigned char *) CALL (impl, + (char *) (p2 + align2), + (char *) (p2 + align1), len); if (res != p2 + align2) { error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd) %p != %p", diff --git a/string/test-strcat.c b/string/test-strcat.c index 53c8462839..443752069c 100644 --- a/string/test-strcat.c +++ b/string/test-strcat.c @@ -1,5 +1,5 @@ /* Test and measure strcat functions. - Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek <jakub@redhat.com>, 1999. @@ -91,8 +91,8 @@ do_test (size_t align1, size_t align2, size_t len1, size_t len2, int max_char) if (align2 + len1 + len2 >= page_size) return; - s1 = buf1 + align1; - s2 = buf2 + align2; + s1 = (char *) (buf1 + align1); + s2 = (char *) (buf2 + align2); for (i = 0; i < len1; ++i) s1[i] = 32 + 23 * i % (max_char - 32); @@ -175,7 +175,8 @@ do_random_tests (void) memset (p2 - 64, '\1', align2 + 64); memset (p2 + align2 + len2 + 1, '\1', 512 - align2 - len2 - 1); memcpy (p2 + align2, buf1, len2 + 1); - res = CALL (impl, p2 + align2, p1 + align1); + res = (unsigned char *) CALL (impl, (char *) (p2 + align2), + (char *) (p1 + align1)); if (res != p2 + align2) { error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd %zd) %p != %p", diff --git a/string/test-strchr.c b/string/test-strchr.c index 1333ebc8bc..cf25b449d9 100644 --- a/string/test-strchr.c +++ b/string/test-strchr.c @@ -101,10 +101,10 @@ do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char) if (pos < len) { buf1[align + pos] = seek_char; - result = buf1 + align + pos; + result = (char *) (buf1 + align + pos); } else if (seek_char == 0) - result = buf1 + align + len; + result = (char *) (buf1 + align + len); else result = NULL; @@ -112,7 +112,7 @@ do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char) printf ("Length %4zd, alignment %2zd:", pos, align); FOR_EACH_IMPL (impl, 0) - do_one_test (impl, buf1 + align, seek_char, result); + do_one_test (impl, (char *) (buf1 + align), seek_char, result); if (HP_TIMING_AVAIL) putchar ('\n'); @@ -166,18 +166,18 @@ do_random_tests (void) } if (pos <= len) - result = p + pos + align; + result = (char *) (p + pos + align); else if (seek_char == 0) - result = p + len + align; + result = (char *) (p + len + align); else result = NULL; FOR_EACH_IMPL (impl, 1) - if (CALL (impl, p + align, seek_char) != result) + if (CALL (impl, (char *) (p + align), seek_char) != result) { error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %d, %zd, %zd) %p != %p, p %p", n, impl->name, align, seek_char, len, pos, - CALL (impl, p + align, seek_char), result, p); + CALL (impl, (char *) (p + align), seek_char), result, p); ret = 1; } } diff --git a/string/test-strcmp.c b/string/test-strcmp.c index af49f14fe1..769e9828fd 100644 --- a/string/test-strcmp.c +++ b/string/test-strcmp.c @@ -1,5 +1,5 @@ /* Test and measure strcmp functions. - Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek <jakub@redhat.com>, 1999. @@ -103,8 +103,8 @@ do_test (size_t align1, size_t align2, size_t len, int max_char, if (align2 + len + 1 >= page_size) return; - s1 = buf1 + align1; - s2 = buf2 + align2; + s1 = (char *) (buf1 + align1); + s2 = (char *) (buf2 + align2); for (i = 0; i < len; i++) s1[i] = s2[i] = 1 + 23 * i % max_char; @@ -198,7 +198,7 @@ do_random_tests (void) FOR_EACH_IMPL (impl, 1) { - r = CALL (impl, p1 + align1, p2 + align2); + r = CALL (impl, (char *) (p1 + align1), (char *) (p2 + align2)); /* Test whether on 64-bit architectures where ABI requires callee to promote has the promotion been done. */ asm ("" : "=g" (r) : "0" (r)); diff --git a/string/test-strcpy.c b/string/test-strcpy.c index dbfbb9294d..6a2ea2510e 100644 --- a/string/test-strcpy.c +++ b/string/test-strcpy.c @@ -1,5 +1,5 @@ /* Test and measure strcpy functions. - Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek <jakub@redhat.com>, 1999. @@ -92,8 +92,8 @@ do_test (size_t align1, size_t align2, size_t len, int max_char) if (align2 + len >= page_size) return; - s1 = buf1 + align1; - s2 = buf2 + align2; + s1 = (char *) (buf1 + align1); + s2 = (char *) (buf2 + align2); for (i = 0; i < len; i++) s1[i] = 32 + 23 * i % (max_char - 32); @@ -148,7 +148,8 @@ do_random_tests (void) FOR_EACH_IMPL (impl, 1) { memset (p2 - 64, '\1', 512 + 64); - res = CALL (impl, p2 + align2, p1 + align1); + res = (unsigned char *) CALL (impl, (char *) (p2 + align2), + (char *) (p1 + align1)); if (res != STRCPY_RESULT (p2 + align2, len)) { error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd) %p != %p", diff --git a/string/test-strlen.c b/string/test-strlen.c index 82ad95e5cc..e01befbf46 100644 --- a/string/test-strlen.c +++ b/string/test-strlen.c @@ -1,5 +1,5 @@ /* Test and measure strlen functions. - Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek <jakub@redhat.com>, 1999. @@ -92,7 +92,7 @@ do_test (size_t align, size_t len, int max_char) printf ("Length %4zd, alignment %2zd:", len, align); FOR_EACH_IMPL (impl, 0) - do_one_test (impl, buf1 + align, len); + do_one_test (impl, (char *) (buf1 + align), len); if (HP_TIMING_AVAIL) putchar ('\n'); @@ -127,10 +127,11 @@ do_random_tests (void) } FOR_EACH_IMPL (impl, 1) - if (CALL (impl, p + align) != len) + if (CALL (impl, (char *) (p + align)) != len) { error (0, 0, "Iteration %zd - wrong result in function %s (%zd) %zd != %zd, p %p", - n, impl->name, align, CALL (impl, p + align), len, p); + n, impl->name, align, CALL (impl, (char *) (p + align)), + len, p); ret = 1; } } diff --git a/string/test-strncpy.c b/string/test-strncpy.c index 62b83166a3..d7a714cef1 100644 --- a/string/test-strncpy.c +++ b/string/test-strncpy.c @@ -1,5 +1,5 @@ /* Test and measure strncpy functions. - Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek <jakub@redhat.com>, 1999. @@ -124,8 +124,8 @@ do_test (size_t align1, size_t align2, size_t len, size_t n, int max_char) if (align2 + len >= page_size) return; - s1 = buf1 + align1; - s2 = buf2 + align2; + s1 = (char *) (buf1 + align1); + s2 = (char *) (buf2 + align2); for (i = 0; i < len; ++i) s1[i] = 32 + 23 * i % (max_char - 32); @@ -215,7 +215,9 @@ do_random_tests (void) FOR_EACH_IMPL (impl, 1) { memset (p2 - 64, '\1', 512 + 64); - res = CALL (impl, p2 + align2, p1 + align1, size); + res = (unsigned char *) CALL (impl, + (char *) (p2 + align2), + (char *) (p1 + align1), size); if (res != STRNCPY_RESULT (p2 + align2, len, size)) { error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %zd, %zd) %p != %p", diff --git a/string/test-strpbrk.c b/string/test-strpbrk.c index 2ec52fd286..f3ed2080bc 100644 --- a/string/test-strpbrk.c +++ b/string/test-strpbrk.c @@ -1,5 +1,5 @@ /* Test and measure strpbrk functions. - Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek <jakub@redhat.com>, 1999. @@ -102,8 +102,8 @@ do_test (size_t align, size_t pos, size_t len) if (align + pos + 10 >= page_size || len > 240) return; - rej = buf2 + (random () & 255); - s = buf1 + align; + rej = (char *) (buf2 + (random () & 255)); + s = (char *) (buf1 + align); for (i = 0; i < len; ++i) { @@ -182,7 +182,7 @@ do_random_tests (void) } rej[i] = '\0'; for (c = 1; c <= 255; ++c) - if (strchr (rej, c) == NULL) + if (strchr ((char *) rej, c) == NULL) break; j = (pos > len ? pos : len) + align + 64; if (j > 512) @@ -199,23 +199,24 @@ do_random_tests (void) else { p[i] = random () & 255; - if (strchr (rej, p[i])) + if (strchr ((char *) rej, p[i])) { p[i] = random () & 255; - if (strchr (rej, p[i])) + if (strchr ((char *) rej, p[i])) p[i] = c; } } } - result = STRPBRK_RESULT (p + align, pos < len ? pos : len); + result = STRPBRK_RESULT ((char *) (p + align), pos < len ? pos : len); FOR_EACH_IMPL (impl, 1) - if (CALL (impl, p + align, rej) != result) + if (CALL (impl, (char *) (p + align), (char *) rej) != result) { error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %p, %zd, %zd, %zd) %p != %p", n, impl->name, align, rej, rlen, pos, len, - (void *) CALL (impl, p + align, rej), (void *) result); + (void *) CALL (impl, (char *) (p + align), (char *) rej), + (void *) result); ret = 1; } } diff --git a/string/test-strrchr.c b/string/test-strrchr.c index 5aff75aeba..92e8ab1bb1 100644 --- a/string/test-strrchr.c +++ b/string/test-strrchr.c @@ -1,5 +1,5 @@ /* Test and measure strrchr functions. - Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek <jakub@redhat.com>, 1999. @@ -95,10 +95,10 @@ do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char) if (pos < len) { buf1[align + pos] = seek_char; - result = buf1 + align + pos; + result = (char *) (buf1 + align + pos); } else if (seek_char == 0) - result = buf1 + align + len; + result = (char *) (buf1 + align + len); else result = NULL; @@ -106,7 +106,7 @@ do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char) printf ("Length %4zd, alignment %2zd:", pos, align); FOR_EACH_IMPL (impl, 0) - do_one_test (impl, buf1 + align, seek_char, result); + do_one_test (impl, (char *) (buf1 + align), seek_char, result); if (HP_TIMING_AVAIL) putchar ('\n'); @@ -165,18 +165,18 @@ do_random_tests (void) } if (pos <= len) - result = p + pos + align; + result = (char *) (p + pos + align); else if (seek_char == 0) - result = p + len + align; + result = (char *) (p + len + align); else result = NULL; FOR_EACH_IMPL (impl, 1) - if (CALL (impl, p + align, seek_char) != result) + if (CALL (impl, (char *) (p + align), seek_char) != result) { error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %d, %zd, %zd) %p != %p, p %p", n, impl->name, align, seek_char, len, pos, - CALL (impl, p + align, seek_char), result, p); + CALL (impl, (char *) (p + align), seek_char), result, p); ret = 1; } } diff --git a/string/test-strspn.c b/string/test-strspn.c index de7351fe8c..15cf4923f0 100644 --- a/string/test-strspn.c +++ b/string/test-strspn.c @@ -1,5 +1,5 @@ /* Test and measure strspn functions. - Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1999,2002,2003,2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek <jakub@redhat.com>, 1999. @@ -104,8 +104,8 @@ do_test (size_t align, size_t pos, size_t len) if (align + pos + 10 >= page_size || len > 240 || ! len) return; - acc = buf2 + (random () & 255); - s = buf1 + align; + acc = (char *) (buf2 + (random () & 255)); + s = (char *) (buf1 + align); for (i = 0; i < len; ++i) { @@ -183,7 +183,7 @@ do_random_tests (void) else if (i == pos + align) { p[i] = random () & 255; - if (strchr (acc, p[i])) + if (strchr ((char *) acc, p[i])) p[i] = '\0'; } else if (i < align || i > pos + align) @@ -193,11 +193,13 @@ do_random_tests (void) } FOR_EACH_IMPL (impl, 1) - if (CALL (impl, p + align, acc) != (pos < len ? pos : len)) + if (CALL (impl, (char *) (p + align), + (char *) acc) != (pos < len ? pos : len)) { error (0, 0, "Iteration %zd - wrong result in function %s (%zd, %p, %zd, %zd, %zd) %zd != %zd", n, impl->name, align, acc, alen, pos, len, - CALL (impl, p + align, acc), (pos < len ? pos : len)); + CALL (impl, (char *) (p + align), (char *) acc), + (pos < len ? pos : len)); ret = 1; } } |