diff options
-rw-r--r-- | src/lib/libc/net/htonl.c | 6 | ||||
-rw-r--r-- | src/lib/libc/net/htons.c | 6 | ||||
-rw-r--r-- | src/lib/libc/net/ntohl.c | 6 | ||||
-rw-r--r-- | src/lib/libc/net/ntohs.c | 6 |
4 files changed, 12 insertions, 12 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) |
9 | static char *rcsid = "$NetBSD: htonl.c,v 1.5 1995/04/28 23:25:14 jtc Exp $"; | 9 | static 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 |
diff --git a/src/lib/libc/net/htons.c b/src/lib/libc/net/htons.c index 9b1de6ccfc..0ecb62b95c 100644 --- a/src/lib/libc/net/htons.c +++ b/src/lib/libc/net/htons.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $NetBSD: htons.c,v 1.5 1995/04/28 23:25:19 jtc Exp $ */ | 1 | /* $NetBSD: htons.c,v 1.5.6.1 1996/05/29 23:28:19 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) |
9 | static char *rcsid = "$NetBSD: htons.c,v 1.5 1995/04/28 23:25:19 jtc Exp $"; | 9 | static char *rcsid = "$NetBSD: htons.c,v 1.5.6.1 1996/05/29 23:28:19 cgd Exp $"; |
10 | #endif | 10 | #endif |
11 | 11 | ||
12 | #include <sys/types.h> | 12 | #include <sys/types.h> |
@@ -24,7 +24,7 @@ htons(x) | |||
24 | { | 24 | { |
25 | #if BYTE_ORDER == LITTLE_ENDIAN | 25 | #if BYTE_ORDER == LITTLE_ENDIAN |
26 | u_char *s = (u_char *) &x; | 26 | u_char *s = (u_char *) &x; |
27 | return s[0] << 8 | s[1]; | 27 | return (u_int16_t)(s[0] << 8 | s[1]); |
28 | #else | 28 | #else |
29 | return x; | 29 | return x; |
30 | #endif | 30 | #endif |
diff --git a/src/lib/libc/net/ntohl.c b/src/lib/libc/net/ntohl.c index 05b7f4c9a3..5df37075ac 100644 --- a/src/lib/libc/net/ntohl.c +++ b/src/lib/libc/net/ntohl.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $NetBSD: ntohl.c,v 1.5 1995/04/28 23:25:21 jtc Exp $ */ | 1 | /* $NetBSD: ntohl.c,v 1.5.6.1 1996/05/29 23:28:26 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) |
9 | static char *rcsid = "$NetBSD: ntohl.c,v 1.5 1995/04/28 23:25:21 jtc Exp $"; | 9 | static char *rcsid = "$NetBSD: ntohl.c,v 1.5.6.1 1996/05/29 23:28:26 cgd Exp $"; |
10 | #endif | 10 | #endif |
11 | 11 | ||
12 | #include <sys/types.h> | 12 | #include <sys/types.h> |
@@ -22,7 +22,7 @@ ntohl(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 |
diff --git a/src/lib/libc/net/ntohs.c b/src/lib/libc/net/ntohs.c index 6e180c16ab..a665db9f39 100644 --- a/src/lib/libc/net/ntohs.c +++ b/src/lib/libc/net/ntohs.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $NetBSD: ntohs.c,v 1.5 1995/04/28 23:25:23 jtc Exp $ */ | 1 | /* $NetBSD: ntohs.c,v 1.5.6.1 1996/05/29 23:28:33 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) |
9 | static char *rcsid = "$NetBSD: ntohs.c,v 1.5 1995/04/28 23:25:23 jtc Exp $"; | 9 | static char *rcsid = "$NetBSD: ntohs.c,v 1.5.6.1 1996/05/29 23:28:33 cgd Exp $"; |
10 | #endif | 10 | #endif |
11 | 11 | ||
12 | #include <sys/types.h> | 12 | #include <sys/types.h> |
@@ -24,7 +24,7 @@ ntohs(x) | |||
24 | { | 24 | { |
25 | #if BYTE_ORDER == LITTLE_ENDIAN | 25 | #if BYTE_ORDER == LITTLE_ENDIAN |
26 | u_char *s = (u_char *) &x; | 26 | u_char *s = (u_char *) &x; |
27 | return s[0] << 8 | s[1]; | 27 | return (u_int16_t)(s[0] << 8 | s[1]); |
28 | #else | 28 | #else |
29 | return x; | 29 | return x; |
30 | #endif | 30 | #endif |