* nscd/cache.c (cache_search): Give first arg type `request_type'.

* nscd/nscd.h: Update decl.

	* nscd/nscd_getpw_r.c (nscd_getpw_r): Add casts for signedness.
	* nscd/nscd_getgr_r.c (nscd_getgr_r): Likewise.
	* elf/dl-close.c (_dl_close): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/chown.c (__chown): int -> size_t
	* io/fts.c (fts_build): Likewise.
	* elf/cache.c (add_to_cache): Likewise.
	* locale/programs/locarchive.c (show_archive_content): Likewise.

	* posix/fnmatch.c (fnmatch): Tweak __builtin_expect use.

	* include/ctype.h (__ctype_b_loc): Tweak type punning to make gcc 3.3
	happy.
	(__ctype_toupper_loc, __ctype_tolower_loc): Likewise.
This commit is contained in:
Roland McGrath 2003-03-16 01:04:03 +00:00
parent e993ec9a5b
commit 638bb1f394
13 changed files with 50 additions and 33 deletions

View File

@ -1,3 +1,22 @@
2003-03-15 Roland McGrath <roland@redhat.com>
* nscd/cache.c (cache_search): Give first arg type `request_type'.
* nscd/nscd.h: Update decl.
* nscd/nscd_getpw_r.c (nscd_getpw_r): Add casts for signedness.
* nscd/nscd_getgr_r.c (nscd_getgr_r): Likewise.
* elf/dl-close.c (_dl_close): Likewise.
* sysdeps/unix/sysv/linux/powerpc/chown.c (__chown): int -> size_t
* io/fts.c (fts_build): Likewise.
* elf/cache.c (add_to_cache): Likewise.
* locale/programs/locarchive.c (show_archive_content): Likewise.
* posix/fnmatch.c (fnmatch): Tweak __builtin_expect use.
* include/ctype.h (__ctype_b_loc): Tweak type punning to make gcc 3.3
happy.
(__ctype_toupper_loc, __ctype_tolower_loc): Likewise.
2003-03-15 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/ia64/system.c: Use the generic Linux

View File

