From: Nicholas Clark Date: Wed, 25 Apr 2007 09:54:17 +0000 (+0000) Subject: Avoid the need for 2 casts added in 31055 by using a better type for X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=16d8f38a2d6ab27610f67c929d18408a3acc29a9;p=p5sagit%2Fp5-mst-13.2.git Avoid the need for 2 casts added in 31055 by using a better type for the local variable. Add an assertion that another cast is not a data loss (and that there is no buffer overflow) p4raw-id: //depot/perl@31069 --- diff --git a/ext/Devel/Peek/Peek.xs b/ext/Devel/Peek/Peek.xs index e1c62c3..75023cd 100644 --- a/ext/Devel/Peek/Peek.xs +++ b/ext/Devel/Peek/Peek.xs @@ -344,11 +344,11 @@ PPCODE: SV *pv_lim_sv = perl_get_sv("Devel::Peek::pv_limit", FALSE); const STRLEN pv_lim = pv_lim_sv ? SvIV(pv_lim_sv) : 0; SV *dumpop = perl_get_sv("Devel::Peek::dump_ops", FALSE); - const I32 save_dumpindent = PL_dumpindent; + const U16 save_dumpindent = PL_dumpindent; PL_dumpindent = 2; do_sv_dump(0, Perl_debug_log, sv, 0, lim, (bool)(dumpop && SvTRUE(dumpop)), pv_lim); - PL_dumpindent = (U16)save_dumpindent; + PL_dumpindent = save_dumpindent; } void @@ -360,7 +360,7 @@ PPCODE: SV *pv_lim_sv = perl_get_sv("Devel::Peek::pv_limit", FALSE); const STRLEN pv_lim = pv_lim_sv ? SvIV(pv_lim_sv) : 0; SV *dumpop = perl_get_sv("Devel::Peek::dump_ops", FALSE); - const I32 save_dumpindent = PL_dumpindent; + const U16 save_dumpindent = PL_dumpindent; PL_dumpindent = 2; for (i=1; i