X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=deps%2Flightning%2Flib%2Fjit_print.c;h=f3409fbb16fe0bac7a231b0240f32292d37f676c;hb=9e052883388b2b607a488e48b3cb6db52a0997dd;hp=a6f93380351bdb642c046e8af8ba30ddee66c6f7;hpb=c0c162422385a60ea7c8fa1dfe439e83e0a13d88;p=pcsx_rearmed.git diff --git a/deps/lightning/lib/jit_print.c b/deps/lightning/lib/jit_print.c index a6f93380..f3409fbb 100644 --- a/deps/lightning/lib/jit_print.c +++ b/deps/lightning/lib/jit_print.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2022 Free Software Foundation, Inc. + * Copyright (C) 2012-2023 Free Software Foundation, Inc. * * This file is part of GNU lightning. * @@ -22,8 +22,12 @@ #if __WORDSIZE == 32 # define MININT 0x80000000 +# define DEC_FMT "%d" +# define HEX_FMT "0x%x" #else # define MININT 0x8000000000000000 +# define DEC_FMT "%ld" +# define HEX_FMT "0x%lx" #endif @@ -31,11 +35,11 @@ #define print_hex(value) \ do { \ if (value < 0 && value != MININT) \ - fprintf(print_stream, "-0x%lx", -value); \ + fprintf(print_stream, "-" HEX_FMT, (jit_uword_t)-value); \ else \ - fprintf(print_stream, "0x%lx", value); \ + fprintf(print_stream, HEX_FMT, (jit_uword_t)value); \ } while (0) -#define print_dec(value) fprintf(print_stream, "%ld", value) +#define print_dec(value) fprintf(print_stream, DEC_FMT, value) #define print_flt(value) fprintf(print_stream, "%g", value) #define print_str(value) fprintf(print_stream, "%s", value) #define print_ptr(value) fprintf(print_stream, "%p", value)