From 2bbd7cf8204609d07c36511f2a57ca282f05b6f2 Mon Sep 17 00:00:00 2001 From: Jacques Vidrine Date: Thu, 27 Feb 2003 13:40:01 +0000 Subject: [PATCH] Eliminate 19 warnings in libc (at level WARNS=2) of the `implicit declaration of function' variety. --- include/resolv.h | 5 +++++ lib/libc/gen/getpwent.c | 1 + lib/libc/gen/nlist.c | 1 + lib/libc/include/libc_private.h | 8 ++++++++ lib/libc/net/getaddrinfo.c | 2 +- lib/libc/net/getservent.c | 3 +-- lib/libc/net/nsdispatch.c | 2 ++ lib/libc/net/nslexer.l | 2 ++ lib/libc/net/rcmdsh.c | 4 +++- lib/libc/posix1e/mac_set.c | 5 +++++ lib/libc/rpc/Makefile.inc | 1 + lib/libc/rpc/getrpcent.c | 2 +- lib/libc/rpc/rpc_com.h | 5 +++++ lib/libc/rpc/svc_run.c | 1 + lib/libc/xdr/xdr_rec.c | 1 + 15 files changed, 38 insertions(+), 5 deletions(-) diff --git a/include/resolv.h b/include/resolv.h index 6b5796191ecc..12d14b4fafd6 100644 --- a/include/resolv.h +++ b/include/resolv.h @@ -307,6 +307,11 @@ int res_queriesmatch(const u_char *, const u_char *, void res_close(void); int res_opt(int, u_char *, int, int); const char * p_section(int, int); +/* XXX These must be exported for BIND4 compatibility. */ +void __putlong(u_int32_t, u_char *); +void __putshort(u_int16_t, u_char *); +u_int32_t _getlong(const u_char *); +u_int16_t _getshort(const u_char *); /* XXX The following depend on the ns_updrec typedef in arpa/nameser.h */ #ifdef _ARPA_NAMESER_H_ int res_update(ns_updrec *); diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index cf7c644ba8c5..63cec214b9e3 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include "un-namespace.h" +#include "libc_private.h" #include "pw_scan.h" diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c index 612576257569..b52d7c2a82e3 100644 --- a/lib/libc/gen/nlist.c +++ b/lib/libc/gen/nlist.c @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 3736c56ac85b..f369cc7fe25c 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -106,6 +106,14 @@ typedef pthread_func_t pthread_func_entry_t[2]; extern pthread_func_entry_t __thr_jtable[]; +/* + * yplib internal interfaces + */ +#ifdef YP +int _yp_check(char **); +#endif + + /* * This is a pointer in the C run-time startup code. It is used * by getprogname() and setprogname(). diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index cbfa5cd55c38..37e680cd9f75 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "libc_private.h" #if defined(__KAME__) && defined(INET6) # define FAITH @@ -230,7 +231,6 @@ static int _files_getaddrinfo(void *, void *, va_list); #ifdef YP static struct addrinfo *_yphostent(char *, const struct addrinfo *); static int _yp_getaddrinfo(void *, void *, va_list); -extern int _yp_check(char **); #endif static int res_queryN(const char *, struct res_target *); diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c index 8397bfce901d..a89bc5173966 100644 --- a/lib/libc/net/getservent.c +++ b/lib/libc/net/getservent.c @@ -49,9 +49,8 @@ __FBSDID("$FreeBSD$"); #include #include static int serv_stepping_yp = 0; -extern int _yp_check( char ** ); #endif - +#include "libc_private.h" #define MAXALIASES 35 diff --git a/lib/libc/net/nsdispatch.c b/lib/libc/net/nsdispatch.c index 25da1073cc52..b7c59ff3439e 100644 --- a/lib/libc/net/nsdispatch.c +++ b/lib/libc/net/nsdispatch.c @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "namespace.h" #include #include #define _NS_PRIVATE @@ -51,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include "un-namespace.h" /* * default sourcelist: `files' diff --git a/lib/libc/net/nslexer.l b/lib/libc/net/nslexer.l index 5fa159eb77fe..ea210721ad59 100644 --- a/lib/libc/net/nslexer.l +++ b/lib/libc/net/nslexer.l @@ -43,11 +43,13 @@ static char *rcsid = "$FreeBSD$"; #endif /* LIBC_SCCS and not lint */ +#include "namespace.h" #include #include #define _NS_PRIVATE #include #include +#include "un-namespace.h" #include "nsparser.h" diff --git a/lib/libc/net/rcmdsh.c b/lib/libc/net/rcmdsh.c index 7972e34eeef2..bc4e87af9faf 100644 --- a/lib/libc/net/rcmdsh.c +++ b/lib/libc/net/rcmdsh.c @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -86,7 +87,8 @@ rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) hints.ai_flags = AI_CANONNAME; hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; - (void)snprintf(num, sizeof(num), "%d", ntohs(rport)); + (void)snprintf(num, sizeof(num), "%u", + (unsigned int)ntohs(rport)); error = getaddrinfo(*ahost, num, &hints, &res); if (error) { fprintf(stderr, "rcmdsh: getaddrinfo: %s\n", diff --git a/lib/libc/posix1e/mac_set.c b/lib/libc/posix1e/mac_set.c index 4e09576cbb44..4353ee64f1d8 100644 --- a/lib/libc/posix1e/mac_set.c +++ b/lib/libc/posix1e/mac_set.c @@ -34,6 +34,11 @@ #include #include +extern int __mac_set_fd(int fd, struct mac *mac_p); +extern int __mac_set_file(const char *path_p, struct mac *mac_p); +extern int __mac_set_link(const char *path_p, struct mac *mac_p); +extern int __mac_set_proc(struct mac *mac_p); + int mac_set_fd(int fd, struct mac *label) { diff --git a/lib/libc/rpc/Makefile.inc b/lib/libc/rpc/Makefile.inc index c349d5a727e6..2ea731a133f3 100644 --- a/lib/libc/rpc/Makefile.inc +++ b/lib/libc/rpc/Makefile.inc @@ -30,6 +30,7 @@ SRCS+= rtime.c SRCS+= crypt_clnt.c crypt_xdr.c crypt.h CFLAGS+= -DBROKEN_DES -DPORTMAP -DDES_BUILTIN +CFLAGS+= -I${.CURDIR}/rpc CLEANFILES+= crypt_clnt.c crypt_xdr.c crypt.h diff --git a/lib/libc/rpc/getrpcent.c b/lib/libc/rpc/getrpcent.c index 9e305d2756d6..b20d80d3498e 100644 --- a/lib/libc/rpc/getrpcent.c +++ b/lib/libc/rpc/getrpcent.c @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include "un-namespace.h" +#include "libc_private.h" /* * Internet version. @@ -80,7 +81,6 @@ static struct rpcent *interpret(char *val, size_t len); #ifdef YP static int __yp_nomap = 0; -extern int _yp_check(char **); #endif /* YP */ #define RPCDB "/etc/rpc" diff --git a/lib/libc/rpc/rpc_com.h b/lib/libc/rpc/rpc_com.h index 1f1fd9e1860e..a7cfd9730d04 100644 --- a/lib/libc/rpc/rpc_com.h +++ b/lib/libc/rpc/rpc_com.h @@ -84,6 +84,11 @@ bool_t __rpc_control(int,void *); char *_get_next_token(char *, int); +bool_t __svc_clean_idle(fd_set *, int, bool_t); +bool_t __xdrrec_setnonblock(XDR *, int); +bool_t __xdrrec_getrec(XDR *, enum xprt_stat *, bool_t); +void __xprt_unregister_unlocked(SVCXPRT *); + SVCXPRT **__svc_xports; int __svc_maxrec; diff --git a/lib/libc/rpc/svc_run.c b/lib/libc/rpc/svc_run.c index adacadb0903e..8b65475e15e3 100644 --- a/lib/libc/rpc/svc_run.c +++ b/lib/libc/rpc/svc_run.c @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include +#include "rpc_com.h" void svc_run() diff --git a/lib/libc/xdr/xdr_rec.c b/lib/libc/xdr/xdr_rec.c index e899ebb57c40..340febd55c9e 100644 --- a/lib/libc/xdr/xdr_rec.c +++ b/lib/libc/xdr/xdr_rec.c @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "rpc_com.h" static bool_t xdrrec_getlong(XDR *, long *); static bool_t xdrrec_putlong(XDR *, const long *);