pcg-c-basic icon indicating copy to clipboard operation
pcg-c-basic copied to clipboard

Fix format warning

Open planet36 opened this issue 2 years ago • 0 comments

Use macro constant PRIx64 instead of llx to fix the following warning.

pcg32x2-demo.c: In function 'main':
pcg32x2-demo.c:156:30: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'uint64_t' {aka 'long unsigned int'} [-Wformat=]
  156 |             printf(" 0x%016llx", pcg32x2_random_r(&rng));
      |                        ~~~~~~^   ~~~~~~~~~~~~~~~~~~~~~~
      |                              |   |
      |                              |   uint64_t {aka long unsigned int}
      |                              long long unsigned int
      |                        %016lx

Change "C89" to "C99" because fixed width integer types were added in C99.

Sort #include directives in pcg32x2-demo.c.

Add newline at end of .gitignore.

planet36 avatar Sep 07 '22 02:09 planet36