]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* posix/tst-execle1.c (do_test): Add a const.
authorRoland McGrath <roland@gnu.org>
Tue, 27 Dec 2005 22:50:12 +0000 (22:50 +0000)
committerRoland McGrath <roland@gnu.org>
Tue, 27 Dec 2005 22:50:12 +0000 (22:50 +0000)
* 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

26 files changed:
ChangeLog
dlfcn/bug-atexit1.c
elf/order2mod2.c
iconvdata/bug-iconv4.c
libio/obprintf.c
locale/programs/simple-hash.c
posix/bug-regex22.c
posix/bug-regex5.c
posix/transbug.c
resolv/herror.c
stdio-common/tst-fgets.c
string/test-memccpy.c
string/test-memchr.c
string/test-memcmp.c
string/test-memcpy.c
string/test-memmove.c
string/test-strcat.c
string/test-strchr.c
string/test-strcmp.c
string/test-strcpy.c
string/test-strlen.c
string/test-strncpy.c
string/test-strpbrk.c
string/test-strrchr.c
string/test-strspn.c
wcsmbs/tst-mbsrtowcs.c

index b39c0393c96f550395b8bb21cc1c82310a1df53b..b0577c701bfdeebe3e4aa07be4ffa5e5f84807ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,44 @@
+2005-12-27  Roland McGrath  <roland@redhat.com>
+
+       * 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.
+
 2005-12-27  Ulrich Drepper  <drepper@redhat.com>
 
        * elf/tst-tls13.c (do_test): Avoid using the library path when
        looking for tst-tlsmod13a.so.
 
-       * stdio-common/tstdiomisc.c: If FLT_EVEL_METHOD is 2 use long
+       * stdio-common/tstdiomisc.c: If FLT_EVAL_METHOD is 2, use long
        double math to generate NaN results.
 
        * sysdeps/unix/sysv/linux/sparc/bits/errno.h: Define EOWNERDEAD
index 3bdb5587b1a0682a77885379498ff2ba73779583..e2d1d2f77676c4d54061946f4e39b0fa7661ca26 100644 (file)
@@ -10,7 +10,7 @@ do_test (void)
   for (int i = 0; i < 2; ++i)
     {
       void *dso = dlopen ("$ORIGIN/bug-atexit1-lib.so", RTLD_NOW);
-      void (*fn) (void) = (void (*)()) dlsym (dso, "foo");
+      void (*fn) (void) = (void (*) (void)) dlsym (dso, "foo");
       fn ();
       dlclose (dso);
       puts ("round done");
index b03fb60fa3897640f7833931f82ab133d1617c9b..026cd2acc46825ccee15d7b1437c0d9881a4a998 100644 (file)
@@ -7,7 +7,7 @@ void
 __attribute__ ((constructor))
 init (void)
 {
-  foo () - bar ();
+  (void) (foo () - bar ());
 }
 
 static void
index f6bfebd39f3aef468ed4faa0fdbf3a61a8946785..4469034b93e5912f1a45850914b1d32e826834f6 100644 (file)
@@ -15,7 +15,7 @@ xiconv (iconv_t cd, int out_size)
 {
   unsigned char euc[4];
   char *inp = (char *) UCS_STR;
-  char *outp = euc;
+  char *outp = (char *) euc;
   size_t inbytesleft = strlen (UCS_STR);
   size_t outbytesleft = out_size;
   size_t ret;
index 19300e80a32f7392b05be90ef5e483b246e31e1c..1167a93d0bed67978713791b59101e14ca95364d 100644 (file)
@@ -1,5 +1,6 @@
 /* Print output of stream to given obstack.
-   Copyright (C) 1996,1997,1999-2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1996,1997,1999,2000,2001,2002,2003,2004,2005
+       Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -23,6 +24,7 @@
 #include <stdlib.h>
 #endif
 #include "libioP.h"
+#include "strfile.h"
 #include <assert.h>
 #include <string.h>
 #include <errno.h>
index 86bbdd5b13b68a52ce937f22fe658da4f50bda6d..de8998cc7a607e017ff5e49aabff3bf617fafe2a 100644 (file)
@@ -146,13 +146,13 @@ insert_entry_2 (htab, key, keylen, hval, idx, data)
   if ((hash_entry *) htab->first == NULL)
     {
       table[idx].next = &table[idx];
-      *(hash_entry **) &htab->first = &table[idx];
+      htab->first = &table[idx];
     }
   else
     {
       table[idx].next = ((hash_entry *) htab->first)->next;
       ((hash_entry *) htab->first)->next = &table[idx];
-      *(hash_entry **) &htab->first = &table[idx];
+      htab->first = &table[idx];
     }
 
   ++htab->filled;
index 1636202d366817e6639b0bb95e5843d275f3bd77..c5bc94869ba8907bd7992f703056e237e66c2097 100644 (file)
@@ -1,5 +1,5 @@
 /* Test re.translate != NULL.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
 
@@ -40,7 +40,7 @@ main (void)
   re_set_syntax (RE_SYNTAX_POSIX_EGREP);
 
   memset (&re, 0, sizeof (re));
-  re.translate = trans;
+  re.translate = (unsigned char *) trans;
   s = re_compile_pattern ("\\W", 2, &re);
 
   if (s != NULL)
@@ -68,7 +68,7 @@ main (void)
     }
 
   memset (&re, 0, sizeof (re));
-  re.translate = trans;
+  re.translate = (unsigned char *) trans;
   s = re_compile_pattern ("\\w", 2, &re);
 
   if (s != NULL)
@@ -96,7 +96,7 @@ main (void)
     }
 
   memset (&re, 0, sizeof (re));
-  re.translate = trans;
+  re.translate = (unsigned char *) trans;
   s = re_compile_pattern ("[[:DIGIT:]]", 11, &re);
   if (s == NULL)
     {
@@ -106,7 +106,7 @@ main (void)
     }
 
   memset (&re, 0, sizeof (re));
-  re.translate = trans;
+  re.translate = (unsigned char *) trans;
   s = re_compile_pattern ("[[:DIGIT:]]", 2, &re);
   if (s == NULL)
     {
index ee4d65215746f94b99ddcfbc144f1d65e4a39eb4..f199ffbfd358c3bef7a35610874676be1f5f46fa 100644 (file)
@@ -41,7 +41,7 @@ main (void)
        {
          char elem[256];
          idx = symb_table[2 * i + 1];
-         strncpy (elem, extra + idx + 1, extra[idx]);
+         strncpy (elem, (const char *) (extra + idx + 1), extra[idx]);
          elem[extra[idx]] = '\0';
          printf ("Found a collating element: %s\n", elem);
          ++found;
index 3ae4929593dc01b292424fe64db4dee770fb5273..d0983b4d44d04fd2342ee653099b5aeefed32103 100755 (executable)
@@ -79,7 +79,7 @@ run_test (const char *pattern, struct re_registers *regs)
       exit (1);
     }
 
-  pat.translate = (char *) casetable;
+  pat.translate = (unsigned char *) casetable;
 
   err = re_compile_pattern (pattern, strlen (pattern), &pat);
   if (err != NULL)
index c143cec28c1e021000b24e545006472f53846114..0aaf29f9db724bb3e64c696da613e96a69cd32bb 100644 (file)
@@ -80,7 +80,6 @@ const int     h_nerr = { sizeof h_errlist / sizeof h_errlist[0] };
 void
 herror(const char *s) {
        struct iovec iov[4], *v = iov;
-       extern int * __h_errno();
 
        if (s != NULL && *s != '\0') {
                v->iov_base = (/*noconst*/ char *)s;
index b8e205c7dcf23f5a89525be6f2ba141f03cd73f7..0aa9030e3ae7b845e2df420dc98efc1b759f477e 100644 (file)
@@ -5,7 +5,7 @@
 static int
 do_test (void)
 {
-  FILE *fp = fmemopen ("hello", 5, "r");
+  FILE *fp = fmemopen ((char *) "hello", 5, "r");
   char buf[2];
   char *bp = fgets (buf, sizeof (buf), fp);
   printf ("fgets: %s\n", bp == buf ? "OK" : "ERROR");
index b581408f37103f7b00120df30d91074a48a030d6..26532633df576b4cd7c54e9cb1465cbb14e8af8a 100644 (file)
@@ -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)
     {
index df866fe2d7bac2ccd8d3489ae5f3b2c5c497f008..c233ead5ddfc57dab33944b1823d062084f2d9d1 100644 (file)
@@ -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;
          }
     }
