summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-07-21 01:51:12 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-07-21 01:51:12 +0000
commitaa9ef24e4656ff609846592e4a0986d78591ad4f (patch)
tree3e0e3b87efa9679d68f3c087efc8d191949505e6 /lib
parent378b6fbd3692c1ba624cff8309b6bdbcd76657a5 (diff)
Switch from <sys/endian.h> or <machine/endian.h> to the new,
being-standardized <endian.h> ok deraadt@ millert@ beck@
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/arch/arm/gen/infinity.c5
-rw-r--r--lib/libc/arch/arm/gen/nan.c5
-rw-r--r--lib/libc/arch/mips64/gen/infinity.c4
-rw-r--r--lib/libc/arch/mips64/gen/nan.c5
-rw-r--r--lib/libc/arch/sh/gen/infinity.c5
-rw-r--r--lib/libc/arch/sh/gen/nan.c5
-rw-r--r--lib/libc/arch/sh/net/htonl.c4
-rw-r--r--lib/libc/arch/sh/net/htons.c4
-rw-r--r--lib/libc/arch/sh/net/ntohl.c4
-rw-r--r--lib/libc/arch/sh/net/ntohs.c4
-rw-r--r--lib/libc/gen/ldexp.c4
-rw-r--r--lib/libc/hash/rmd160.c4
-rw-r--r--lib/libc/net/htonl.c4
-rw-r--r--lib/libc/net/htons.c4
-rw-r--r--lib/libc/net/ntohl.c4
-rw-r--r--lib/libc/net/ntohs.c4
-rw-r--r--lib/libc/rpc/xdr_float.c4
-rw-r--r--lib/libm/src/ld128/s_exp2l.c3
-rw-r--r--lib/libm/src/ld80/s_exp2l.c3
-rw-r--r--lib/libm/src/s_nan.c8
20 files changed, 41 insertions, 46 deletions
diff --git a/lib/libc/arch/arm/gen/infinity.c b/lib/libc/arch/arm/gen/infinity.c
index 2e3eb42111b..9bda3bbc3d6 100644
--- a/lib/libc/arch/arm/gen/infinity.c
+++ b/lib/libc/arch/arm/gen/infinity.c
@@ -1,13 +1,12 @@
-/* $OpenBSD: infinity.c,v 1.3 2004/02/02 07:03:21 drahn Exp $ */
+/* $OpenBSD: infinity.c,v 1.4 2014/07/21 01:51:10 guenther Exp $ */
/* $NetBSD: infinity.c,v 1.3 2002/02/19 20:08:19 bjh21 Exp $ */
/*
* IEEE-compatible infinity.c -- public domain.
*/
-#include <sys/types.h>
+#include <endian.h>
#include <math.h>
-#include <machine/endian.h>
char __infinity[] __attribute__((__aligned__(sizeof(double)))) =
#if BYTE_ORDER == BIG_ENDIAN
diff --git a/lib/libc/arch/arm/gen/nan.c b/lib/libc/arch/arm/gen/nan.c
index 6c75f3060c2..66e09dce829 100644
--- a/lib/libc/arch/arm/gen/nan.c
+++ b/lib/libc/arch/arm/gen/nan.c
@@ -1,10 +1,9 @@
-/* $OpenBSD: nan.c,v 1.1 2008/07/24 09:31:06 martynas Exp $ */
+/* $OpenBSD: nan.c,v 1.2 2014/07/21 01:51:10 guenther Exp $ */
/* Written by Martynas Venckus. Public Domain. */
-#include <sys/types.h>
+#include <endian.h>
#include <math.h>
-#include <machine/endian.h>
/* bytes for qNaN on an arm (IEEE single format) */
char __nan[] __attribute__((__aligned__(sizeof(float)))) =
diff --git a/lib/libc/arch/mips64/gen/infinity.c b/lib/libc/arch/mips64/gen/infinity.c
index 239a16d14c0..896ca679066 100644
--- a/lib/libc/arch/mips64/gen/infinity.c
+++ b/lib/libc/arch/mips64/gen/infinity.c
@@ -1,8 +1,8 @@
-/* $OpenBSD: infinity.c,v 1.2 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: infinity.c,v 1.3 2014/07/21 01:51:10 guenther Exp $ */
/* infinity.c */
+#include <endian.h>
#include <math.h>
-#include <sys/types.h>
/* bytes for +Infinity on a MIPS */
#if BYTE_ORDER == BIG_ENDIAN
diff --git a/lib/libc/arch/mips64/gen/nan.c b/lib/libc/arch/mips64/gen/nan.c
index 73ebf3b9a0f..431df4302f7 100644
--- a/lib/libc/arch/mips64/gen/nan.c
+++ b/lib/libc/arch/mips64/gen/nan.c
@@ -1,10 +1,9 @@
-/* $OpenBSD: nan.c,v 1.2 2008/09/07 20:36:07 martynas Exp $ */
+/* $OpenBSD: nan.c,v 1.3 2014/07/21 01:51:10 guenther Exp $ */
/* Written by Martynas Venckus. Public Domain. */
-#include <sys/types.h>
+#include <endian.h>
#include <math.h>
-#include <machine/endian.h>
/* bytes for qNaN on a mips64 (IEEE single format) */
char __nan[] __attribute__((__aligned__(sizeof(float)))) =
diff --git a/lib/libc/arch/sh/gen/infinity.c b/lib/libc/arch/sh/gen/infinity.c
index 18d7a1b1ad1..a4f3e8ae9e4 100644
--- a/lib/libc/arch/sh/gen/infinity.c
+++ b/lib/libc/arch/sh/gen/infinity.c
@@ -1,12 +1,13 @@
-/* $OpenBSD: infinity.c,v 1.3 2006/11/13 07:00:59 otto Exp $ */
+/* $OpenBSD: infinity.c,v 1.4 2014/07/21 01:51:10 guenther Exp $ */
/* infinity.c */
+#include <endian.h>
#include <math.h>
/* bytes for +Infinity on a SH4 FPU (double precision) */
char __infinity[] __attribute__((__aligned__(sizeof(double)))) =
-#if _BYTE_ORDER == _LITTLE_ENDIAN
+#if BYTE_ORDER == LITTLE_ENDIAN
{ 0, 0, 0, 0, 0, 0, (char)0xf0, 0x7f };
#else
{ 0x7f, (char)0xf0, 0, 0, 0, 0, 0, 0 };
diff --git a/lib/libc/arch/sh/gen/nan.c b/lib/libc/arch/sh/gen/nan.c
index c7a2be8ba66..c1a28f75f01 100644
--- a/lib/libc/arch/sh/gen/nan.c
+++ b/lib/libc/arch/sh/gen/nan.c
@@ -1,10 +1,9 @@
-/* $OpenBSD: nan.c,v 1.1 2008/07/24 09:31:06 martynas Exp $ */
+/* $OpenBSD: nan.c,v 1.2 2014/07/21 01:51:10 guenther Exp $ */
/* Written by Martynas Venckus. Public Domain. */
-#include <sys/types.h>
+#include <endian.h>
#include <math.h>
-#include <machine/endian.h>
/* bytes for qNaN on a sh (IEEE single format) */
char __nan[] __attribute__((__aligned__(sizeof(float)))) =
diff --git a/lib/libc/arch/sh/net/htonl.c b/lib/libc/arch/sh/net/htonl.c
index a4c056d616e..a515606f67e 100644
--- a/lib/libc/arch/sh/net/htonl.c
+++ b/lib/libc/arch/sh/net/htonl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: htonl.c,v 1.1 2006/10/10 22:07:10 miod Exp $ */
+/* $OpenBSD: htonl.c,v 1.2 2014/07/21 01:51:10 guenther Exp $ */
/* $NetBSD: htonl.c,v 1.3 2005/12/24 23:10:08 perry Exp $ */
/*-
@@ -36,7 +36,7 @@
*/
#include <sys/types.h>
-#include <machine/endian.h>
+#include <endian.h>
#undef htonl
diff --git a/lib/libc/arch/sh/net/htons.c b/lib/libc/arch/sh/net/htons.c
index ae414edc399..1d7a7de297c 100644
--- a/lib/libc/arch/sh/net/htons.c
+++ b/lib/libc/arch/sh/net/htons.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: htons.c,v 1.1 2006/10/10 22:07:10 miod Exp $ */
+/* $OpenBSD: htons.c,v 1.2 2014/07/21 01:51:10 guenther Exp $ */
/* $NetBSD: htons.c,v 1.3 2005/12/24 23:10:08 perry Exp $ */
/*-
@@ -36,7 +36,7 @@
*/
#include <sys/types.h>
-#include <machine/endian.h>
+#include <endian.h>
#undef htons
diff --git a/lib/libc/arch/sh/net/ntohl.c b/lib/libc/arch/sh/net/ntohl.c
index 964938ebf6a..78ca2462f15 100644
--- a/lib/libc/arch/sh/net/ntohl.c
+++ b/lib/libc/arch/sh/net/ntohl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntohl.c,v 1.1 2006/10/10 22:07:10 miod Exp $ */
+/* $OpenBSD: ntohl.c,v 1.2 2014/07/21 01:51:10 guenther Exp $ */
/* $NetBSD: ntohl.c,v 1.3 2005/12/24 23:10:08 perry Exp $ */
/*-
@@ -36,7 +36,7 @@
*/
#include <sys/types.h>
-#include <machine/endian.h>
+#include <endian.h>
#undef ntohl
diff --git a/lib/libc/arch/sh/net/ntohs.c b/lib/libc/arch/sh/net/ntohs.c
index 3945ae77c87..f57c8a90d57 100644
--- a/lib/libc/arch/sh/net/ntohs.c
+++ b/lib/libc/arch/sh/net/ntohs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntohs.c,v 1.1 2006/10/10 22:07:10 miod Exp $ */
+/* $OpenBSD: ntohs.c,v 1.2 2014/07/21 01:51:10 guenther Exp $ */
/* $NetBSD: ntohs.c,v 1.3 2005/12/24 23:10:08 perry Exp $ */
/*-
@@ -36,7 +36,7 @@
*/
#include <sys/types.h>
-#include <machine/endian.h>
+#include <endian.h>
#undef ntohs
diff --git a/lib/libc/gen/ldexp.c b/lib/libc/gen/ldexp.c
index 751d28a4ca7..eb0829e7007 100644
--- a/lib/libc/gen/ldexp.c
+++ b/lib/libc/gen/ldexp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldexp.c,v 1.8 2013/07/03 04:46:36 espie Exp $ */
+/* $OpenBSD: ldexp.c,v 1.9 2014/07/21 01:51:10 guenther Exp $ */
/* @(#)s_scalbn.c 5.1 93/09/24 */
/* @(#)fdlibm.h 5.1 93/09/24 */
/*
@@ -13,7 +13,7 @@
*/
#include <sys/types.h>
-#include <machine/endian.h>
+#include <endian.h>
#include <float.h>
#include <math.h>
diff --git a/lib/libc/hash/rmd160.c b/lib/libc/hash/rmd160.c
index d1047b87ee5..afd119e524e 100644
--- a/lib/libc/hash/rmd160.c
+++ b/lib/libc/hash/rmd160.c
@@ -26,9 +26,9 @@
* RSA Laboratories, CryptoBytes, Volume 3, Number 2, Autumn 1997,
* ftp://ftp.rsasecurity.com/pub/cryptobytes/crypto3n2.pdf
*/
-#include <string.h>
#include <sys/types.h>
-#include <sys/endian.h>
+#include <endian.h>
+#include <string.h>
#include <rmd160.h>
#define PUT_64BIT_LE(cp, value) do { \
diff --git a/lib/libc/net/htonl.c b/lib/libc/net/htonl.c
index 5ab4189597c..6ee6e7efbf3 100644
--- a/lib/libc/net/htonl.c
+++ b/lib/libc/net/htonl.c
@@ -1,11 +1,11 @@
-/* $OpenBSD: htonl.c,v 1.6 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: htonl.c,v 1.7 2014/07/21 01:51:10 guenther Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <sys/types.h>
-#include <machine/endian.h>
+#include <endian.h>
#undef htonl
diff --git a/lib/libc/net/htons.c b/lib/libc/net/htons.c
index c8b73fdbb77..f48d91ee035 100644
--- a/lib/libc/net/htons.c
+++ b/lib/libc/net/htons.c
@@ -1,11 +1,11 @@
-/* $OpenBSD: htons.c,v 1.8 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: htons.c,v 1.9 2014/07/21 01:51:10 guenther Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <sys/types.h>
-#include <machine/endian.h>
+#include <endian.h>
#undef htons
diff --git a/lib/libc/net/ntohl.c b/lib/libc/net/ntohl.c
index 36414b7a132..0d05bac78a1 100644
--- a/lib/libc/net/ntohl.c
+++ b/lib/libc/net/ntohl.c
@@ -1,11 +1,11 @@
-/* $OpenBSD: ntohl.c,v 1.6 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: ntohl.c,v 1.7 2014/07/21 01:51:10 guenther Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <sys/types.h>
-#include <machine/endian.h>
+#include <endian.h>
#undef ntohl
diff --git a/lib/libc/net/ntohs.c b/lib/libc/net/ntohs.c
index 8f345e84ad7..b5ea361f830 100644
--- a/lib/libc/net/ntohs.c
+++ b/lib/libc/net/ntohs.c
@@ -1,11 +1,11 @@
-/* $OpenBSD: ntohs.c,v 1.8 2005/08/06 20:30:03 espie Exp $ */
+/* $OpenBSD: ntohs.c,v 1.9 2014/07/21 01:51:10 guenther Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
*/
#include <sys/types.h>
-#include <machine/endian.h>
+#include <endian.h>
#undef ntohs
diff --git a/lib/libc/rpc/xdr_float.c b/lib/libc/rpc/xdr_float.c
index f0fd5e0eeb9..4ff14885a35 100644
--- a/lib/libc/rpc/xdr_float.c
+++ b/lib/libc/rpc/xdr_float.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr_float.c,v 1.20 2011/07/26 11:43:01 martynas Exp $ */
+/* $OpenBSD: xdr_float.c,v 1.21 2014/07/21 01:51:11 guenther Exp $ */
/*
* Copyright (c) 2010, Oracle America, Inc.
@@ -81,7 +81,7 @@ static struct sgl_limits {
};
#else
-#include <machine/endian.h>
+#include <endian.h>
#define IEEEFP
#endif
diff --git a/lib/libm/src/ld128/s_exp2l.c b/lib/libm/src/ld128/s_exp2l.c
index 1bba73bb688..9b68a1a477f 100644
--- a/lib/libm/src/ld128/s_exp2l.c
+++ b/lib/libm/src/ld128/s_exp2l.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_exp2l.c,v 1.1 2008/12/09 20:00:35 martynas Exp $ */
+/* $OpenBSD: s_exp2l.c,v 1.2 2014/07/21 01:51:11 guenther Exp $ */
/*-
* Copyright (c) 2005-2008 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
@@ -26,7 +26,6 @@
*/
#include <sys/types.h>
-#include <sys/endian.h>
#include <machine/ieee.h>
#include <float.h>
#include <math.h>
diff --git a/lib/libm/src/ld80/s_exp2l.c b/lib/libm/src/ld80/s_exp2l.c
index b84dc955f66..edcbc8e1839 100644
--- a/lib/libm/src/ld80/s_exp2l.c
+++ b/lib/libm/src/ld80/s_exp2l.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_exp2l.c,v 1.2 2008/12/22 05:22:27 miod Exp $ */
+/* $OpenBSD: s_exp2l.c,v 1.3 2014/07/21 01:51:11 guenther Exp $ */
/*-
* Copyright (c) 2005-2008 David Schultz <das@FreeBSD.ORG>
* All rights reserved.
@@ -26,7 +26,6 @@
*/
#include <sys/types.h>
-#include <sys/endian.h>
#include <machine/ieee.h>
#include <float.h>
#include <math.h>
diff --git a/lib/libm/src/s_nan.c b/lib/libm/src/s_nan.c
index 0179df446a1..33628c82390 100644
--- a/lib/libm/src/s_nan.c
+++ b/lib/libm/src/s_nan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_nan.c,v 1.12 2013/11/22 18:27:25 deraadt Exp $ */
+/* $OpenBSD: s_nan.c,v 1.13 2014/07/21 01:51:11 guenther Exp $ */
/*-
* Copyright (c) 2007 David Schultz
* All rights reserved.
@@ -28,8 +28,8 @@
*/
#include <sys/types.h>
-#include <sys/endian.h>
#include <ctype.h>
+#include <endian.h>
#include <float.h>
#include <math.h>
#include <stdint.h>
@@ -81,7 +81,7 @@ _scan_nan(uint32_t *words, int num_words, const char *s)
;
/* Scan backwards, filling in the bits in words[] as we go. */
-#if _BYTE_ORDER == _LITTLE_ENDIAN
+#if BYTE_ORDER == LITTLE_ENDIAN
for (bitpos = 0; bitpos < 32 * num_words; bitpos += 4) {
#else
for (bitpos = 32 * num_words - 4; bitpos >= 0; bitpos -= 4) {
@@ -101,7 +101,7 @@ nan(const char *s)
} u;
_scan_nan(u.bits, 2, s);
-#if _BYTE_ORDER == _LITTLE_ENDIAN
+#if BYTE_ORDER == LITTLE_ENDIAN
u.bits[1] |= 0x7ff80000;
#else
u.bits[0] |= 0x7ff80000;