as the __builtin_expect expression, just the Boolean value.
* sysdeps/generic/wordexp.c (parse_glob): int -> size_t for counter.
* sysdeps/unix/sysv/linux/opensock.c (__opensock): Likewise.
* resolv/res_hconf.c (arg_service_list, parse_line): Likewise.
* iconvdata/tst-loading.c (main): Likewise.
* catgets/tst-catgets.c (main): Likewise.
* stdlib/tst-xpg-basename.c (main): Likewise.
* stdlib/tst-bsearch.c (main): Likewise.
* stdio-common/test-vfprintf.c (main): Likewise.
* stdio-common/tst-rndseek.c (do_test): Likewise.
* libio/tst_swprintf.c (main): Likewise.
* libio/tst-fgetws.c (main): Likewise.
* wcsmbs/tst-mbrtowc.c (check_ascii): Likewise.
* time/tst-posixtz.c (main): Likewise.
* time/tst-strptime.c (test_tm): Likewise.
* time/tst-strptime.c (main): Likewise.
* time/tst-getdate.c (main): Likewise.
* posix/tst-mmap.c (main): Likewise.
* posix/tst-getaddrinfo.c (do_test): Likewise.
* io/tst-getcwd.c (do_test): Likewise.
* resolv/tst-aton.c (main): Likewise.
* inet/tst-network.c (main): Likewise.
* libio/tst-fgetws.c (main): Likewise.
* sysdeps/posix/sprofil.c (add_region): int -> unsigned int for I.
* sysdeps/unix/sysv/linux/ptsname.c (__ptsname_r): int -> unsigned int
for PTYNO.
* stdlib/msort.c (qsort): Add a cast to silence warning.
* stdio-common/vfprintf.c (process_string_arg): Likewise.
* libio/oldfileops.c (_IO_old_do_write): Likewise.
* sysdeps/unix/sysv/linux/getcwd.c (__getcwd): Likewise.
* sysdeps/unix/sysv/linux/ttyname.c (ttyname): Likewise.
* sysdeps/unix/sysv/linux/gethostid.c (gethostid): Likewise.
* argp/argp-fmtstream.c (__argp_fmtstream_printf): Likewise.
* nscd/nscd_getgr_r.c (nscd_getgr_r): Likewise.
* sysdeps/unix/grantpt.c (grantpt): Likewise.
* libio/tst-widetext.c (main): Likewise.
* libio/tst-mmap2-eofsync.c (do_test): Likewise.
* rt/tst-aio.c (test_file): Likewise.
* rt/tst-aio64.c (test_file): Likewise.
* resolv/tst-aton.c (main): Likewise.
* catgets/catgetsinfo.h (CATGETS_MAGIC): Use U suffix on the constant.
* ctype/ctype.c (__ctype_tolower, __ctype_toupper): Cast to int32_t
instead of uint32_t in these macros.
+2002-09-23 Roland McGrath <roland@redhat.com>
+
+ * catgets/open_catalog.c (__open_catalog): Don't use a value type
+ as the __builtin_expect expression, just the Boolean value.
+
+ * sysdeps/generic/wordexp.c (parse_glob): int -> size_t for counter.
+ * sysdeps/unix/sysv/linux/opensock.c (__opensock): Likewise.
+ * resolv/res_hconf.c (arg_service_list, parse_line): Likewise.
+ * iconvdata/tst-loading.c (main): Likewise.
+ * catgets/tst-catgets.c (main): Likewise.
+ * stdlib/tst-xpg-basename.c (main): Likewise.
+ * stdlib/tst-bsearch.c (main): Likewise.
+ * stdio-common/test-vfprintf.c (main): Likewise.
+ * stdio-common/tst-rndseek.c (do_test): Likewise.
+ * libio/tst_swprintf.c (main): Likewise.
+ * libio/tst-fgetws.c (main): Likewise.
+ * wcsmbs/tst-mbrtowc.c (check_ascii): Likewise.
+ * time/tst-posixtz.c (main): Likewise.
+ * time/tst-strptime.c (test_tm): Likewise.
+ * time/tst-strptime.c (main): Likewise.
+ * time/tst-getdate.c (main): Likewise.
+ * posix/tst-mmap.c (main): Likewise.
+ * posix/tst-getaddrinfo.c (do_test): Likewise.
+ * io/tst-getcwd.c (do_test): Likewise.
+ * resolv/tst-aton.c (main): Likewise.
+ * inet/tst-network.c (main): Likewise.
+ * libio/tst-fgetws.c (main): Likewise.
+ * sysdeps/posix/sprofil.c (add_region): int -> unsigned int for I.
+ * sysdeps/unix/sysv/linux/ptsname.c (__ptsname_r): int -> unsigned int
+ for PTYNO.
+
+ * stdlib/msort.c (qsort): Add a cast to silence warning.
+ * stdio-common/vfprintf.c (process_string_arg): Likewise.
+ * libio/oldfileops.c (_IO_old_do_write): Likewise.
+ * sysdeps/unix/sysv/linux/getcwd.c (__getcwd): Likewise.
+ * sysdeps/unix/sysv/linux/ttyname.c (ttyname): Likewise.
+ * sysdeps/unix/sysv/linux/gethostid.c (gethostid): Likewise.
+ * argp/argp-fmtstream.c (__argp_fmtstream_printf): Likewise.
+ * nscd/nscd_getgr_r.c (nscd_getgr_r): Likewise.
+ * sysdeps/unix/grantpt.c (grantpt): Likewise.
+ * libio/tst-widetext.c (main): Likewise.
+ * libio/tst-mmap2-eofsync.c (do_test): Likewise.
+ * rt/tst-aio.c (test_file): Likewise.
+ * rt/tst-aio64.c (test_file): Likewise.
+ * resolv/tst-aton.c (main): Likewise.
+
+ * catgets/catgetsinfo.h (CATGETS_MAGIC): Use U suffix on the constant.
+
+ * ctype/ctype.c (__ctype_tolower, __ctype_toupper): Cast to int32_t
+ instead of uint32_t in these macros.
+
2002-09-22 Bruno Haible <bruno@clisp.org>
* iconv/iconv_prog.c (main): Provide an error message that identifies
the wrong encoding.
-2002-09-22 Bruno Haible <bruno@clisp.org>
-
* iconvdata/tscii.c: New file.
* iconvdata/testdata/TSCII: New file.
* iconvdata/testdata/TSCII..UTF8: New file.
* iconvdata/tst-tables.sh: Add TSCII.
* iconvdata/TESTS: Add TSCII.
-2002-09-22 Bruno Haible <bruno@clisp.org>
-
Revert 2002-04-18 patch.
* iconvdata/euc-jisx0213.c (EMIT_SHIFT_TO_INIT, BODY for
FROM_DIRECTION): Make the FROM direction stateful again.
* iconvdata/shift_jisx0213.c (EMIT_SHIFT_TO_INIT, BODY for
FROM_DIRECTION): Likewise.
-2002-09-22 Bruno Haible <bruno@clisp.org>
-
* iconvdata/tst-e2big.c: New file.
* iconvdata/Makefile (tests): Add tst-e2big.
avail = fs->end - fs->p;
out = __vsnprintf (fs->p, avail, fmt, args);
va_end (args);
- if (out >= avail)
+ if ((size_t) out >= avail)
size_guess = out + 1;
}
- while (out >= avail);
+ while ((size_t) out >= avail);
fs->p += out;
/* The magic number to signal we really have a catalog file. */
-#define CATGETS_MAGIC 0x960408de
+#define CATGETS_MAGIC 0x960408deU
/* Prototypes for helper functions. */
/* Determine whether the file is a catalog file and if yes whether
it is written using the correct byte order. Else we have to swap
the values. */
- if (__builtin_expect (catalog->file_ptr->magic, CATGETS_MAGIC)
- == CATGETS_MAGIC)
+ if (__builtin_expect (catalog->file_ptr->magic == CATGETS_MAGIC, 1))
swapping = 0;
else if (catalog->file_ptr->magic == SWAPU32 (CATGETS_MAGIC))
swapping = 1;
for (rnd = 0; rnd < ROUNDS; ++rnd)
{
nl_catd cd = catopen ("libc", 0);
- int cnt;
+ size_t cnt;
if (cd == (nl_catd) -1)
{
/* Tests for loading and unloading of iconv modules.
- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 2000.
int
main (void)
{
- int count = TEST_ROUNDS;
+ size_t count = TEST_ROUNDS;
int result = 0;
mtrace ();
/* Test for inet_network.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2000.
main (void)
{
int errors = 0;
- int i;
+ size_t i;
uint32_t res;
for (i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i)
/* Test of getcwd function.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 2000.
char *bufs[10];
size_t lens[10];
size_t sbs;
- size_t len;
- int i;
+ size_t len, i;
if (getcwd (thepath, sizeof thepath) == NULL)
{
const char *data;
_IO_size_t to_do;
{
- return (to_do == 0 || old_do_write (fp, data, to_do) == to_do)
+ return (to_do == 0 || (_IO_size_t) old_do_write (fp, data, to_do) == to_do)
? 0 : EOF;
}
int
main (int argc, char *argv[])
{
- int i;
+ size_t i;
FILE *fp;
wchar_t *ret, wcs[WIDE_STR_LEN];
int result = 0;
}
else
{
- int i;
+ size_t i;
printf ("Return Value: %p\n", ret);
for (i = 0; i < wcslen (wcs) + 1; i++)
}
c = write (temp_fd, pages + pagesize, pagesize);
- if (c == pagesize)
+ if (c == (ssize_t) pagesize)
printf ("wrote more to file\n");
else
{
exit (1);
}
- if ((size_t) nonr == -1 )
+ if (nonr == (size_t) -1)
{
printf ("\
%u: iconv returned with %Zd and errno = %m (inleft: %Zd, outleft: %Zd)\n",
int
main (int argc, char *argv[])
{
- int n;
+ size_t n;
int result = 0;
puts ("test 1");
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@uni-paderborn.de>, 1998.
vec[1].iov_base = (void *) key;
vec[1].iov_len = keylen;
- if (__writev (sock, vec, 2) != sizeof (request_header) + keylen)
+ if ((size_t) __writev (sock, vec, 2) != sizeof (request_header) + keylen)
{
__close (sock);
return -1;
total_len += gr_resp.gr_name_len + gr_resp.gr_passwd_len;
/* Get this data. */
- if (__readv (sock, vec, 2) != total_len)
+ if ((size_t) __readv (sock, vec, 2) != total_len)
{
__close (sock);
return -1;
-/* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
{
const int family[2] = { AF_INET, AF_INET6 };
int result = 0;
- int gaierr, index;
+ int gaierr;
+ size_t index;
struct addrinfo hints, *ai, *aitop;
for (index = 0; index < sizeof (family) / sizeof (family[0]); ++index)
{
int result = 0;
FILE *fp;
- int c;
+ size_t c;
char buf[1000];
int fd;
- char *ptr;
+ unsigned char *ptr;
size_t ps = sysconf (_SC_PAGESIZE);
void *mem;
enum Name_Service service;
const char *start;
size_t len;
- int i;
+ size_t i;
static struct
{
const char * name;
const char *start;
struct cmd *c = 0;
size_t len;
- int i;
+ size_t i;
str = skip_ws (str);
{ "1.2.256.4", 0, 0 },
{ "1.2.3.0x100", 0, 0 },
{ "323543357756889", 0, 0 },
- { "10.1.2.3.4", 0, 0},
+ { "10.1.2.3.4", 0, 0},
};
main (int argc, char *argv[])
{
int result = 0;
- int cnt;
+ size_t cnt;
for (cnt = 0; cnt < sizeof (tests) / sizeof (tests[0]); ++cnt)
{
struct in_addr addr;
- if (inet_aton (tests[cnt].input, &addr) != tests[cnt].valid)
+ if ((int) inet_aton (tests[cnt].input, &addr) != tests[cnt].valid)
{
if (tests[cnt].valid)
printf ("\"%s\" not seen as valid IP address\n", tests[cnt].input);
return 1;
}
- if (st.st_size != size)
+ if (st.st_size != (off_t) size)
{
error (0, errno, "%s: wrong size: %lu, should be %lu",
msg, (unsigned long int) st.st_size, (unsigned long int) size);
return 1;
}
- if (pread (fd, tmp, size, 0) != size)
+ if (pread (fd, tmp, size, 0) != (ssize_t) size)
{
error (0, errno, "%s: failed pread", msg);
return 1;
return 1;
}
- if (st.st_size != size)
+ if (st.st_size != (off_t) size)
{
error (0, errno, "%s: wrong size: %lu, should be %lu",
msg, (unsigned long int) st.st_size, (unsigned long int) size);
return 1;
}
- if (pread (fd, tmp, size, 0) != size)
+ if (pread (fd, tmp, size, 0) != (ssize_t) size)
{
error (0, errno, "%s: failed pread", msg);
return 1;
/* Tests of *printf for very large strings.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2000.
main (void)
{
char buf[20];
- int i;
+ size_t i;
int res = 0;
int fd;
{
int fd;
FILE *fp;
- int i;
+ size_t i;
int result;
fd = mkstemp (fname);
const char *mbs = (const char *) string; \
mbstate_t mbstate; \
\
- len = prec != -1 ? prec : strlen (mbs); \
+ len = prec != -1 ? (size_t) prec : strlen (mbs); \
\
/* Allocate dynamically an array which definitely is long \
enough for the wide character version. */ \
measured in bytes. */
/* If the memory requirements are too high don't allocate memory. */
- if (size / pagesize > phys_pages)
+ if (size / pagesize > (size_t) phys_pages)
_quicksort (b, n, s, cmp);
else
{
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2000.
int
main (void)
{
- int cnt;
+ size_t cnt;
int result = 0;
struct entry key;
struct entry *res;
puts ("found an entry that's not there");
result = 1;
}
-
+
/* Now the array contains only one element - no entry should be found. */
for (cnt = 0; cnt < narr; ++cnt)
{
-/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999.
int
main (void)
{
- int i = 0;
+ size_t i = 0;
int errors = 0;
char path[1024];
char *file;
/* We are poised just after a '*', a '[' or a '?'. */
int error = WRDE_NOSPACE;
int quoted = 0; /* 1 if singly-quoted, 2 if doubly */
- int i;
+ size_t i;
wordexp_t glob_list; /* List of words to glob */
glob_list.we_wordc = 0;
{
unsigned long int nsamples;
size_t start, end;
- int i;
+ unsigned int i;
if (p->pr_scale < 2)
return 0;
}
/* Get the group ID of the special `tty' group. */
- if (grbuflen == -1)
+ if (grbuflen == (size_t) -1L)
/* `sysconf' does not support _SC_GETGR_R_SIZE_MAX.
Try a moderate value. */
grbuflen = 1024;
{
if (path[0] == '/')
{
- if (n >= alloc_size - 1)
+ if ((size_t) n >= alloc_size - 1)
{
if (buf == NULL)
free (path);
in.s_addr = 0;
memcpy (&in, hp->h_addr,
- (int) sizeof (in) < hp->h_length ? sizeof (in) : hp->h_length);
+ (int) sizeof (in) < hp->h_length ? (int) sizeof (in) : hp->h_length);
/* For the return value to be not exactly the IP address we do some
bit fiddling. */
char fname[sizeof "/proc/" + 14];
int result;
int has_proc;
- int cnt;
+ size_t cnt;
/* We already know which family to use from the last call. Use it
again. */
{
int save_errno = errno;
struct stat64 st;
- int ptyno;
+ unsigned int ptyno;
if (buf == NULL)
{
numbuf[sizeof (numbuf) - 1] = '\0';
p = _itoa_word (ptyno, &numbuf[sizeof (numbuf) - 1], 10, 0);
- if (buflen < devptslen + &numbuf[sizeof (numbuf)] - p)
+ if (buflen < devptslen + (&numbuf[sizeof (numbuf)] - p))
{
__set_errno (ERANGE);
return ERANGE;
/* This is for Linux 2.0. */
&& ttyname_buf[0] != '[')
{
- if (len >= buflen)
+ if ((size_t) len >= buflen)
return NULL;
/* readlink need not terminate the string. */
ttyname_buf[len] = '\0';
/* Test for getdate.
- Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2000.
main (void)
{
int errors = 0;
- int i;
+ size_t i;
struct tm *tm;
for (i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i)
{
setenv ("TZ", tests[i].tz, 1);
-
+
tm = getdate (tests[i].str);
if (getdate_err != tests[i].err)
main (void)
{
int result = 0;
- int cnt;
+ size_t cnt;
for (cnt = 0; cnt < sizeof (tests) / sizeof (tests[0]); ++cnt)
{
/* Test for strptime.
- Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
test_tm (void)
{
struct tm tm;
- int i;
+ size_t i;
int result = 0;
char buf[100];
main (int argc, char *argv[])
{
struct tm tm;
- int i;
+ size_t i;
int result = 0;
for (i = 0; i < sizeof (day_tests) / sizeof (day_tests[0]); ++i)
-/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2000.
char buf[MB_CUR_MAX];
wchar_t wc = 0xffffffff;
mbstate_t s;
- size_t n;
- int i;
+ size_t n, i;
for (i = 0; i < MB_CUR_MAX; ++i)
buf[i] = c + i;