diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-04-11 00:53:46 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-04-11 00:53:46 -0400 |
commit | 6457da0570c5d99ee7164cdb38e3d32c87fe9d6d (patch) | |
tree | 4a7fd8dca9d94a65d6d5b82606de28e7556eec0e /bits.c | |
parent | 4fda87b5d4dc3dd8200e5f74d6fefc2a32616d6a (diff) | |
download | gpsd-6457da0570c5d99ee7164cdb38e3d32c87fe9d6d.tar.gz |
Fix a shift that was breaking sbits() on fields longer than 32 bits.
I'm not sure why 1 needed to be a long constant 1LL here - you'd think
it would be 64 bits naturally on a 64-bit machine - but it did.
Diffstat (limited to 'bits.c')
-rw-r--r-- | bits.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -73,7 +73,7 @@ int64_t sbits(char buf[], unsigned int start, unsigned int width) (void)fprintf(stderr, "sbits(%d, %d) extracts %llx\n", start, width, fld); #endif /* __UNUSED_DEBUG__ */ /*@ +relaxtypes */ - if (fld & (1 << (width - 1))) { + if (fld & (1LL << (width - 1))) { #ifdef __UNUSED_DEBUG__ (void)fprintf(stderr, "%llx is signed\n", fld); #endif /* __UNUSED_DEBUG__ */ |