summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/htonl.c
diff options
context:
space:
mode:
authorderaadt <>1996-06-10 06:20:08 +0000
committerderaadt <>1996-06-10 06:20:08 +0000
commitfd23a29330abb57a1e3843f7cc7f7bf3f190076a (patch)
treec95bd217554d507176571faaf3bfd2c782b49164 /src/lib/libc/net/htonl.c
parent356d3bf1c9ce479f56c218896badf52348bae085 (diff)
downloadopenbsd-fd23a29330abb57a1e3843f7cc7f7bf3f190076a.tar.gz
openbsd-fd23a29330abb57a1e3843f7cc7f7bf3f190076a.tar.bz2
openbsd-fd23a29330abb57a1e3843f7cc7f7bf3f190076a.zip
make 64 bit clean
Diffstat (limited to 'src/lib/libc/net/htonl.c')
-rw-r--r--src/lib/libc/net/htonl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libc/net/htonl.c b/src/lib/libc/net/htonl.c
index ac85cb0fd7..d0a22e1f30 100644
--- a/src/lib/libc/net/htonl.c
+++ b/src/lib/libc/net/htonl.c
@@ -1,4 +1,4 @@
1/* $NetBSD: htonl.c,v 1.5 1995/04/28 23:25:14 jtc Exp $ */ 1/* $NetBSD: htonl.c,v 1.5.6.1 1996/05/29 23:28:06 cgd Exp $ */
2 2
3/* 3/*
4 * Written by J.T. Conklin <jtc@netbsd.org>. 4 * Written by J.T. Conklin <jtc@netbsd.org>.
@@ -6,7 +6,7 @@
6 */ 6 */
7 7
8#if defined(LIBC_SCCS) && !defined(lint) 8#if defined(LIBC_SCCS) && !defined(lint)
9static char *rcsid = "$NetBSD: htonl.c,v 1.5 1995/04/28 23:25:14 jtc Exp $"; 9static char *rcsid = "$NetBSD: htonl.c,v 1.5.6.1 1996/05/29 23:28:06 cgd Exp $";
10#endif 10#endif
11 11
12#include <sys/types.h> 12#include <sys/types.h>
@@ -22,7 +22,7 @@ htonl(x)
22 22
23#if BYTE_ORDER == LITTLE_ENDIAN 23#if BYTE_ORDER == LITTLE_ENDIAN
24 u_char *s = (u_char *)&y; 24 u_char *s = (u_char *)&y;
25 return s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]; 25 return (u_int32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]);
26#else 26#else
27 return y; 27 return y;
28#endif 28#endif