summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/include/endian.h
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-11-25 13:11:41 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-11-25 13:11:41 +0000
commit18f45ad398b05c4efffae0a93e86d74c54b3c8d7 (patch)
treec6c23bbb71a3571cd28044d4d7c93631ebf9e4ce /sys/arch/sparc/include/endian.h
parentd85e22a85637536532097c45f5dce36b039cf6f4 (diff)
htons et al. works on explicit 16- and 32-bit quantities and not the
machine dependent "short" and "long" integer. Correct and enhance manpage. Change all short and longs to u_int16_t and u_int32_t, respectively. OpenBSD RCSIds
Diffstat (limited to 'sys/arch/sparc/include/endian.h')
-rw-r--r--sys/arch/sparc/include/endian.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/arch/sparc/include/endian.h b/sys/arch/sparc/include/endian.h
index 3d4297321bf..b7a1556c73b 100644
--- a/sys/arch/sparc/include/endian.h
+++ b/sys/arch/sparc/include/endian.h
@@ -1,3 +1,4 @@
+/* $OpenBSD: endian.h,v 1.3 1996/11/25 13:11:36 niklas Exp $ */
/* $NetBSD: endian.h,v 1.3 1996/02/13 17:04:58 christos Exp $ */
/*
@@ -47,17 +48,17 @@
*/
#define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
#define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
-#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
+#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in int32_t */
#define BYTE_ORDER BIG_ENDIAN
#include <sys/cdefs.h>
__BEGIN_DECLS
-unsigned long htonl __P((unsigned long));
-unsigned short htons __P((unsigned short));
-unsigned long ntohl __P((unsigned long));
-unsigned short ntohs __P((unsigned short));
+u_int32_t htonl __P((u_int32_t));
+u_int16_t htons __P((u_int16_t));
+u_int32_t ntohl __P((u_int32_t));
+u_int16_t ntohs __P((u_int16_t));
__END_DECLS
/*
@@ -76,10 +77,10 @@ __END_DECLS
#else
-#define NTOHL(x) (x) = ntohl((u_long)x)
-#define NTOHS(x) (x) = ntohs((u_short)x)
-#define HTONL(x) (x) = htonl((u_long)x)
-#define HTONS(x) (x) = htons((u_short)x)
+#define NTOHL(x) (x) = ntohl((u_int32_t)x)
+#define NTOHS(x) (x) = ntohs((u_int16_t)x)
+#define HTONL(x) (x) = htonl((u_int32_t)x)
+#define HTONS(x) (x) = htons((u_int16_t)x)
#endif
#endif /* _MACHINE_ENDIAN_H_ */