Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Sep 2015 18:59:02 +0000 (UTC)
From:      Craig Rodrigues <rodrigc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r287797 - head/lib/libc/gen
Message-ID:  <201509141859.t8EIx2Hn017780@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rodrigc
Date: Mon Sep 14 18:59:01 2015
New Revision: 287797
URL: https://svnweb.freebsd.org/changeset/base/287797

Log:
  Use unsigned variables in a few places.
  
  Eliminates gcc 4.9 warnings.

Modified:
  head/lib/libc/gen/getgrent.c
  head/lib/libc/gen/getpwent.c
  head/lib/libc/gen/strtofflags.c

Modified: head/lib/libc/gen/getgrent.c
==============================================================================
--- head/lib/libc/gen/getgrent.c	Mon Sep 14 18:58:30 2015	(r287796)
+++ head/lib/libc/gen/getgrent.c	Mon Sep 14 18:59:01 2015	(r287797)
@@ -1238,7 +1238,7 @@ compat_setgrent(void *retval, void *mdat
 	int		 rv, stayopen;
 
 #define set_setent(x, y) do {	 				\
-	int i;							\
+	unsigned int i;						\
 								\
 	for (i = 0; i < (sizeof(x)/sizeof(x[0])) - 1; i++)	\
 		x[i].mdata = (void *)y;				\
@@ -1308,7 +1308,7 @@ compat_group(void *retval, void *mdata, 
 	int			 rv, stayopen, *errnop;
 
 #define set_lookup_type(x, y) do { 				\
-	int i;							\
+	unsigned int i;						\
 								\
 	for (i = 0; i < (sizeof(x)/sizeof(x[0])) - 1; i++)	\
 		x[i].mdata = (void *)y;				\

Modified: head/lib/libc/gen/getpwent.c
==============================================================================
--- head/lib/libc/gen/getpwent.c	Mon Sep 14 18:58:30 2015	(r287796)
+++ head/lib/libc/gen/getpwent.c	Mon Sep 14 18:59:01 2015	(r287797)
@@ -1607,7 +1607,8 @@ compat_redispatch(struct compat_state *s
 		{ NULL, NULL, NULL }
 	};
 	void		*discard;
-	int		 rv, e, i;
+	int		 rv, e;
+	unsigned int	 i;
 
 	for (i = 0; i < sizeof(dtab)/sizeof(dtab[0]) - 1; i++)
 		dtab[i].mdata = (void *)lookup_how;
@@ -1702,7 +1703,7 @@ compat_setpwent(void *retval, void *mdat
 	int			 rv, stayopen;
 
 #define set_setent(x, y) do {	 				\
-	int i;							\
+	unsigned int i;						\
 								\
 	for (i = 0; i < (sizeof(x)/sizeof(x[0])) - 1; i++)	\
 		x[i].mdata = (void *)y;				\

Modified: head/lib/libc/gen/strtofflags.c
==============================================================================
--- head/lib/libc/gen/strtofflags.c	Mon Sep 14 18:58:30 2015	(r287796)
+++ head/lib/libc/gen/strtofflags.c	Mon Sep 14 18:59:01 2015	(r287797)
@@ -100,7 +100,7 @@ fflagstostr(u_long flags)
 	const char *sp;
 	char *dp;
 	u_long setflags;
-	int i;
+	u_int i;
 
 	if ((string = (char *)malloc(nmappings * (longestflaglen + 1))) == NULL)
 		return (NULL);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509141859.t8EIx2Hn017780>