From: Jarkko Hietaniemi Date: Sat, 6 Nov 1999 19:59:59 +0000 (+0000) Subject: More printf miscasts flushed out. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=faccc32bb7c59a53878549eecfb9041c1d7a78f3;p=p5sagit%2Fp5-mst-13.2.git More printf miscasts flushed out. p4raw-id: //depot/cfgperl@4525 --- diff --git a/dump.c b/dump.c index 3881003..7fef228 100644 --- a/dump.c +++ b/dump.c @@ -894,7 +894,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo PerlIO_printf(file, "PVIO%s\n", s); break; default: - PerlIO_printf(file, "UNKNOWN(0x%x) %s\n", type, s); + PerlIO_printf(file, "UNKNOWN(0x%"UVxf") %s\n", (UV)type, s); return; } if (type >= SVt_PVIV || type == SVt_IV) { diff --git a/ext/B/B.xs b/ext/B/B.xs index 224354c..731ae95 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -491,10 +491,10 @@ hash(sv) char *s; STRLEN len; U32 hash = 0; - char hexhash[19]; /* must fit "0xffffffff" plus trailing \0 */ + char hexhash[19]; /* must fit "0xffffffffffffffff" plus trailing \0 */ s = SvPV(sv, len); PERL_HASH(hash, s, len); - sprintf(hexhash, "0x%x", hash); + sprintf(hexhash, "0x%"UVxf, (UV)hash); ST(0) = sv_2mortal(newSVpv(hexhash, 0)); #define cast_I32(foo) (I32)foo diff --git a/ext/Data/Dumper/Dumper.xs b/ext/Data/Dumper/Dumper.xs index 6f548bb..125375f 100644 --- a/ext/Data/Dumper/Dumper.xs +++ b/ext/Data/Dumper/Dumper.xs @@ -839,7 +839,7 @@ Data_Dumper_Dumpxs(href, ...) STRLEN nchars = 0; sv_setpvn(name, "$", 1); sv_catsv(name, varname); - (void) sprintf(tmpbuf, "%d", i+1); + (void) sprintf(tmpbuf, "%"IVdf, (IV)(i+1)); nchars = strlen(tmpbuf); sv_catpvn(name, tmpbuf, nchars); } diff --git a/regcomp.c b/regcomp.c index 33dcaaf..d3b2c03 100644 --- a/regcomp.c +++ b/regcomp.c @@ -867,7 +867,7 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm) PL_regprecomp = Nullch; return(NULL); } - DEBUG_r(PerlIO_printf(Perl_debug_log, "size %d ", PL_regsize)); + DEBUG_r(PerlIO_printf(Perl_debug_log, "size %"IVdf" ", (IV)PL_regsize)); /* Small enough for pointer-storage convention? If extralen==0, this means that we will not need long jumps. */ diff --git a/regexec.c b/regexec.c index 4632838..fa891c8 100644 --- a/regexec.c +++ b/regexec.c @@ -146,13 +146,13 @@ S_regcppush(pTHX_ I32 parenfloor) /* These are needed since we do not localize EVAL nodes: */ # define REGCP_SET DEBUG_r(PerlIO_printf(Perl_debug_log, \ - " Setting an EVAL scope, savestack=%i\n", \ - PL_savestack_ix)); lastcp = PL_savestack_ix + " Setting an EVAL scope, savestack=%"IVdf"\n", \ + (IV)PL_savestack_ix)); lastcp = PL_savestack_ix # define REGCP_UNWIND DEBUG_r(lastcp != PL_savestack_ix ? \ PerlIO_printf(Perl_debug_log, \ - " Clearing an EVAL scope, savestack=%i..%i\n", \ - lastcp, PL_savestack_ix) : 0); regcpblow(lastcp) + " Clearing an EVAL scope, savestack=%"IVdf"..%"IVdf"\n", \ + (IV)lastcp, (IV)PL_savestack_ix) : 0); regcpblow(lastcp) STATIC char * S_regcppop(pTHX) @@ -186,8 +186,8 @@ S_regcppop(pTHX) DEBUG_r( if (*PL_reglastparen + 1 <= PL_regnpar) { PerlIO_printf(Perl_debug_log, - " restoring \\%d..\\%d to undef\n", - *PL_reglastparen + 1, PL_regnpar); + " restoring \\%"IVdf"..\\%"IVdf" to undef\n", + (IV)(*PL_reglastparen + 1), (IV)PL_regnpar); } ); for (paren = *PL_reglastparen + 1; paren <= PL_regnpar; paren++) { @@ -2752,9 +2752,9 @@ S_regmatch(pTHX_ regnode *prog) locinput = PL_reginput; DEBUG_r( PerlIO_printf(Perl_debug_log, - "%*s matched %d times, len=%"IVdf"...\n", + "%*s matched %"IVdf" times, len=%"IVdf"...\n", (int)(REPORT_CODE_OFF+PL_regindent*2), "", - n, (IV)l) + (IV) n, (IV)l) ); if (n >= ln) { if (PL_regkind[(U8)OP(next)] == EXACT) {