From 2d0c2c2bf7c35db2e16d16f39cb9749a04bc91df Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Mon, 21 Mar 2011 22:00:29 -0400 Subject: compiler warnings --- klm/util/bit_packing.hh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'klm/util/bit_packing.hh') diff --git a/klm/util/bit_packing.hh b/klm/util/bit_packing.hh index 70cfc2d2..5c71c792 100644 --- a/klm/util/bit_packing.hh +++ b/klm/util/bit_packing.hh @@ -28,16 +28,19 @@ namespace util { * but it may be called multiple times when that's inconvenient. */ -inline uint8_t BitPackShift(uint8_t bit, uint8_t length) { + // Fun fact: __BYTE_ORDER is wrong on Solaris Sparc, but the version without __ is correct. #if BYTE_ORDER == LITTLE_ENDIAN +inline uint8_t BitPackShift(uint8_t bit, uint8_t /*length*/) { return bit; +} #elif BYTE_ORDER == BIG_ENDIAN +inline uint8_t BitPackShift(uint8_t bit, uint8_t length) { return 64 - length - bit; +} #else #error "Bit packing code isn't written for your byte order." #endif -} /* Pack integers up to 57 bits using their least significant digits. * The length is specified using mask: -- cgit v1.2.3