svn commit: r211320 - projects/ofed/head/sys/amd64/include
Jeff Roberson
jeff at FreeBSD.org
Sat Aug 14 22:35:21 UTC 2010
Author: jeff
Date: Sat Aug 14 22:35:20 2010
New Revision: 211320
URL: http://svn.freebsd.org/changeset/base/211320
Log:
- One more endian bug; cast the results of byte_swap_*_const() to the
expected result type. Sometimes wider types are passed in but should
not be produced.
Modified:
projects/ofed/head/sys/amd64/include/endian.h
Modified: projects/ofed/head/sys/amd64/include/endian.h
==============================================================================
--- projects/ofed/head/sys/amd64/include/endian.h Sat Aug 14 22:28:07 2010 (r211319)
+++ projects/ofed/head/sys/amd64/include/endian.h Sat Aug 14 22:35:20 2010 (r211320)
@@ -83,7 +83,7 @@ __byte_swap_int_var(__uint32_t x)
#ifdef __OPTIMIZE__
#define __byte_swap_int_const(x) \
- ((((x) & 0xff000000) >> 24) | \
+ (__uint32_t)((((x) & 0xff000000) >> 24) | \
(((x) & 0x00ff0000) >> 8) | \
(((x) & 0x0000ff00) << 8) | \
(((x) & 0x000000ff) << 24))
@@ -109,7 +109,7 @@ __byte_swap_long_var(__uint64_t x)
#ifdef __OPTIMIZE__
#define __byte_swap_long_const(x) \
- ((__uint64_t)(((__uint64_t)x >> 56) | \
+ (__uint64_t)((((__uint64_t)x >> 56) | \
(((__uint64_t)x >> 40) & 0xff00) | \
(((__uint64_t)x >> 24) & 0xff0000) | \
(((__uint64_t)x >> 8) & 0xff000000) | \
More information about the svn-src-projects
mailing list