From: Nicholas Clark Date: Mon, 10 Apr 2006 19:55:49 +0000 (+0000) Subject: All S_dumpuntil()'s regnode pointer arguments can be const. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b5a2f8d883d38be33345ce4afe970bc14be51e58;p=p5sagit%2Fp5-mst-13.2.git All S_dumpuntil()'s regnode pointer arguments can be const. p4raw-id: //depot/perl@27762 --- diff --git a/embed.fnc b/embed.fnc index c7e6495..926fa2e 100644 --- a/embed.fnc +++ b/embed.fnc @@ -1293,8 +1293,9 @@ Es |void |regtail |NN const struct RExC_state_t *state|NN regnode *p|NN const re EsRn |char* |regwhite |NN char *p|NN const char *e Es |char* |nextchar |NN struct RExC_state_t *state # ifdef DEBUGGING -Es |regnode*|dumpuntil |NN const regexp *r|NN regnode *start|NN regnode *node \ - |NULLOK regnode *last|NN SV* sv|I32 l +Es |const regnode*|dumpuntil|NN const regexp *r|NN const regnode *start \ + |NN const regnode *node \ + |NULLOK const regnode *last|NN SV* sv|I32 l Es |void |put_byte |NN SV* sv|int c # endif Es |void |scan_commit |NN const struct RExC_state_t* state|NN struct scan_data_t *data diff --git a/proto.h b/proto.h index 736d35c..851d881 100644 --- a/proto.h +++ b/proto.h @@ -3548,7 +3548,7 @@ STATIC char* S_nextchar(pTHX_ struct RExC_state_t *state) __attribute__nonnull__(pTHX_1); # ifdef DEBUGGING -STATIC regnode* S_dumpuntil(pTHX_ const regexp *r, regnode *start, regnode *node, regnode *last, SV* sv, I32 l) +STATIC const regnode* S_dumpuntil(pTHX_ const regexp *r, const regnode *start, const regnode *node, const regnode *last, SV* sv, I32 l) __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_2) __attribute__nonnull__(pTHX_3) diff --git a/regcomp.c b/regcomp.c index fe32ce2..ff17478 100644 --- a/regcomp.c +++ b/regcomp.c @@ -6228,13 +6228,13 @@ S_put_byte(pTHX_ SV *sv, int c) } -STATIC regnode * -S_dumpuntil(pTHX_ const regexp *r, regnode *start, regnode *node, regnode *last, - SV* sv, I32 l) +STATIC const regnode * +S_dumpuntil(pTHX_ const regexp *r, const regnode *start, const regnode *node, + const regnode *last, SV* sv, I32 l) { dVAR; register U8 op = EXACT; /* Arbitrary non-END op. */ - register regnode *next; + register const regnode *next; while (op != END && (!last || node < last)) { /* While that wasn't END last time... */ @@ -6243,7 +6243,7 @@ S_dumpuntil(pTHX_ const regexp *r, regnode *start, regnode *node, regnode *last, op = OP(node); if (op == CLOSE) l--; - next = regnext(node); + next = regnext((regnode *)node); /* Where, what. */ if (OP(node) == OPTIMIZED) goto after_print; @@ -6257,9 +6257,9 @@ S_dumpuntil(pTHX_ const regexp *r, regnode *start, regnode *node, regnode *last, (void)PerlIO_putc(Perl_debug_log, '\n'); after_print: if (PL_regkind[(U8)op] == BRANCHJ) { - register regnode *nnode = (OP(next) == LONGJMP - ? regnext(next) - : next); + register const regnode *nnode = (OP(next) == LONGJMP + ? regnext((regnode *)next) + : next); if (last && nnode > last) nnode = last; node = dumpuntil(r, start, NEXTOPER(NEXTOPER(node)), nnode, sv, l + 1);