summaryrefslogtreecommitdiff
path: root/lib/libc/net
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-10 06:20:09 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-10 06:20:09 +0000
commit560842d4cf949f39d53e6861b2bb97cb706fe5bf (patch)
treecfb7cc640708b37df752c76778254bff35990d98 /lib/libc/net
parent50cf773ce874b899c477500f5742d063ff08c2c5 (diff)
make 64 bit clean
Diffstat (limited to 'lib/libc/net')
-rw-r--r--lib/libc/net/htonl.c6
-rw-r--r--lib/libc/net/htons.c6
-rw-r--r--lib/libc/net/ntohl.c6
-rw-r--r--lib/libc/net/ntohs.c6
4 files changed, 12 insertions, 12 deletions
diff --git a/lib/libc/net/htonl.c b/lib/libc/net/htonl.c
index ac85cb0fd7d..d0a22e1f30d 100644
--- a/lib/libc/net/htonl.c
+++ b/lib/libc/net/htonl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: htonl.c,v 1.5 1995/04/28 23:25:14 jtc Exp $ */
+/* $NetBSD: htonl.c,v 1.5.6.1 1996/05/29 23:28:06 cgd Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
@@ -6,7 +6,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$NetBSD: htonl.c,v 1.5 1995/04/28 23:25:14 jtc Exp $";
+static char *rcsid = "$NetBSD: htonl.c,v 1.5.6.1 1996/05/29 23:28:06 cgd Exp $";
#endif
#include <sys/types.h>
@@ -22,7 +22,7 @@ htonl(x)
#if BYTE_ORDER == LITTLE_ENDIAN
u_char *s = (u_char *)&y;
- return s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3];
+ return (u_int32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]);
#else
return y;
#endif
diff --git a/lib/libc/net/htons.c b/lib/libc/net/htons.c
index 9b1de6ccfcf..0ecb62b95cd 100644
--- a/lib/libc/net/htons.c
+++ b/lib/libc/net/htons.c
@@ -1,4 +1,4 @@
-/* $NetBSD: htons.c,v 1.5 1995/04/28 23:25:19 jtc Exp $ */
+/* $NetBSD: htons.c,v 1.5.6.1 1996/05/29 23:28:19 cgd Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
@@ -6,7 +6,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$NetBSD: htons.c,v 1.5 1995/04/28 23:25:19 jtc Exp $";
+static char *rcsid = "$NetBSD: htons.c,v 1.5.6.1 1996/05/29 23:28:19 cgd Exp $";
#endif
#include <sys/types.h>
@@ -24,7 +24,7 @@ htons(x)
{
#if BYTE_ORDER == LITTLE_ENDIAN
u_char *s = (u_char *) &x;
- return s[0] << 8 | s[1];
+ return (u_int16_t)(s[0] << 8 | s[1]);
#else
return x;
#endif
diff --git a/lib/libc/net/ntohl.c b/lib/libc/net/ntohl.c
index 05b7f4c9a31..5df37075ac6 100644
--- a/lib/libc/net/ntohl.c
+++ b/lib/libc/net/ntohl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ntohl.c,v 1.5 1995/04/28 23:25:21 jtc Exp $ */
+/* $NetBSD: ntohl.c,v 1.5.6.1 1996/05/29 23:28:26 cgd Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
@@ -6,7 +6,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$NetBSD: ntohl.c,v 1.5 1995/04/28 23:25:21 jtc Exp $";
+static char *rcsid = "$NetBSD: ntohl.c,v 1.5.6.1 1996/05/29 23:28:26 cgd Exp $";
#endif
#include <sys/types.h>
@@ -22,7 +22,7 @@ ntohl(x)
#if BYTE_ORDER == LITTLE_ENDIAN
u_char *s = (u_char *)&y;
- return s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3];
+ return (u_int32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]);
#else
return y;
#endif
diff --git a/lib/libc/net/ntohs.c b/lib/libc/net/ntohs.c
index 6e180c16ab2..a665db9f399 100644
--- a/lib/libc/net/ntohs.c
+++ b/lib/libc/net/ntohs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ntohs.c,v 1.5 1995/04/28 23:25:23 jtc Exp $ */
+/* $NetBSD: ntohs.c,v 1.5.6.1 1996/05/29 23:28:33 cgd Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
@@ -6,7 +6,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$NetBSD: ntohs.c,v 1.5 1995/04/28 23:25:23 jtc Exp $";
+static char *rcsid = "$NetBSD: ntohs.c,v 1.5.6.1 1996/05/29 23:28:33 cgd Exp $";
#endif
#include <sys/types.h>
@@ -24,7 +24,7 @@ ntohs(x)
{
#if BYTE_ORDER == LITTLE_ENDIAN
u_char *s = (u_char *) &x;
- return s[0] << 8 | s[1];
+ return (u_int16_t)(s[0] << 8 | s[1]);
#else
return x;
#endif