@ -464,7 +464,7 @@ add_to_cache (const char *path, const char *lib, int flags,
{
struct cache_entry *new_entry, *ptr, *prev;
char *full_path;
int len, i;
size_t len, i;
new_entry = (struct cache_entry *) xmalloc (sizeof (struct cache_entry));

View File

@ -371,7 +371,7 @@ _dl_close (void *_map)
this search list, going in either direction. When the
whole chunk is at the end of the used area then we can
reclaim it. */
if (imap->l_tls_offset == tls_free_end)
if ((size_t) imap->l_tls_offset == tls_free_end)
/* Extend the contiguous chunk being reclaimed. */
tls_free_end += imap->l_tls_blocksize;
else if (imap->l_tls_offset + imap->l_tls_blocksize

View File

@ -25,31 +25,28 @@ __libc_tsd_define (extern, CTYPE_TOLOWER)
CTYPE_EXTERN_INLINE const uint16_t ** __attribute__ ((const))
__ctype_b_loc (void)
{
const uint16_t **tablep =
(const uint16_t **) __libc_tsd_address (CTYPE_B);
void **tablep = __libc_tsd_address (CTYPE_B);
if (__builtin_expect (*tablep == NULL, 0))
*tablep = (const uint16_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS) + 128;
return tablep;
*tablep = (uint16_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS) + 128;
return (const uint16_t **) tablep;
}
CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
__ctype_toupper_loc (void)
{
const int32_t **tablep =
(const int32_t **) __libc_tsd_address (CTYPE_TOUPPER);
void **tablep = __libc_tsd_address (CTYPE_TOUPPER);
if (__builtin_expect (*tablep == NULL, 0))
*tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128);
return tablep;
return (const int32_t **) tablep;
}
CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
__ctype_tolower_loc (void)
{
const int32_t **tablep =
(const int32_t **) __libc_tsd_address (CTYPE_TOLOWER);
void **tablep = __libc_tsd_address (CTYPE_TOLOWER);
if (__builtin_expect (*tablep == NULL, 0))
*tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128);
return tablep;
return (const int32_t **) tablep;
}
# endif /* Not NOT_IN_libc. */

View File

@ -581,8 +581,9 @@ fts_build(sp, type)
FTSENT *cur, *tail;
DIR *dirp;
void *oldaddr;
int cderrno, descend, len, level, maxlen, nlinks, saved_errno,
int cderrno, descend, len, level, nlinks, saved_errno,
nostat, doadjust;
size_t maxlen;
char *cp;
/* Set current node pointer. */

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2002 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@ -1402,8 +1402,7 @@ show_archive_content (int verbose)
struct locarhead *head;
struct namehashent *namehashtab;
struct nameent *names;
int cnt;
int used;
size_t cnt, used;
/* Open the archive. This call never returns if we cannot
successfully open the archive. */

View File

@ -1,4 +1,4 @@
/* Copyright (c) 1998, 1999 Free Software Foundation, Inc.
/* Copyright (c) 1998, 1999, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@ -39,7 +39,7 @@
This function must be called with the read-lock held. */
struct hashentry *
cache_search (int type, void *key, size_t len, struct database *table,
cache_search (request_type type, void *key, size_t len, struct database *table,
uid_t owner)
{
unsigned long int hash = __nis_hash (key, len) % table->module;

View File

@ -1,4 +1,4 @@
/* Copyright (c) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
/* Copyright (c) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998.
@ -118,7 +118,7 @@ extern void send_stats (int fd, struct database dbs[lastdb]);
extern int receive_print_stats (void) __attribute__ ((__noreturn__));
/* cache.c */
extern struct hashentry *cache_search (int type, void *key, size_t len,
extern struct hashentry *cache_search (request_type, void *key, size_t len,
struct database *table, uid_t owner);
extern void cache_add (int type, void *key, size_t len,
const void *packet, size_t iovtotal, void *data,

View File

@ -114,8 +114,8 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type,
vec[1].iov_base = (void *) key;
vec[1].iov_len = keylen;
nbytes = (size_t) TEMP_FAILURE_RETRY (__writev (sock, vec, 2));
if (nbytes != sizeof (request_header) + keylen)
nbytes = TEMP_FAILURE_RETRY (__writev (sock, vec, 2));
if (nbytes != (ssize_t) (sizeof (request_header) + keylen))
{
__close (sock);
return -1;
@ -123,7 +123,7 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type,
nbytes = TEMP_FAILURE_RETRY (__read (sock, &gr_resp,
sizeof (gr_response_header)));
if (nbytes != sizeof (gr_response_header))
if (nbytes != (ssize_t) sizeof (gr_response_header))
{
__close (sock);
return -1;

View File

@ -113,8 +113,8 @@ nscd_getpw_r (const char *key, size_t keylen, request_type type,
vec[1].iov_base = (void *) key;
vec[1].iov_len = keylen;
nbytes = (size_t) TEMP_FAILURE_RETRY (__writev (sock, vec, 2));
if (nbytes != sizeof (request_header) + keylen)
nbytes = TEMP_FAILURE_RETRY (__writev (sock, vec, 2));
if (nbytes != (ssize_t) (sizeof (request_header) + keylen))
{
__close (sock);
return -1;
@ -122,7 +122,7 @@ nscd_getpw_r (const char *key, size_t keylen, request_type type,
nbytes = TEMP_FAILURE_RETRY (__read (sock, &pw_resp,
sizeof (pw_response_header)));
if (nbytes != sizeof (pw_response_header))
if (nbytes != (ssize_t) sizeof (pw_response_header))
{
__close (sock);
return -1;

View File

@ -1,4 +1,5 @@
/* Copyright (C) 1991-93,96-99,2000,01,02 Free Software Foundation, Inc.
/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003
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
@ -333,7 +334,7 @@ fnmatch (pattern, string, flags)
/* Convert the strings into wide characters. */
memset (&ps, '\0', sizeof (ps));
n = mbsrtowcs (NULL, &pattern, 0, &ps);
if (__builtin_expect (n, 0) == (size_t) -1)
if (__builtin_expect (n == (size_t) -1, 0))
/* Something wrong.
XXX Do we have to set `errno' to something which mbsrtows hasn't
already done? */
@ -344,7 +345,7 @@ fnmatch (pattern, string, flags)
assert (mbsinit (&ps));
n = mbsrtowcs (NULL, &string, 0, &ps);
if (__builtin_expect (n, 0) == (size_t) -1)
if (__builtin_expect (n == (size_t) -1, 0))
/* Something wrong.
XXX Do we have to set `errno' to something which mbsrtows hasn't
already done? */

View File

@ -1,5 +1,5 @@
/* chown() compatibility.
Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
Copyright (C) 1998, 2000, 2002, 2003 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
@ -42,7 +42,7 @@ __chown (const char *file, uid_t owner, gid_t group)
char link[PATH_MAX+2];
char path[2*PATH_MAX+4];
int loopct;
int filelen;
size_t filelen;
static int libc_old_chown = 0 /* -1=old linux, 1=new linux, 0=unknown */;
if (libc_old_chown == 1)
@ -82,7 +82,7 @@ __chown (const char *file, uid_t owner, gid_t group)
ENAMETOOLONG before this, usually. */
for (loopct = 0; loopct < 128; loopct++)
{
int linklen;
size_t linklen;
if (err >= PATH_MAX+1)
{

View File

@ -69,4 +69,4 @@ weak_extern (__cache_line_size)
} while (0)
#endif
#include_next <sysdeps/unix/sysv/linux/dl-sysdep.c>
#include <sysdeps/unix/sysv/linux/dl-sysdep.c>