Ditch longs and long longs in favor of stdint.h types, which has cascading

effects throughout, including use of inttypes.h/PRI[ud]64 because printf() is
still stuck in a long world, conversion of %lu to %zu for printing values of
type size_t, and changing/renaming the g_check_cmp* family of functions.
This commit is contained in:
Peter Johnson 2013-11-15 00:12:57 -05:00
parent f0a24ee4d0
commit c8fc061ea6
15 changed files with 64 additions and 52 deletions

View file

@ -26,12 +26,12 @@
#define LDB(range,i) (((i)>>LSB(range))&((1<<(MSB(range)-LSB(range)+1))-1))
long long h_read_bits(HInputStream* state, int count, char signed_p) {
int64_t h_read_bits(HInputStream* state, int count, char signed_p) {
// BUG: Does not
long long out = 0;
int64_t out = 0;
int offset = 0;
int final_shift = 0;
long long msb = ((signed_p ? 1LL:0) << (count - 1)); // 0 if unsigned, else 1 << (nbits - 1)
int64_t msb = ((signed_p ? 1LL:0) << (count - 1)); // 0 if unsigned, else 1 << (nbits - 1)
// overflow check...