index 89c104386bc4fac665478deb09d8eb59c9e51c9a..af07a5e59935dc042a24955b86ec78343b4c9b79 100644 (file)
@@ -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));
index adc90da7675eb01085aaf9d2c3999f49b3ef949e..7b0723a65a3cadc8cfc51fe206f8fda301cb9c65 100644 (file)
@@ -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",
index 9531aa82d80315d2fd7d2cd5ad23708e56612dc5..2f3a8f76317784b13c286b4287ee19d97ad68648 100644 (file)
@@ -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",
index 53c84628394d8e5ee4039dccbe5fb45cb5b24d59..443752069c04edf1e20ce4610821459cb9907383 100644 (file)
@@ -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",
index 1333ebc8bca1e5bbceda5df96957d4abd39fa0aa..cf25b449d954e0e313ab094e9c5e1ebcd0a7ed3a 100644 (file)
@@ -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;
          }
     }
index af49f14fe16299a5b93da135c2e2dbf37d018ff5..769e9828fddb8b019ec4f6c3d80cb37e77a0f490 100644 (file)
@@ -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));
index dbfbb9294d4b80fbd9813fc3568e260693166867..6a2ea2510e3b5d31174d588a8461ccbf26220c55 100644 (file)
@@ -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",
index 82ad95e5ccd3f8f66d758f00b9e31d8543bca160..e01befbf4625f472055dddd507933ba6c96a2600 100644 (file)
@@ -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;
          }
     }
index 62b83166a35d5a613adbee0c3618452f3345b7f5..d7a714cef136ee0efa212c51582970da84218d91 100644 (file)
@@ -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",
index 2ec52fd28623e4d72c5d3a1f6ea4eccbc42fe55a..f3ed2080bc9e5f70b3bcd2508c8e30b1728ab6bd 100644 (file)
@@ -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;
          }
     }
index 5aff75aebaf791e1a97f522523045f5301145e9b..92e8ab1bb16bad3eab667f97778762e9a328f9e1 100644 (file)
@@ -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;
          }
     }
index de7351fe8c236a1092c9756da38b5cd8fb0bcd08..15cf4923f0d551769e95f348183be16208394631 100644 (file)
@@ -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;
          }
     }
index eb6c8e21b151bb30c87722dc48cfd12d37faba1a..cca5a80a39a2e00559e0d91f5b6c647efdc54493 100644 (file)
@@ -1,5 +1,5 @@
 /* Test NUL handling of mbsrtowcs.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
 
@@ -32,7 +32,7 @@ main (void)
   mbstate_t state;
   memset (&state, '\0', sizeof (state));
 
-  const char *in = buf;
+  const char *in = (const char *) buf;
   size_t n = mbsrtowcs (out, &in, sizeof (out) / sizeof (wchar_t), &state);
 
   int result = 0;