# ifdef YYPRINT
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# else
- YYFPRINTF (yyoutput, "0x%x", yyvaluep->ival);
+ YYFPRINTF (yyoutput, "0x%"UVxf, (UV)yyvaluep->ival);
# endif
}
else
PerlIO_printf(Perl_debug_log, " %8.8s", *yyns);
PerlIO_printf(Perl_debug_log, "\nvalue:");
for (i=0, yyvs += start; i < count; i++, yyvs++)
- PerlIO_printf(Perl_debug_log, " %8x", yyvs->ival);
+ PerlIO_printf(Perl_debug_log, " %8"UVxf, (UV)yyvs->ival);
PerlIO_printf(Perl_debug_log, "\n\n");
}
tmp = newSVpv( "", 0 ); \
pv_uni_display( tmp, uc, len, 60, UNI_DISPLAY_REGEX ); \
} else { \
- tmp = Perl_newSVpvf_nocontext( "%c", uvc ); \
+ tmp = Perl_newSVpvf_nocontext( "%c", (int)uvc ); \
} \
av_push( trie->revcharmap, tmp ); \
})
svpp = hv_fetch( trie->widecharmap, (char*)&uvc, sizeof( UV ), 1 );
if ( !svpp )
- Perl_croak( aTHX_ "error creating/fetching widecharmap entry for 0x%X", uvc );
+ Perl_croak( aTHX_ "error creating/fetching widecharmap entry for 0x%"UVXf, uvc );
if ( !SvTRUE( *svpp ) ) {
sv_setiv( *svpp, ++trie->uniquecharcount );
state = newstate;
} else {
- Perl_croak( aTHX_ "panic! In trie construction, no char mapping for %d", uvc );
+ Perl_croak( aTHX_ "panic! In trie construction, no char mapping for %"IVdf, uvc );
}
/* charid is now 0 if we dont know the char read, or nonzero if we do */
}
for( state=1 ; state < next_alloc ; state ++ ) {
- PerlIO_printf( Perl_debug_log, "\n %04X :", state );
+ PerlIO_printf( Perl_debug_log, "\n %04"UVXf" :", (UV)state );
if ( ! trie->states[ state ].wordnum ) {
PerlIO_printf( Perl_debug_log, "%5s| ","");
} else {
- PerlIO_printf( Perl_debug_log, "W%04X| ",
+ PerlIO_printf( Perl_debug_log, "W%04x| ",
trie->states[ state ].wordnum
);
}
for( charid = 1 ; charid <= TRIE_LIST_USED( state ) ; charid++ ) {
SV **tmp = av_fetch( trie->revcharmap, TRIE_LIST_ITEM(state,charid).forid, 0);
- PerlIO_printf( Perl_debug_log, "%s:%3X=%04X | ",
+ PerlIO_printf( Perl_debug_log, "%s:%3X=%04"UVXf" | ",
SvPV_nolen( *tmp ),
TRIE_LIST_ITEM(state,charid).forid,
- TRIE_LIST_ITEM(state,charid).newstate
+ (UV)TRIE_LIST_ITEM(state,charid).newstate
);
}
}
state = trie->trans[ state + charid ].next;
} else {
- Perl_croak( aTHX_ "panic! In trie construction, no char mapping for %d", uvc );
+ Perl_croak( aTHX_ "panic! In trie construction, no char mapping for %"IVdf, uvc );
}
/* charid is now 0 if we dont know the char read, or nonzero if we do */
}
for( state=1 ; state < next_alloc ; state += trie->uniquecharcount ) {
- PerlIO_printf( Perl_debug_log, "%04X : ", TRIE_NODENUM( state ) );
+ PerlIO_printf( Perl_debug_log, "%04"UVXf" : ", (UV)TRIE_NODENUM( state ) );
for( charid = 0 ; charid < trie->uniquecharcount ; charid++ ) {
- PerlIO_printf( Perl_debug_log, "%04X ",
- SAFE_TRIE_NODENUM( trie->trans[ state + charid ].next ) );
+ PerlIO_printf( Perl_debug_log, "%04"UVXf" ",
+ (UV)SAFE_TRIE_NODENUM( trie->trans[ state + charid ].next ) );
}
if ( ! trie->states[ TRIE_NODENUM( state ) ].wordnum ) {
- PerlIO_printf( Perl_debug_log, " (%04X)\n", trie->trans[ state ].check );
+ PerlIO_printf( Perl_debug_log, " (%04"UVXf")\n", (UV)trie->trans[ state ].check );
} else {
- PerlIO_printf( Perl_debug_log, " (%04X) W%04X\n", trie->trans[ state ].check,
+ PerlIO_printf( Perl_debug_log, " (%04"UVXf") W%04X\n", (UV)trie->trans[ state ].check,
trie->states[ TRIE_NODENUM( state ) ].wordnum );
}
}
trie->lasttrans = pos + 1;
Renew( trie->states, laststate + 1, reg_trie_state);
DEBUG_TRIE_COMPILE_MORE_r(
- PerlIO_printf( Perl_debug_log, " Alloc: %d Orig: %d elements, Final:%d. Savings of %%%5.2f\n",
- ( ( trie->charcount + 1 ) * trie->uniquecharcount + 1 ), next_alloc, pos,
+ PerlIO_printf( Perl_debug_log,
+ " Alloc: %d Orig: %"IVdf" elements, Final:%"IVdf". Savings of %%%5.2f\n",
+ ( ( trie->charcount + 1 ) * trie->uniquecharcount + 1 ), (IV)next_alloc, (IV)pos,
( ( next_alloc - pos ) * 100 ) / (double)next_alloc );
);
for( state = 1 ; state < trie->laststate ; state++ ) {
U32 base = trie->states[ state ].trans.base;
- PerlIO_printf( Perl_debug_log, "#%04X ", state);
+ PerlIO_printf( Perl_debug_log, "#%04"UVXf" ", (UV)state);
if ( trie->states[ state ].wordnum ) {
PerlIO_printf( Perl_debug_log, " W%04X", trie->states[ state ].wordnum );
PerlIO_printf( Perl_debug_log, "%6s", "" );
}
- PerlIO_printf( Perl_debug_log, " @%04X ", base );
+ PerlIO_printf( Perl_debug_log, " @%04"UVXf" ", (UV)base );
if ( base ) {
U32 ofs = 0;
&& trie->trans[ base + ofs - trie->uniquecharcount ].check != state))
ofs++;
- PerlIO_printf( Perl_debug_log, "+%02X[ ", ofs);
+ PerlIO_printf( Perl_debug_log, "+%02"UVXf"[ ", (UV)ofs);
for ( ofs = 0 ; ofs < trie->uniquecharcount ; ofs++ ) {
if ( ( base + ofs >= trie->uniquecharcount ) &&
( base + ofs - trie->uniquecharcount < trie->lasttrans ) &&
trie->trans[ base + ofs - trie->uniquecharcount ].check == state )
{
- PerlIO_printf( Perl_debug_log, "%04X ",
- trie->trans[ base + ofs - trie->uniquecharcount ].next );
+ PerlIO_printf( Perl_debug_log, "%04"UVXf" ",
+ (UV)trie->trans[ base + ofs - trie->uniquecharcount ].next );
} else {
PerlIO_printf( Perl_debug_log, "%4s "," 0" );
}
}
- PerlIO_printf( Perl_debug_log, "]", ofs);
+ PerlIO_printf( Perl_debug_log, "]");
}
PerlIO_printf( Perl_debug_log, "\n" );
DEBUG_OPTIMISE_r({
SV *mysv=sv_newmortal();
regprop( mysv, scan);
- PerlIO_printf(Perl_debug_log, "%*speep: %s (0x%08X)\n",depth*2,"",SvPV_nolen(mysv),scan);
+ PerlIO_printf(Perl_debug_log, "%*speep: %s (0x%08"UVXf")\n",
+ (int)depth*2, "", SvPV_nolen(mysv), PTR2UV(scan));
});
if (PL_regkind[(U8)OP(scan)] == EXACT) {
DEBUG_OPTIMISE_r({
regprop( mysv, tail );
PerlIO_printf( Perl_debug_log, "%*s%s%s%s\n",
- depth * 2 + 2, "", "Tail node is:", SvPV_nolen( mysv ),
+ (int)depth * 2 + 2, "", "Tail node is:", SvPV_nolen( mysv ),
(RExC_seen_evals) ? "[EVAL]" : ""
);
});
DEBUG_OPTIMISE_r({
regprop( mysv, cur);
PerlIO_printf( Perl_debug_log, "%*s%s",
- depth * 2 + 2," ", SvPV_nolen( mysv ) );
+ (int)depth * 2 + 2," ", SvPV_nolen( mysv ) );
regprop( mysv, noper);
PerlIO_printf( Perl_debug_log, " -> %s",
if (!last ) {
regprop( mysv, first);
PerlIO_printf( Perl_debug_log, "%*s%s",
- depth * 2 + 2, "F:", SvPV_nolen( mysv ) );
+ (int)depth * 2 + 2, "F:", SvPV_nolen( mysv ) );
regprop( mysv, NEXTOPER(first) );
PerlIO_printf( Perl_debug_log, " -> %s\n",
SvPV_nolen( mysv ) );
DEBUG_OPTIMISE_r({
regprop( mysv, cur);
PerlIO_printf( Perl_debug_log, "%*s%s",
- depth * 2 + 2, "N:", SvPV_nolen( mysv ) );
+ (int)depth * 2 + 2, "N:", SvPV_nolen( mysv ) );
regprop( mysv, noper );
PerlIO_printf( Perl_debug_log, " -> %s\n",
SvPV_nolen( mysv ) );
if ( last ) {
DEBUG_OPTIMISE_r(
PerlIO_printf( Perl_debug_log, "%*s%s\n",
- depth * 2 + 2, "E:", "**END**" );
+ (int)depth * 2 + 2, "E:", "**END**" );
);
make_trie( pRExC_state, startbranch, first, cur, tail, optype );
}
DEBUG_OPTIMISE_r({
regprop( mysv, cur);
PerlIO_printf( Perl_debug_log,
- "%*s%s\t(0x%p,0x%p,0x%p)\n", depth * 2 + 2,
+ "%*s%s\t(0x%p,0x%p,0x%p)\n", (int)depth * 2 + 2,
" ", SvPV_nolen( mysv ), first, last, cur);
});
if ( last ) {
DEBUG_OPTIMISE_r(
PerlIO_printf( Perl_debug_log, "%*s%s\n",
- depth * 2 + 2, "E:", "==END==" );
+ (int)depth * 2 + 2, "E:", "==END==" );
);
make_trie( pRExC_state, startbranch, first, scan, tail, optype );
}
const I32 arry_len = av_len(trie->words)+1;
I32 word_idx;
PerlIO_printf(Perl_debug_log,
- "%*s[Words:%d Chars Stored:%d Unique Chars:%d States:%d%s]\n",
+ "%*s[Words:%d Chars Stored:%d Unique Chars:%d States:%"IVdf"%s]\n",
(int)(2*(l+3)), "",
trie->wordcount,
trie->charcount,
trie->uniquecharcount,
- trie->laststate-1,
+ (IV)trie->laststate-1,
node->flags ? " EVAL mode" : "");
for (word_idx=0; word_idx < arry_len; word_idx++) {
PerlIO_printf(Perl_debug_log, "with eval ");
PerlIO_printf(Perl_debug_log, "\n");
if (r->offsets) {
- U32 i;
- const U32 len = r->offsets[0];
+ U32 i;
+ const U32 len = r->offsets[0];
GET_RE_DEBUG_FLAGS_DECL;
DEBUG_OFFSETS_r({
- PerlIO_printf(Perl_debug_log, "Offsets: [%"UVuf"]\n\t", (UV)r->offsets[0]);
- for (i = 1; i <= len; i++)
- PerlIO_printf(Perl_debug_log, "%"UVuf"[%"UVuf"] ",
- (UV)r->offsets[i*2-1],
- (UV)r->offsets[i*2]);
- PerlIO_printf(Perl_debug_log, "\n");
+ PerlIO_printf(Perl_debug_log, "Offsets: [%"UVuf"]\n\t", (UV)r->offsets[0]);
+ for (i = 1; i <= len; i++)
+ PerlIO_printf(Perl_debug_log, "%"UVuf"[%"UVuf"] ",
+ (UV)r->offsets[i*2-1], (UV)r->offsets[i*2]);
+ PerlIO_printf(Perl_debug_log, "\n");
});
}
#endif /* DEBUGGING */
"UTF-8 target...\n"));
PerlIO_printf(Perl_debug_log,
"%sGuessing start of match, REx%s `%s%.60s%s%s' against `%s%.*s%s%s'...\n",
- PL_colors[4],PL_colors[5],PL_colors[0],
+ PL_colors[4], PL_colors[5], PL_colors[0],
prog->precomp,
PL_colors[1],
(strlen(prog->precomp) > 60 ? "..." : ""),
*/
strpos = t + 1;
DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log, "Found /%s^%s/m at offset %ld, rescanning for anchored from offset %ld...\n",
- PL_colors[0],PL_colors[1], (long)(strpos - i_strpos), (long)(strpos - i_strpos + prog->anchored_offset)));
+ PL_colors[0], PL_colors[1], (long)(strpos - i_strpos), (long)(strpos - i_strpos + prog->anchored_offset)));
goto do_other_anchored;
}
/* We don't contradict the found floating substring. */
/* XXXX Why not check for STCLASS? */
s = t + 1;
DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log, "Found /%s^%s/m at offset %ld...\n",
- PL_colors[0],PL_colors[1], (long)(s - i_strpos)));
+ PL_colors[0], PL_colors[1], (long)(s - i_strpos)));
goto set_useful;
}
/* Position contradicts check-string */
/* XXXX probably better to look for check-string
than for "\n", so one should lower the limit for t? */
DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log, "Found /%s^%s/m, restarting lookup for check-string at offset %ld...\n",
- PL_colors[0],PL_colors[1], (long)(t + 1 - i_strpos)));
+ PL_colors[0], PL_colors[1], (long)(t + 1 - i_strpos)));
other_last = strpos = s = t + 1;
goto restart;
}
t++;
}
DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log, "Did not find /%s^%s/m...\n",
- PL_colors[0],PL_colors[1]));
+ PL_colors[0], PL_colors[1]));
goto fail_finish;
}
else {
DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log, "Starting position does not contradict /%s^%s/m...\n",
- PL_colors[0],PL_colors[1]));
+ PL_colors[0], PL_colors[1]));
}
s = t;
set_useful:
}
DEBUG_EXECUTE_r( if (ml_anch)
PerlIO_printf(Perl_debug_log, "Position at offset %ld does not contradict /%s^%s/m...\n",
- (long)(strpos - i_strpos), PL_colors[0],PL_colors[1]);
+ (long)(strpos - i_strpos), PL_colors[0], PL_colors[1]);
);
success_at_start:
if (!(prog->reganch & ROPT_NAUGHTY) /* XXXX If strpos moved? */
goto giveup;
DEBUG_EXECUTE_r( PerlIO_printf(Perl_debug_log,
"Looking for /%s^%s/m starting at offset %ld...\n",
- PL_colors[0],PL_colors[1], (long)(t - i_strpos)) );
+ PL_colors[0], PL_colors[1], (long)(t - i_strpos)) );
goto try_at_offset;
}
if (!(do_utf8 ? prog->float_utf8 : prog->float_substr)) /* Could have been deleted */
BmUSEFUL(do_utf8 ? prog->check_utf8 : prog->check_substr) += 5; /* hooray */
fail:
DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log, "%sMatch rejected by optimizer%s\n",
- PL_colors[4],PL_colors[5]));
+ PL_colors[4], PL_colors[5]));
return Nullch;
}
reginitcolors();
PerlIO_printf(Perl_debug_log,
"%sMatching REx%s `%s%*.*s%s%s' against `%s%.*s%s%s'\n",
- PL_colors[4],PL_colors[5],PL_colors[0],
+ PL_colors[4], PL_colors[5], PL_colors[0],
len0, len0, s0,
PL_colors[1],
len0 > 60 ? "..." : "",
if (last == NULL) {
DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log,
"%sCan't trim the tail, match fails (should not happen)%s\n",
- PL_colors[4],PL_colors[5]));
+ PL_colors[4], PL_colors[5]));
goto phooey; /* Should not happen! */
}
dontbother = strend - last + prog->float_min_offset;
phooey:
DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log, "%sMatch failed%s\n",
- PL_colors[4],PL_colors[5]));
+ PL_colors[4], PL_colors[5]));
if (PL_reg_eval_set)
restore_pos(aTHX_ 0);
return 0;
SAVEDESTRUCTOR_X(restore_pos, 0);
}
if (!PL_reg_curpm) {
- Newz(22,PL_reg_curpm, 1, PMOP);
+ Newz(22, PL_reg_curpm, 1, PMOP);
#ifdef USE_ITHREADS
{
SV* repointer = newSViv(0);
if(PL_reg_start_tmp)
Renew(PL_reg_start_tmp, PL_reg_start_tmpl, char*);
else
- New(22,PL_reg_start_tmp, PL_reg_start_tmpl, char*);
+ New(22, PL_reg_start_tmp, PL_reg_start_tmpl, char*);
}
/* XXXX What this code is doing here?!!! There should be no need
DEBUG_TRIE_EXECUTE_r(
PerlIO_printf( Perl_debug_log,
- "%*s %sState: %4x, Base: %4x Accepted: %4x ",
+ "%*s %sState: %4"UVxf", Base: %4"UVxf", Accepted: %4"UVxf" ",
REPORT_CODE_OFF + PL_regindent * 2, "", PL_colors[4],
- state, base, accepted );
+ (UV)state, (UV)base, (UV)accepted );
);
if ( base ) {
uscan = foldbuf + UNISKIP( uvc );
}
} else {
- uvc = (U32)*uc;
+ uvc = (UV)*uc;
len = 1;
}
state = 0;
}
DEBUG_TRIE_EXECUTE_r(
- PerlIO_printf( Perl_debug_log,
- "Charid:%3x CV:%4x After State: %4x%s\n",
- charid, uvc, state, PL_colors[5] );
+ PerlIO_printf( Perl_debug_log,
+ "Charid:%3x CV:%4"UVxf" After State: %4"UVxf"%s\n",
+ charid, uvc, (UV)state, PL_colors[5] );
);
}
if ( !accepted ) {
DEBUG_TRIE_EXECUTE_r(
PerlIO_printf( Perl_debug_log,
- "%*s %sState: %4x, Base: %4x Accepted: %4x ",
+ "%*s %sState: %4"UVxf", Base: %4"UVxf", Accepted: %4"UVxf" ",
REPORT_CODE_OFF + PL_regindent * 2, "", PL_colors[4],
- state, base, accepted );
+ (UV)state, (UV)base, (UV)accepted );
);
if ( base ) {
}
DEBUG_TRIE_EXECUTE_r(
PerlIO_printf( Perl_debug_log,
- "Charid:%3x CV:%4x After State: %4x%s\n",
- charid, uvc, state, PL_colors[5] );
+ "Charid:%3x CV:%4"UVxf" After State: %4"UVxf"%s\n",
+ charid, uvc, (UV)state, PL_colors[5] );
);
}
if ( !accepted ) {
SV **tmp = av_fetch( trie->words, accept_buff[ 0 ].wordnum-1, 0 );
PerlIO_printf( Perl_debug_log,
"%*s %sonly one match : #%d <%s>%s\n",
- REPORT_CODE_OFF+PL_regindent*2, "",PL_colors[4],
+ REPORT_CODE_OFF+PL_regindent*2, "", PL_colors[4],
accept_buff[ 0 ].wordnum,
tmp ? SvPV_nolen( *tmp ) : "not compiled under -Dr",
PL_colors[5] );
gotit = regmatch( scan + NEXT_OFF( scan ) );
} else {
DEBUG_EXECUTE_r(
- PerlIO_printf( Perl_debug_log,"%*s %sgot %d possible matches%s\n",
- REPORT_CODE_OFF + PL_regindent * 2, "",PL_colors[4], accepted,
+ PerlIO_printf( Perl_debug_log,"%*s %sgot %"IVdf" possible matches%s\n",
+ REPORT_CODE_OFF + PL_regindent * 2, "", PL_colors[4], (IV)accepted,
PL_colors[5] );
);
while ( !gotit && accepted-- ) {
U32 best = 0;
U32 cur;
for( cur = 1 ; cur <= accepted ; cur++ ) {
- DEBUG_TRIE_EXECUTE_r(
- PerlIO_printf( Perl_debug_log,
- "%*s %sgot %d (%d) as best, looking at %d (%d)%s\n",
- REPORT_CODE_OFF + PL_regindent * 2, "", PL_colors[4],
- best, accept_buff[ best ].wordnum, cur,
- accept_buff[ cur ].wordnum, PL_colors[5] );
- );
+ DEBUG_TRIE_EXECUTE_r(
+ PerlIO_printf( Perl_debug_log,
+ "%*s %sgot %"IVdf" (%d) as best, looking at %"IVdf" (%d)%s\n",
+ REPORT_CODE_OFF + PL_regindent * 2, "", PL_colors[4],
+ (IV)best, accept_buff[ best ].wordnum, (IV)cur,
+ accept_buff[ cur ].wordnum, PL_colors[5] );
+ );
if ( accept_buff[ cur ].wordnum < accept_buff[ best ].wordnum )
best = cur;
DEBUG_EXECUTE_r({
SV **tmp = av_fetch( trie->words, accept_buff[ best ].wordnum - 1, 0 );
PerlIO_printf( Perl_debug_log, "%*s %strying alternation #%d <%s> at 0x%p%s\n",
- REPORT_CODE_OFF+PL_regindent*2, "",PL_colors[4],
+ REPORT_CODE_OFF+PL_regindent*2, "", PL_colors[4],
accept_buff[best].wordnum,
tmp ? SvPV_nolen( *tmp ) : "not compiled under -Dr",scan,
PL_colors[5] );
DEBUG_EXECUTE_r(
PerlIO_printf(Perl_debug_log,
"%*s %scould match...%s\n",
- REPORT_CODE_OFF+PL_regindent*2, "", PL_colors[4],PL_colors[5])
+ REPORT_CODE_OFF+PL_regindent*2, "", PL_colors[4], PL_colors[5])
);
goto yes;
yes_final:
DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log, "%sMatch successful!%s\n",
- PL_colors[4],PL_colors[5]));
+ PL_colors[4], PL_colors[5]));
yes:
#ifdef DEBUGGING
PL_regindent--;
DEBUG_EXECUTE_r(
PerlIO_printf(Perl_debug_log,
"%*s %sfailed...%s\n",
- REPORT_CODE_OFF+PL_regindent*2, "",PL_colors[4],PL_colors[5])
+ REPORT_CODE_OFF+PL_regindent*2, "", PL_colors[4], PL_colors[5])
);
goto do_no;
no_final:
case TOKENTYPE_GVVAL: /* doesn't appear to be used */
break;
case TOKENTYPE_IVAL:
- Perl_sv_catpvf(aTHX_ report, "(ival=%"IVdf")", yylval.ival);
+ Perl_sv_catpvf(aTHX_ report, "(ival=%"IVdf")", (IV)yylval.ival);
break;
case TOKENTYPE_OPNUM:
Perl_sv_catpvf(aTHX_ report, "(ival=op_%s)",
Perl_sv_catpv(aTHX_ report, "(opval=null)");
break;
}
- Perl_sv_catpvf(aTHX_ report, " at line %d [", CopLINE(PL_curcop));
+ Perl_sv_catpvf(aTHX_ report, " at line %"IVdf" [", (IV)CopLINE(PL_curcop));
if (s - PL_bufptr > 0)
sv_catpvn(report, PL_bufptr, s - PL_bufptr);
else {