diff options
| author | itojun <itojun@NetBSD.org> | 2001-08-22 07:42:07 +0000 |
|---|---|---|
| committer | itojun <itojun@NetBSD.org> | 2001-08-22 07:42:07 +0000 |
| commit | 9fe945f2fe7460cdfd646bb69b14783c12288da9 (patch) | |
| tree | 7226bd3b9f18ba8788ee036afd6313ec09a4f572 /sys/lib | |
| parent | d3320a155b80f1591057652b5ddf33d328068e62 (diff) | |
sync argument/return type of [hn]to[nh][ls] to XNET 5.2 (uint{16,32}_t).
as discussed on tech-net.
Diffstat (limited to 'sys/lib')
| -rw-r--r-- | sys/lib/libkern/htonl.c | 10 | ||||
| -rw-r--r-- | sys/lib/libkern/htons.c | 10 | ||||
| -rw-r--r-- | sys/lib/libkern/ntohl.c | 10 | ||||
| -rw-r--r-- | sys/lib/libkern/ntohs.c | 10 |
4 files changed, 20 insertions, 20 deletions
diff --git a/sys/lib/libkern/htonl.c b/sys/lib/libkern/htonl.c index 6c41061c75b..3bbcaf3a4e6 100644 --- a/sys/lib/libkern/htonl.c +++ b/sys/lib/libkern/htonl.c @@ -1,4 +1,4 @@ -/* $NetBSD: htonl.c,v 1.9 1998/03/27 01:30:01 cgd Exp $ */ +/* $NetBSD: htonl.c,v 1.10 2001/08/22 07:42:08 itojun Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. @@ -7,20 +7,20 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: htonl.c,v 1.9 1998/03/27 01:30:01 cgd Exp $"); +__RCSID("$NetBSD: htonl.c,v 1.10 2001/08/22 07:42:08 itojun Exp $"); #endif #include <sys/types.h> #undef htonl -in_addr_t +uint32_t htonl(x) - in_addr_t x; + uint32_t x; { #if BYTE_ORDER == LITTLE_ENDIAN u_char *s = (u_char *)&x; - return (in_addr_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]); + return (uint32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]); #else return x; #endif diff --git a/sys/lib/libkern/htons.c b/sys/lib/libkern/htons.c index 8e2565f066b..b4a087824f0 100644 --- a/sys/lib/libkern/htons.c +++ b/sys/lib/libkern/htons.c @@ -1,4 +1,4 @@ -/* $NetBSD: htons.c,v 1.9 1998/03/27 01:30:02 cgd Exp $ */ +/* $NetBSD: htons.c,v 1.10 2001/08/22 07:42:08 itojun Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. @@ -7,20 +7,20 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: htons.c,v 1.9 1998/03/27 01:30:02 cgd Exp $"); +__RCSID("$NetBSD: htons.c,v 1.10 2001/08/22 07:42:08 itojun Exp $"); #endif #include <sys/types.h> #undef htons -in_port_t +uint16_t htons(x) - in_port_t x; + uint16_t x; { #if BYTE_ORDER == LITTLE_ENDIAN u_char *s = (u_char *) &x; - return (in_port_t)(s[0] << 8 | s[1]); + return (uint16_t)(s[0] << 8 | s[1]); #else return x; #endif diff --git a/sys/lib/libkern/ntohl.c b/sys/lib/libkern/ntohl.c index 65561c18bc8..4618557dfcf 100644 --- a/sys/lib/libkern/ntohl.c +++ b/sys/lib/libkern/ntohl.c @@ -1,4 +1,4 @@ -/* $NetBSD: ntohl.c,v 1.9 1998/03/27 01:30:06 cgd Exp $ */ +/* $NetBSD: ntohl.c,v 1.10 2001/08/22 07:42:08 itojun Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. @@ -7,20 +7,20 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: ntohl.c,v 1.9 1998/03/27 01:30:06 cgd Exp $"); +__RCSID("$NetBSD: ntohl.c,v 1.10 2001/08/22 07:42:08 itojun Exp $"); #endif #include <sys/types.h> #undef ntohl -in_addr_t +uint32_t ntohl(x) - in_addr_t x; + uint32_t x; { #if BYTE_ORDER == LITTLE_ENDIAN u_char *s = (u_char *)&x; - return (in_addr_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]); + return (uint32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]); #else return x; #endif diff --git a/sys/lib/libkern/ntohs.c b/sys/lib/libkern/ntohs.c index 74fce04e10c..db07faca98a 100644 --- a/sys/lib/libkern/ntohs.c +++ b/sys/lib/libkern/ntohs.c @@ -1,4 +1,4 @@ -/* $NetBSD: ntohs.c,v 1.8 1998/03/27 01:30:07 cgd Exp $ */ +/* $NetBSD: ntohs.c,v 1.9 2001/08/22 07:42:08 itojun Exp $ */ /* * Written by J.T. Conklin <jtc@netbsd.org>. @@ -7,20 +7,20 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: ntohs.c,v 1.8 1998/03/27 01:30:07 cgd Exp $"); +__RCSID("$NetBSD: ntohs.c,v 1.9 2001/08/22 07:42:08 itojun Exp $"); #endif #include <sys/types.h> #undef ntohs -in_port_t +uint16_t ntohs(x) - in_port_t x; + uint16_t x; { #if BYTE_ORDER == LITTLE_ENDIAN u_char *s = (u_char *) &x; - return (in_port_t)(s[0] << 8 | s[1]); + return (uint16_t)(s[0] << 8 | s[1]); #else return x; #endif |
