Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Roland McGrath committed Dec 27, 2005
1 parent 89c47e9 commit 0317eae
Show file tree
Hide file tree
Showing 26 changed files with 138 additions and 89 deletions.
37 changes: 36 additions & 1 deletion 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
Expand Down
2 changes: 1 addition & 1 deletion dlfcn/bug-atexit1.c
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion elf/order2mod2.c
Expand Up @@ -7,7 +7,7 @@ void
__attribute__ ((constructor))
init (void)
{
foo () - bar ();
(void) (foo () - bar ());
}

static void
Expand Down
2 changes: 1 addition & 1 deletion iconvdata/bug-iconv4.c
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion libio/obprintf.c
@@ -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.
Expand All @@ -23,6 +24,7 @@
#include <stdlib.h>
#endif
#include "libioP.h"
#include "strfile.h"
#include <assert.h>
#include <string.h>
#include <errno.h>
Expand Down
4 changes: 2 additions & 2 deletions locale/programs/simple-hash.c
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions posix/bug-regex22.c
@@ -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.
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion posix/bug-regex5.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion posix/transbug.c
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion resolv/herror.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion stdio-common/tst-fgets.c
Expand Up @@ -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");
Expand Down
6 changes: 3 additions & 3 deletions 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.
Expand Down Expand Up @@ -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)
{
Expand Down
13 changes: 7 additions & 6 deletions 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.
Expand Down Expand Up @@ -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
{
Expand All @@ -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');
Expand Down Expand Up @@ -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;
}
}
Expand Down
8 changes: 4 additions & 4 deletions 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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down
10 changes: 6 additions & 4 deletions 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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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",
Expand Down
10 changes: 6 additions & 4 deletions string/test-memmove.c
Expand Up @@ -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;
Expand All @@ -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');
Expand Down Expand Up @@ -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",
Expand Down
9 changes: 5 additions & 4 deletions 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.
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 0317eae

Please sign in to comment.