summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-10 07:27:43 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-10 07:27:43 +0000
commit9e7b57ade6273cbd06e5aed1ed69dc20ba4cc058 (patch)
tree313b0e57f7e0b6c7dc0fd329a63ac2d13b55e9bd /sys
parent447b309043ea6f3bfca72e16ad920046e2973d5c (diff)
64 bit clean
Diffstat (limited to 'sys')
-rw-r--r--sys/lib/libkern/htonl.c6
-rw-r--r--sys/lib/libkern/htons.c6
-rw-r--r--sys/lib/libkern/ntohl.c6
-rw-r--r--sys/lib/libkern/ntohs.c6
4 files changed, 12 insertions, 12 deletions
diff --git a/sys/lib/libkern/htonl.c b/sys/lib/libkern/htonl.c
index 971757f2028..eba75f7e2c6 100644
--- a/sys/lib/libkern/htonl.c
+++ b/sys/lib/libkern/htonl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: htonl.c,v 1.6 1995/10/07 09:26:26 mycroft Exp $ */
+/* $NetBSD: htonl.c,v 1.6.6.1 1996/05/29 23:47:55 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.6 1995/10/07 09:26:26 mycroft Exp $";
+static char *rcsid = "$NetBSD: htonl.c,v 1.6.6.1 1996/05/29 23:47:55 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/sys/lib/libkern/htons.c b/sys/lib/libkern/htons.c
index 6d491588b59..0b60f639f8e 100644
--- a/sys/lib/libkern/htons.c
+++ b/sys/lib/libkern/htons.c
@@ -1,4 +1,4 @@
-/* $NetBSD: htons.c,v 1.6 1995/10/07 09:26:27 mycroft Exp $ */
+/* $NetBSD: htons.c,v 1.6.6.1 1996/05/29 23:48:02 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.6 1995/10/07 09:26:27 mycroft Exp $";
+static char *rcsid = "$NetBSD: htons.c,v 1.6.6.1 1996/05/29 23:48:02 cgd Exp $";
#endif
#include <sys/types.h>
@@ -20,7 +20,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/sys/lib/libkern/ntohl.c b/sys/lib/libkern/ntohl.c
index 6f9f2de0f22..167ee5f9b66 100644
--- a/sys/lib/libkern/ntohl.c
+++ b/sys/lib/libkern/ntohl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ntohl.c,v 1.6 1995/10/07 09:26:38 mycroft Exp $ */
+/* $NetBSD: ntohl.c,v 1.6.6.1 1996/05/29 23:48:07 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.6 1995/10/07 09:26:38 mycroft Exp $";
+static char *rcsid = "$NetBSD: ntohl.c,v 1.6.6.1 1996/05/29 23:48:07 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/sys/lib/libkern/ntohs.c b/sys/lib/libkern/ntohs.c
index 2e2e95f240e..33a8cf6497f 100644
--- a/sys/lib/libkern/ntohs.c
+++ b/sys/lib/libkern/ntohs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ntohs.c,v 1.5 1995/10/07 09:26:39 mycroft Exp $ */
+/* $NetBSD: ntohs.c,v 1.5.6.1 1996/05/29 23:48:11 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/10/07 09:26:39 mycroft Exp $";
+static char *rcsid = "$NetBSD: ntohs.c,v 1.5.6.1 1996/05/29 23:48:11 cgd Exp $";
#endif
#include <sys/types.h>
@@ -20,7 +20,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