* nscd/cache.c (cache_search): Give first arg type `request_type'.
authorRoland McGrath <roland@gnu.org>
Sun, 16 Mar 2003 01:04:03 +0000 (01:04 +0000)
committerRoland McGrath <roland@gnu.org>
Sun, 16 Mar 2003 01:04:03 +0000 (01:04 +0000)
* 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.

13 files changed:
ChangeLog
elf/cache.c
elf/dl-close.c
include/ctype.h
io/fts.c
locale/programs/locarchive.c
nscd/cache.c
nscd/nscd.h
nscd/nscd_getgr_r.c
nscd/nscd_getpw_r.c
posix/fnmatch.c
sysdeps/unix/sysv/linux/powerpc/chown.c
sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c

index 1815e944d7304292183b8d082764b87d81de45f6..82a20dd8c87f5026d8f7f4cbe29fc1e2fe9f85fd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index e34ea5ccf524d38373995ffac4d0624ee07f4469..eda1ce2d8ed390a67371cf0a33b055cbad7ac7df 100644 (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));
 
index 1d4a8c3653bbcb4a203afa70454fcb8e6e80c637..5a61ad0aed40bea06c228da841cf415f8d49029c 100644 (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
index ca3c3dd8564674b3cb322dbf700392cd0492577c..aad0aad5304b4cb1d8e1fbcf17b8a40161ea9f18 100644 (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.  */
index 35374a094a708f0edb8b54168979a94bc819846d..91d2ef629879cf3340262dcebf3c2621b6238307 100644 (file)
--- a/io/fts.c
+++ b/io/fts.c
@@ -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. */
index 10017a214e021c8680b9ccb82c90f21d33fc5bee..64e1467109fa792104c962314c9051fdb6675fa6 100644 (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.  */
index 31a867adf5579ed45912f7c73f8baacdbb53e5dc..d8339e915d24459c0254522030e52dbbba781f1b 100644 (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;
index 11a30176df2522a8653b41899f8bc6bb2ad13bdb..f500b1598f0166c1a11f7bf5bab41b030c59bc6d 100644 (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,
index 49f4b51304fc41a91927de7923b154d2b26d12f6..2d09ed92f245038c97a1f923d730da78a0914ff3 100644 (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;
index f4fa75fa6f845fb8ac29869e7dbd57441aeb943b..160e9ffa27b3ca6f9d78afae7544a87c1db23539 100644 (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;
index b677e4bf410f021ac0fb987457a7e7eef47ae0e4..c521a25b7005bab8f23c18bd105e2cab38504537 100644 (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?  */
index 797b41f01c1fb64b63bf2fab3489842c45bf564a..182c5e787a10728c761a39e2a33a7c155e7c866a 100644 (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)
        {
index 64e4e2c4d36499582c9b8eb039db65b3a3627e3c..a548a963252ff9a42e60b6967f1de6bfaefb4b0b 100644 (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>