summaryrefslogtreecommitdiffstats
path: root/lib/libstand
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2016-03-21 14:39:03 +0000
committerian <ian@FreeBSD.org>2016-03-21 14:39:03 +0000
commitd61783b1df4058269c11459f24687bbf3d981643 (patch)
tree7aff00f3bffeebc5989d5e2bab06eb0a485331f4 /lib/libstand
parent0e961a376e8e68d392dd6755fce79511b3d38286 (diff)
downloadFreeBSD-src-d61783b1df4058269c11459f24687bbf3d981643.zip
FreeBSD-src-d61783b1df4058269c11459f24687bbf3d981643.tar.gz
Actually garbage collect the unused code, as mentioned in r297147, which
this change should have been part of.
Diffstat (limited to 'lib/libstand')
-rw-r--r--lib/libstand/bswap.c57
1 files changed, 0 insertions, 57 deletions
diff --git a/lib/libstand/bswap.c b/lib/libstand/bswap.c
deleted file mode 100644
index 308edda..0000000
--- a/lib/libstand/bswap.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Written by Manuel Bouyer <bouyer@netbsd.org>.
- * Public domain.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$NetBSD: bswap32.c,v 1.1 1997/10/09 15:42:33 bouyer Exp $";
-static char *rcsid = "$NetBSD: bswap64.c,v 1.3 2009/03/16 05:59:21 cegger Exp $";
-#endif
-
-#include <sys/types.h>
-
-#undef bswap32
-#undef bswap64
-
-u_int32_t bswap32(u_int32_t x);
-u_int64_t bswap64(u_int64_t x);
-
-u_int32_t
-bswap32(u_int32_t x)
-{
- return ((x << 24) & 0xff000000 ) |
- ((x << 8) & 0x00ff0000 ) |
- ((x >> 8) & 0x0000ff00 ) |
- ((x >> 24) & 0x000000ff );
-}
-
-u_int64_t
-bswap64(u_int64_t x)
-{
-#ifdef __LP64__
- /*
- * Assume we have wide enough registers to do it without touching
- * memory.
- */
- return ( (x << 56) & 0xff00000000000000UL ) |
- ( (x << 40) & 0x00ff000000000000UL ) |
- ( (x << 24) & 0x0000ff0000000000UL ) |
- ( (x << 8) & 0x000000ff00000000UL ) |
- ( (x >> 8) & 0x00000000ff000000UL ) |
- ( (x >> 24) & 0x0000000000ff0000UL ) |
- ( (x >> 40) & 0x000000000000ff00UL ) |
- ( (x >> 56) & 0x00000000000000ffUL );
-#else
- /*
- * Split the operation in two 32bit steps.
- */
- u_int32_t tl, th;
-
- th = bswap32((u_int32_t)(x & 0x00000000ffffffffULL));
- tl = bswap32((u_int32_t)((x >> 32) & 0x00000000ffffffffULL));
- return ((u_int64_t)th << 32) | tl;
-#endif
-}
OpenPOWER on IntegriCloud