diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-03-15 03:55:29 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-03-15 03:55:29 +0000 |
commit | 28bbf328a9eeec96bdbefd418fc5cda9ae715189 (patch) | |
tree | 44a3852702a96981f77847191a948012de9a988b /bits.c | |
parent | c3440b1f32c506629998b3a0e47928f91d037640 (diff) | |
download | gpsd-28bbf328a9eeec96bdbefd418fc5cda9ae715189.tar.gz |
Remove a word-width dependency.
Diffstat (limited to 'bits.c')
-rw-r--r-- | bits.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3,7 +3,7 @@ * Bitfield extraction functions. In each, start is a bit index (not * a byte index) and width is a bit width. The width bounded above by * the bit width of a long long, which s 64 bits in all standard data - * models for 64-bit processors. + * models for 32- and 64-bit processors. * * The sbits() function assumes twos-complement arithmetic. */ @@ -44,7 +44,7 @@ unsigned long long ubits(char buf[], unsigned int start, unsigned int width) #endif /* UDEBUG */ } - fld &= ~(0xffffffff << width); + fld &= ~(-1LL << width); #ifdef UDEBUG printf("After selecting out the bottom %u bits: 0x%llx = %lld\n", width, fld, fld); |