From 832e8b7f9a7422b49453b7e389ec411d3037a50f Mon Sep 17 00:00:00 2001 From: nectar Date: Sun, 16 Feb 2003 17:29:11 +0000 Subject: Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go). Only warnings that could be fixed without changing the generated object code and without restructuring the source code have been handled. Reviewed by: /sbin/md5 --- lib/libc/gen/getgrouplist.c | 2 +- lib/libc/gen/getpwent.c | 5 +---- lib/libc/gen/sem.c | 2 ++ lib/libc/gen/semctl.c | 2 ++ lib/libc/gen/sysctl.c | 3 +++ lib/libc/gen/unvis.c | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) (limited to 'lib/libc/gen') diff --git a/lib/libc/gen/getgrouplist.c b/lib/libc/gen/getgrouplist.c index 52ee620..40d55fc 100644 --- a/lib/libc/gen/getgrouplist.c +++ b/lib/libc/gen/getgrouplist.c @@ -69,7 +69,7 @@ getgrouplist(uname, agroup, groups, grpcnt) * Scan the group file to find additional groups. */ setgrent(); - while (grp = getgrent()) { + while ((grp = getgrent()) != NULL) { for (i = 0; i < ngroups; i++) { if (grp->gr_gid == groups[i]) goto skip; diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index a3bfed8..cf7c644 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef HESIOD #include #endif @@ -64,10 +65,6 @@ __FBSDID("$FreeBSD$"); #endif #include "un-namespace.h" -extern void setnetgrent(char *); -extern int getnetgrent(char **, char **, char **); -extern int innetgr(const char *, const char *, const char *, const char *); - #include "pw_scan.h" #if defined(YP) || defined(HESIOD) diff --git a/lib/libc/gen/sem.c b/lib/libc/gen/sem.c index d1cf10e..e37eccd 100644 --- a/lib/libc/gen/sem.c +++ b/lib/libc/gen/sem.c @@ -29,6 +29,7 @@ * $FreeBSD$ */ +#include "namespace.h" #include #include #include @@ -37,6 +38,7 @@ #include #include #include <_semaphore.h> +#include "un-namespace.h" #define _SEM_CHECK_VALIDITY(sem) \ if ((*(sem))->magic != SEM_MAGIC) { \ diff --git a/lib/libc/gen/semctl.c b/lib/libc/gen/semctl.c index 0322743..4b5283f 100644 --- a/lib/libc/gen/semctl.c +++ b/lib/libc/gen/semctl.c @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include +extern int __semctl(int semid, int semnum, int cmd, union semun *arg); + int semctl(int semid, int semnum, int cmd, ...) { va_list ap; diff --git a/lib/libc/gen/sysctl.c b/lib/libc/gen/sysctl.c index ad39ff6..525175a1 100644 --- a/lib/libc/gen/sysctl.c +++ b/lib/libc/gen/sysctl.c @@ -47,6 +47,9 @@ __FBSDID("$FreeBSD$"); #include #include +extern int __sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, + void *newp, size_t newlen); + int sysctl(name, namelen, oldp, oldlenp, newp, newlen) int *name; diff --git a/lib/libc/gen/unvis.c b/lib/libc/gen/unvis.c index df6b18f..94a6726 100644 --- a/lib/libc/gen/unvis.c +++ b/lib/libc/gen/unvis.c @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); #define S_HTTP 0x080 /* %HEXHEX escape */ #define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7') -#define ishex(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '9' || ((u_char)(c)) >= 'a' && ((u_char)(c)) <= 'f') +#define ishex(c) ((((u_char)(c)) >= '0' && ((u_char)(c)) <= '9') || (((u_char)(c)) >= 'a' && ((u_char)(c)) <= 'f')) /* * unvis - decode characters previously encoded by vis -- cgit v1.1