Date: Wed, 17 Sep 2014 00:54:00 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271695 - in head/cddl/contrib/opensolaris/lib: libctf/common libdtrace/common Message-ID: <201409170054.s8H0s078096323@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Wed Sep 17 00:54:00 2014 New Revision: 271695 URL: http://svnweb.freebsd.org/changeset/base/271695 Log: Fix some incorrect endianness checks. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Wed Sep 17 00:30:25 2014 (r271694) +++ head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Wed Sep 17 00:54:00 2014 (r271695) @@ -274,7 +274,7 @@ ctf_fdopen(int fd, int *errp) */ if (nbytes >= (ssize_t) sizeof (Elf32_Ehdr) && bcmp(&hdr.e32.e_ident[EI_MAG0], ELFMAG, SELFMAG) == 0) { -#ifdef _BIG_ENDIAN +#if BYTE_ORDER == _BIG_ENDIAN uchar_t order = ELFDATA2MSB; #else uchar_t order = ELFDATA2LSB; Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Wed Sep 17 00:30:25 2014 (r271694) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Wed Sep 17 00:54:00 2014 (r271695) @@ -167,7 +167,7 @@ print_bitfield(dt_printarg_t *pap, ulong * to the lowest 'size' bytes in 'value', and we need to shift based on * the offset from the end of the data, not the offset of the start. */ -#ifdef _BIG_ENDIAN +#if BYTE_ORDER == _BIG_ENDIAN buf += sizeof (value) - size; off += ep->cte_bits; #endif @@ -178,7 +178,7 @@ print_bitfield(dt_printarg_t *pap, ulong * Offsets are counted from opposite ends on little- and * big-endian machines. */ -#ifdef _BIG_ENDIAN +#if BYTE_ORDER == _BIG_ENDIAN shift = NBBY - shift; #endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409170054.s8H0s078096323>