From 90b77cf39a55446b353554a344eb7b6ffb60d56a Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Mon, 30 Dec 2002 10:04:46 +0000 Subject: [PATCH] Use rather than a private verison. Tested on: sparc64, Athlon[32] --- usr.sbin/crunch/crunchide/endian.h | 57 -------------------------- usr.sbin/crunch/crunchide/exec_elf32.c | 5 +-- 2 files changed, 2 insertions(+), 60 deletions(-) delete mode 100644 usr.sbin/crunch/crunchide/endian.h diff --git a/usr.sbin/crunch/crunchide/endian.h b/usr.sbin/crunch/crunchide/endian.h deleted file mode 100644 index 2234f789d5f..00000000000 --- a/usr.sbin/crunch/crunchide/endian.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * $FreeBSD$ - */ - -#include - -#if __FreeBSD_version >= 500034 -#include -#else -#include - -#define bswap16(x) (uint16_t) \ - ((x >> 8) | (x << 8)) - -#define bswap32(x) (uint32_t) \ - ((x >> 24) | ((x >> 8) & 0xff00) | ((x << 8) & 0xff0000) | (x << 24)) - -#define bswap64(x) (uint64_t) \ - ((x >> 56) | ((x >> 40) & 0xff00) | ((x >> 24) & 0xff0000) | \ - ((x >> 8) & 0xff000000) | ((x << 8) & ((uint64_t)0xff << 32)) | \ - ((x << 24) & ((uint64_t)0xff << 40)) | \ - ((x << 40) & ((uint64_t)0xff << 48)) | ((x << 56))) - -/* - * Host to big endian, host to little endian, big endian to host, and little - * endian to host byte order functions as detailed in byteorder(9). - */ -#if _BYTE_ORDER == _LITTLE_ENDIAN -#define htobe16(x) bswap16((uint16_t)(x)) -#define htobe32(x) bswap32((uint32_t)(x)) -#define htobe64(x) bswap64((uint64_t)(x)) -#define htole16(x) ((uint16_t)(x)) -#define htole32(x) ((uint32_t)(x)) -#define htole64(x) ((uint64_t)(x)) - -#define be16toh(x) bswap16((uint16_t)(x)) -#define be32toh(x) bswap32((uint32_t)(x)) -#define be64toh(x) bswap64((uint64_t)(x)) -#define le16toh(x) ((uint16_t)(x)) -#define le32toh(x) ((uint32_t)(x)) -#define le64toh(x) ((uint64_t)(x)) -#else /* _BYTE_ORDER != _LITTLE_ENDIAN */ -#define htobe16(x) ((uint16_t)(x)) -#define htobe32(x) ((uint32_t)(x)) -#define htobe64(x) ((uint64_t)(x)) -#define htole16(x) bswap16((uint16_t)(x)) -#define htole32(x) bswap32((uint32_t)(x)) -#define htole64(x) bswap64((uint64_t)(x)) - -#define be16toh(x) ((uint16_t)(x)) -#define be32toh(x) ((uint32_t)(x)) -#define be64toh(x) ((uint64_t)(x)) -#define le16toh(x) bswap16((uint16_t)(x)) -#define le32toh(x) bswap32((uint32_t)(x)) -#define le64toh(x) bswap64((uint64_t)(x)) -#endif /* _BYTE_ORDER == _LITTLE_ENDIAN */ -#endif diff --git a/usr.sbin/crunch/crunchide/exec_elf32.c b/usr.sbin/crunch/crunchide/exec_elf32.c index 571c5a84b86..25ca2b4ecb9 100644 --- a/usr.sbin/crunch/crunchide/exec_elf32.c +++ b/usr.sbin/crunch/crunchide/exec_elf32.c @@ -33,15 +33,15 @@ #if 0 __RCSID("$NetBSD: exec_elf32.c,v 1.4 1997/08/12 06:07:24 mikel Exp $"); #endif -static const char rcsid[] = - "$FreeBSD$"; #endif +__FBSDID("$FreeBSD$"); #ifndef ELFSIZE #define ELFSIZE 32 #endif #include +#include #include #include @@ -50,7 +50,6 @@ static const char rcsid[] = #include #include -#include "endian.h" #include "extern.h" #if (defined(NLIST_ELF32) && (ELFSIZE == 32)) || \