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:
parent
f0a24ee4d0
commit
c8fc061ea6
15 changed files with 64 additions and 52 deletions
|
|
@ -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...
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue