svn commit: r287797 - head/lib/libc/gen
Craig Rodrigues
rodrigc at FreeBSD.org
Mon Sep 14 18:59:03 UTC 2015
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);
More information about the svn-src-head
mailing list