From 4b77e72e946881bb361e2560e8f65e619a8fd494 Mon Sep 17 00:00:00 2001 From: kleink Date: Tue, 14 May 2002 14:35:36 +0000 Subject: [PATCH] More XNS5.2/POSIX-2001 alignment: change the flags argument to getnameinfo() from int to unsigned int. --- include/netdb.h | 4 ++-- lib/libc/net/getnameinfo.3 | 5 +++-- lib/libc/net/getnameinfo.c | 24 +++++++++++++----------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/include/netdb.h b/include/netdb.h index e9b77cadcb67..cf5cfb003297 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -1,4 +1,4 @@ -/* $NetBSD: netdb.h,v 1.24 2002/05/14 14:31:05 kleink Exp $ */ +/* $NetBSD: netdb.h,v 1.25 2002/05/14 14:35:36 kleink Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -319,7 +319,7 @@ void setprotoent __P((int)); int getaddrinfo __P((const char *, const char *, const struct addrinfo *, struct addrinfo **)); int getnameinfo __P((const struct sockaddr *, socklen_t, char *, - socklen_t, char *, socklen_t, int)); + socklen_t, char *, socklen_t, unsigned int)); void freeaddrinfo __P((struct addrinfo *)); char *gai_strerror __P((int)); #endif diff --git a/lib/libc/net/getnameinfo.3 b/lib/libc/net/getnameinfo.3 index 73c69ff28514..fddc9969bb59 100644 --- a/lib/libc/net/getnameinfo.3 +++ b/lib/libc/net/getnameinfo.3 @@ -1,4 +1,4 @@ -.\" $NetBSD: getnameinfo.3,v 1.18 2002/05/14 14:31:06 kleink Exp $ +.\" $NetBSD: getnameinfo.3,v 1.19 2002/05/14 14:35:36 kleink Exp $ .\" $KAME: getnameinfo.3,v 1.20 2001/01/05 13:37:37 itojun Exp $ .\" .\" Copyright (c) 1983, 1987, 1991, 1993 @@ -51,7 +51,8 @@ .Fd #include \*[Lt]netdb.h\*[Gt] .Ft int .Fn getnameinfo "const struct sockaddr *sa" "socklen_t salen" \ -"char *host" "socklen_t hostlen" "char *serv" "socklen_t servlen" "int flags" +"char *host" "socklen_t hostlen" "char *serv" "socklen_t servlen" \ +"unsigned int flags" .\" .Sh DESCRIPTION The diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c index 7b114bc6a861..06d7213ad425 100644 --- a/lib/libc/net/getnameinfo.c +++ b/lib/libc/net/getnameinfo.c @@ -1,4 +1,4 @@ -/* $NetBSD: getnameinfo.c,v 1.36 2002/05/14 14:31:06 kleink Exp $ */ +/* $NetBSD: getnameinfo.c,v 1.37 2002/05/14 14:35:36 kleink Exp $ */ /* $KAME: getnameinfo.c,v 1.45 2000/09/25 22:43:56 itojun Exp $ */ /* @@ -47,7 +47,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: getnameinfo.c,v 1.36 2002/05/14 14:31:06 kleink Exp $"); +__RCSID("$NetBSD: getnameinfo.c,v 1.37 2002/05/14 14:35:36 kleink Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -93,14 +93,15 @@ struct sockinet { }; static int getnameinfo_inet __P((const struct sockaddr *, socklen_t, char *, - socklen_t, char *, socklen_t, int)); + socklen_t, char *, socklen_t, unsigned int)); #ifdef INET6 static int ip6_parsenumeric __P((const struct sockaddr *, const char *, char *, - socklen_t, int)); -static int ip6_sa2str __P((const struct sockaddr_in6 *, char *, size_t, int)); + socklen_t, unsigned int)); +static int ip6_sa2str __P((const struct sockaddr_in6 *, char *, size_t, + unsigned int)); #endif static int getnameinfo_link __P((const struct sockaddr *, socklen_t, char *, - socklen_t, char *, socklen_t, int)); + socklen_t, char *, socklen_t, unsigned int)); static int hexname __P((const u_int8_t *, size_t, char *, socklen_t)); /* @@ -113,7 +114,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) socklen_t salen; char *host, *serv; socklen_t hostlen, servlen; - int flags; + unsigned int flags; { switch (sa->sa_family) { @@ -142,7 +143,7 @@ getnameinfo_inet(sa, salen, host, hostlen, serv, servlen, flags) socklen_t hostlen; char *serv; socklen_t servlen; - int flags; + unsigned int flags; { const struct afd *afd; struct servent *sp; @@ -335,7 +336,7 @@ ip6_parsenumeric(sa, addr, host, hostlen, flags) const char *addr; char *host; socklen_t hostlen; - int flags; + unsigned int flags; { int numaddrlen; char numaddr[512]; @@ -379,7 +380,7 @@ ip6_sa2str(sa6, buf, bufsiz, flags) const struct sockaddr_in6 *sa6; char *buf; size_t bufsiz; - int flags; + unsigned int flags; { unsigned int ifindex; const struct in6_addr *a6; @@ -428,7 +429,8 @@ ip6_sa2str(sa6, buf, bufsiz, flags) /* ARGSUSED */ static int getnameinfo_link(const struct sockaddr *sa, socklen_t salen, - char *host, socklen_t hostlen, char *serv, socklen_t servlen, int flags) + char *host, socklen_t hostlen, char *serv, socklen_t servlen, + unsigned int flags) { const struct sockaddr_dl *sdl = (const struct sockaddr_dl *)(const void *)sa;