From: tholo Date: Thu, 12 Dec 1996 03:19:55 +0000 (+0000) Subject: Update {hton,ntoh}[ls] argument and return types to match changes in X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=843f239316503e37abd866d72991c0527a249594;p=openbsd Update {hton,ntoh}[ls] argument and return types to match changes in --- diff --git a/lib/libc/net/htonl.c b/lib/libc/net/htonl.c index 2373c170e73..73b74327317 100644 --- a/lib/libc/net/htonl.c +++ b/lib/libc/net/htonl.c @@ -4,7 +4,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: htonl.c,v 1.3 1996/08/19 08:29:04 tholo Exp $"; +static char *rcsid = "$OpenBSD: htonl.c,v 1.4 1996/12/12 03:19:55 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -12,16 +12,14 @@ static char *rcsid = "$OpenBSD: htonl.c,v 1.3 1996/08/19 08:29:04 tholo Exp $"; #undef htonl -unsigned long +u_int32_t htonl(x) - unsigned long x; + u_int32_t x; { - u_int32_t y = x; - #if BYTE_ORDER == LITTLE_ENDIAN - u_char *s = (u_char *)&y; + u_char *s = (u_char *)&x; return (u_int32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]); #else - return y; + return x; #endif } diff --git a/lib/libc/net/htons.c b/lib/libc/net/htons.c index f0554f21663..e647d8c91e4 100644 --- a/lib/libc/net/htons.c +++ b/lib/libc/net/htons.c @@ -4,7 +4,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: htons.c,v 1.4 1996/08/19 08:29:05 tholo Exp $"; +static char *rcsid = "$OpenBSD: htons.c,v 1.5 1996/12/12 03:19:55 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -12,12 +12,12 @@ static char *rcsid = "$OpenBSD: htons.c,v 1.4 1996/08/19 08:29:05 tholo Exp $"; #undef htons -unsigned short +u_int16_t #if __STDC__ -htons(unsigned short x) +htons(u_int16_t x) #else htons(x) - unsigned short x; + u_int16_t x; #endif { #if BYTE_ORDER == LITTLE_ENDIAN diff --git a/lib/libc/net/ntohl.c b/lib/libc/net/ntohl.c index 0947a071aeb..7d3e227e607 100644 --- a/lib/libc/net/ntohl.c +++ b/lib/libc/net/ntohl.c @@ -4,7 +4,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: ntohl.c,v 1.3 1996/08/19 08:29:33 tholo Exp $"; +static char *rcsid = "$OpenBSD: ntohl.c,v 1.4 1996/12/12 03:19:56 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -12,16 +12,14 @@ static char *rcsid = "$OpenBSD: ntohl.c,v 1.3 1996/08/19 08:29:33 tholo Exp $"; #undef ntohl -unsigned long +u_int32_t ntohl(x) - unsigned long x; + u_int32_t x; { - u_int32_t y = x; - #if BYTE_ORDER == LITTLE_ENDIAN - u_char *s = (u_char *)&y; + u_char *s = (u_char *)&x; return (u_int32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]); #else - return y; + return x; #endif } diff --git a/lib/libc/net/ntohs.c b/lib/libc/net/ntohs.c index f7170398031..129729aa323 100644 --- a/lib/libc/net/ntohs.c +++ b/lib/libc/net/ntohs.c @@ -4,7 +4,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: ntohs.c,v 1.4 1996/08/19 08:29:35 tholo Exp $"; +static char *rcsid = "$OpenBSD: ntohs.c,v 1.5 1996/12/12 03:19:56 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -12,12 +12,12 @@ static char *rcsid = "$OpenBSD: ntohs.c,v 1.4 1996/08/19 08:29:35 tholo Exp $"; #undef ntohs -unsigned short +u_int16_t #if __STDC__ -ntohs(unsigned short x) +ntohs(u_int16_t x) #else ntohs(x) - unsigned short x; + u_int16_t x; #endif { #if BYTE_ORDER == LITTLE_ENDIAN