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

@ -8,6 +8,7 @@
// base64_sem1.c and base64_sem2.c for examples how to attach appropriate
// semantic actions to the grammar.
#include <inttypes.h>
#include "../src/hammer.h"
const HParser* document = NULL;
@ -49,12 +50,12 @@ int main(int argc, char **argv)
init_parser();
inputsize = fread(input, 1, sizeof(input), stdin);
fprintf(stderr, "inputsize=%lu\ninput=", inputsize);
fprintf(stderr, "inputsize=%zu\ninput=", inputsize);
fwrite(input, 1, inputsize, stderr);
result = h_parse(document, input, inputsize);
if(result) {
fprintf(stderr, "parsed=%lld bytes\n", result->bit_length/8);
fprintf(stderr, "parsed=%" PRId64 " bytes\n", result->bit_length/8);
h_pprint(stdout, result->ast, 0, 0);
return 0;
} else {