[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] some fixes for -Wall -Werror



Hi,

Attached are all the fixes I got through before a gcc ICE stopped me.  There
is a cast from char * to const char * in ugids-verify-auth.c which strikes
me as not a good thing but it would need a (new?) const char type for the
password_check_user and password_check_group interfaces and this is beyond
my proto-skills.

Bob
Index: libihash/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/libihash/ChangeLog,v
retrieving revision 1.5
diff -u -p -r1.5 ChangeLog
--- libihash/ChangeLog	15 Aug 2001 09:29:37 -0000	1.5
+++ libihash/ChangeLog	24 Jul 2003 23:33:56 -0000
@@ -1,3 +1,7 @@
+2003-07-24  Bob Ham  <rah@bash.sh>
+
+	* ihash.c: fixes for -Wall -Werror
+
 2001-08-15  Roland McGrath  <roland@frob.com>
 
 	* sizes.c: New file, a list of prime numbers useful for table sizes.
Index: libihash/ihash.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libihash/ihash.c,v
retrieving revision 1.6
diff -u -p -r1.6 ihash.c
--- libihash/ihash.c	15 Aug 2001 09:29:26 -0000	1.6
+++ libihash/ihash.c	24 Jul 2003 23:33:56 -0000
@@ -168,9 +168,9 @@ ihash_add(ihash_t ht, int id, void *item
     }
 
   {
-    int i;
+    unsigned int i;
     void **entry;
-    int old_size = ht->size;
+    unsigned int old_size = ht->size;
     void **old_tab = ht->tab;
     void ****old_locps = ht->locps;
     int *old_ids = ht->ids;
Index: libiohelp/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/libiohelp/ChangeLog,v
retrieving revision 1.15
diff -u -p -r1.15 ChangeLog
--- libiohelp/ChangeLog	2 Nov 2002 02:36:09 -0000	1.15
+++ libiohelp/ChangeLog	24 Jul 2003 23:33:56 -0000
@@ -1,3 +1,7 @@
+2003-07-24  Bob Ham  <rah@bash.sh>
+
+	* iouser-restrict.c: fixes for -Wall -Werror
+
 2002-11-01  Roland McGrath  <roland@frob.com>
 
 	* shared.c (iohelp_fetch_shared_data, iohelp_put_shared_data): Put
Index: libiohelp/iouser-restrict.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libiohelp/iouser-restrict.c,v
retrieving revision 1.1
diff -u -p -r1.1 iouser-restrict.c
--- libiohelp/iouser-restrict.c	5 May 2002 03:26:15 -0000	1.1
+++ libiohelp/iouser-restrict.c	24 Jul 2003 23:33:56 -0000
@@ -23,7 +23,7 @@ listmember (const uid_t *list, int query
 {
   int i;
   for (i = 0; i < n; i++)
-    if (list[i] == query)
+    if (list[i] == (unsigned int) query)
       return 1;
   return 0;
 }
@@ -40,7 +40,7 @@ iohelp_restrict_iouser (struct iouser **
   else
     {
       struct idvec *uvec, *gvec;
-      int i;
+      unsigned int i;
       error_t err;
 
       uvec = make_idvec ();
Index: libshouldbeinlibc/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/libshouldbeinlibc/ChangeLog,v
retrieving revision 1.82
diff -u -p -r1.82 ChangeLog
--- libshouldbeinlibc/ChangeLog	11 May 2002 22:46:27 -0000	1.82
+++ libshouldbeinlibc/ChangeLog	24 Jul 2003 23:34:02 -0000
@@ -1,3 +1,9 @@
+2003-07-24  Bob Ham  <rah@bash.sh>
+
+	* exec-reauth.c, idvec-impgids.c, idvec-rep.c, idvec-verify,
+	idvec.c, portxlate.c, timefmt.c, ugids-verify-auth.c: fixes
+	for -Wall -Werror
+
 2002-05-12  Marcus Brinkmann  <marcus@gnu.org>
 
 	* idvec-impgids.c (_merge_implied_gids): Free CACHE on failure.
Index: libshouldbeinlibc/exec-reauth.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libshouldbeinlibc/exec-reauth.c,v
retrieving revision 1.5
diff -u -p -r1.5 exec-reauth.c
--- libshouldbeinlibc/exec-reauth.c	17 Mar 2000 17:22:33 -0000	1.5
+++ libshouldbeinlibc/exec-reauth.c	24 Jul 2003 23:34:02 -0000
@@ -41,7 +41,7 @@ exec_reauth (auth_t auth, int secure, in
 	     mach_port_t *ports, unsigned num_ports,
 	     mach_port_t *fds, unsigned num_fds)
 {
-  int i;
+  unsigned int i;
   error_t err = 0;
 
   error_t reauth (mach_port_t *port, int isproc)
Index: libshouldbeinlibc/idvec-impgids.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libshouldbeinlibc/idvec-impgids.c,v
retrieving revision 1.4
diff -u -p -r1.4 idvec-impgids.c
--- libshouldbeinlibc/idvec-impgids.c	11 May 2002 22:46:27 -0000	1.4
+++ libshouldbeinlibc/idvec-impgids.c	24 Jul 2003 23:34:03 -0000
@@ -115,7 +115,7 @@ _merge_implied_gids (struct idvec *impli
 error_t
 idvec_merge_implied_gids (struct idvec *gids, const struct idvec *uids)
 {
-  int i;
+  unsigned int i;
   error_t err = 0;
   for (i = 0; i < uids->num; i++)
     {
Index: libshouldbeinlibc/idvec-rep.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libshouldbeinlibc/idvec-rep.c,v
retrieving revision 1.2
diff -u -p -r1.2 idvec-rep.c
--- libshouldbeinlibc/idvec-rep.c	20 Oct 1998 08:36:14 -0000	1.2
+++ libshouldbeinlibc/idvec-rep.c	24 Jul 2003 23:34:03 -0000
@@ -87,7 +87,7 @@ idvec_rep (const struct idvec *idvec, in
 
   if (idvec->num > 0)
     {
-      int i;
+      unsigned int i;
 
       for (i = 0; i < idvec->num; i++)
 	{
Index: libshouldbeinlibc/idvec-verify.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libshouldbeinlibc/idvec-verify.c,v
retrieving revision 1.8
diff -u -p -r1.8 idvec-verify.c
--- libshouldbeinlibc/idvec-verify.c	8 May 2002 09:24:09 -0000	1.8
+++ libshouldbeinlibc/idvec-verify.c	24 Jul 2003 23:34:03 -0000
@@ -158,7 +158,7 @@ idvec_verify (const struct idvec *uids, 
     return 0;
   else
     {
-      int i;
+      unsigned int i;
       int multiple = 0;		/* Asking for multiple ids? */
       error_t  err = 0;		/* Our return status.  */
       struct idvec implied_gids = IDVEC_INIT; /* Gids implied by uids.  */
Index: libshouldbeinlibc/idvec.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libshouldbeinlibc/idvec.c,v
retrieving revision 1.14
diff -u -p -r1.14 idvec.c
--- libshouldbeinlibc/idvec.c	30 Sep 1999 15:07:42 -0000	1.14
+++ libshouldbeinlibc/idvec.c	24 Jul 2003 23:34:04 -0000
@@ -184,7 +184,7 @@ idvec_merge_ids (struct idvec *idvec, co
   unsigned num_old = idvec->num;
   while (num-- > 0 && !err)
     {
-      int i;
+      unsigned int i;
       for (i = 0; i < num_old; i++)
 	if (idvec->ids[i] == *ids)
 	  break;
@@ -234,7 +234,7 @@ idvec_remove (struct idvec *idvec, unsig
 int
 idvec_subtract (struct idvec *idvec, const struct idvec *sub)
 {
-  int i;
+  unsigned int i;
   int done = 0;
   for (i = 0; i < sub->num; i++)
     done |= idvec_remove (idvec, 0, sub->ids[i]);
Index: libshouldbeinlibc/portxlate.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libshouldbeinlibc/portxlate.c,v
retrieving revision 1.6
diff -u -p -r1.6 portxlate.c
--- libshouldbeinlibc/portxlate.c	8 May 2002 09:24:16 -0000	1.6
+++ libshouldbeinlibc/portxlate.c	24 Jul 2003 23:34:04 -0000
@@ -54,7 +54,7 @@ port_name_xlator_create (mach_port_t fro
       x->ports = malloc (sizeof (mach_port_t) * x->to_names_len);
       if (x->ports)
 	{
-	  int i;
+	  unsigned int i;
 	  for (i = 0; i < x->to_names_len; i++)
 	    x->ports[i] = MACH_PORT_NULL;
 	}
@@ -80,7 +80,7 @@ port_name_xlator_create (mach_port_t fro
 void
 port_name_xlator_free (struct port_name_xlator *x)
 {
-  int i;
+  unsigned int i;
 
   for (i = 0; i < x->to_names_len; i++)
     if (x->ports[i] != MACH_PORT_NULL)
Index: libshouldbeinlibc/timefmt.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libshouldbeinlibc/timefmt.c,v
retrieving revision 1.13
diff -u -p -r1.13 timefmt.c
--- libshouldbeinlibc/timefmt.c	20 Feb 2001 19:36:55 -0000	1.13
+++ libshouldbeinlibc/timefmt.c	24 Jul 2003 23:34:05 -0000
@@ -226,7 +226,7 @@ fmt_seconds (struct timeval *tv, int lea
   p += add_field (&secs, MINUTE, &leading_zeros, 4, ":", width, p);
   p += add_field (&secs, SECOND, &leading_zeros, 1, "", width, p);
 
-  if (frac_places < 0 && (p - buf) < width - 2)
+  if (frac_places < 0 && (p - buf) < (int) width - 2)
     /* If FRAC_PLACES is < 0, then use any space remaining before WIDTH.  */
     frac_places = width - (p - buf) - 1;
 
Index: libshouldbeinlibc/ugids-verify-auth.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libshouldbeinlibc/ugids-verify-auth.c,v
retrieving revision 1.7
diff -u -p -r1.7 ugids-verify-auth.c
--- libshouldbeinlibc/ugids-verify-auth.c	26 Apr 1999 01:40:11 -0000	1.7
+++ libshouldbeinlibc/ugids-verify-auth.c	24 Jul 2003 23:34:07 -0000
@@ -70,9 +70,10 @@ server_verify_make_auth (const char *pas
 {
   auth_t auth;
   struct svma_state *svma_state = hook;
-  error_t (*check) (io_t server, uid_t id, const char *passwd, auth_t *auth) =
+  error_t (*check) (io_t server, uid_t id, char *passwd, auth_t *auth) =
     is_group ? password_check_group : password_check_user;
-  error_t err = (*check) (svma_state->server, id, password, &auth);
+  error_t err = (*check) (svma_state->server, id,
+			  (char *) password, &auth);
 
   if (! err)
     /* PASSWORD checked out ok; the corresponding authentication is in AUTH. */
@@ -173,7 +174,7 @@ ugids_verify_make_auth (const struct ugi
   if (verify_fn)
     /* Clean up any left over state.  */
     {
-      int i;
+      unsigned int i;
 
       /* Get rid of auth ports.  */
       for (i = 0; i < svma_state.num_auths; i++)
Index: libthreads/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/libthreads/ChangeLog,v
retrieving revision 1.41
diff -u -p -r1.41 ChangeLog
--- libthreads/ChangeLog	30 Aug 2002 00:28:09 -0000	1.41
+++ libthreads/ChangeLog	24 Jul 2003 23:34:07 -0000
@@ -1,3 +1,8 @@
+2003-07-24  Bob Ham  <rah@bash.sh>
+
+	* cthread_internals.h: added declaration for cproc_block
+	(to fix -Wall -Werror)
+
 2002-08-26  Roland McGrath  <roland@frob.com>
 
 	* cthreads.c (cthread_body) [HAVE_USELOCALE]: Call uselocale to
Index: libthreads/cthread_internals.h
===================================================================
RCS file: /cvsroot/hurd/hurd/libthreads/cthread_internals.h,v
retrieving revision 1.6
diff -u -p -r1.6 cthread_internals.h
--- libthreads/cthread_internals.h	27 May 2002 02:50:10 -0000	1.6
+++ libthreads/cthread_internals.h	24 Jul 2003 23:34:08 -0000
@@ -274,6 +274,8 @@ extern vm_offset_t	cproc_init(void);
 
 extern void		cproc_waiting(cproc_t _waiter);
 
+extern void             cproc_block(void);
+
 extern cproc_t		cproc_create(void);
 
 extern void		cproc_fork_prepare(void);

Reply to: