diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-11-25 13:11:41 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-11-25 13:11:41 +0000 |
commit | 18f45ad398b05c4efffae0a93e86d74c54b3c8d7 (patch) | |
tree | c6c23bbb71a3571cd28044d4d7c93631ebf9e4ce /sys/arch/mvme88k/include | |
parent | d85e22a85637536532097c45f5dce36b039cf6f4 (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/mvme88k/include')
-rw-r--r-- | sys/arch/mvme88k/include/endian.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sys/arch/mvme88k/include/endian.h b/sys/arch/mvme88k/include/endian.h index 9e078b1e5ee..ce22d3d35bc 100644 --- a/sys/arch/mvme88k/include/endian.h +++ b/sys/arch/mvme88k/include/endian.h @@ -1,3 +1,5 @@ +/* $OpenBSD: endian.h,v 1.2 1996/11/25 13:11:28 niklas Exp $ */ + /* * Copyright (c) 1987, 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -31,7 +33,6 @@ * SUCH DAMAGE. * * from: @(#)endian.h 8.1 (Berkeley) 6/11/93 - * $Id: endian.h,v 1.1 1995/10/18 10:54:21 deraadt Exp $ */ #ifndef _ENDIAN_H_ @@ -51,17 +52,17 @@ #define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ #define BIG_ENDIAN 4321 /* MSB first: 68000, 88000 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 /* @@ -80,10 +81,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 /* ! _POSIX_SOURCE */ #endif /* !_ENDIAN_H_ */ |