All S_dumpuntil()'s regnode pointer arguments can be const.
authorNicholas Clark <nick@ccl4.org>
Mon, 10 Apr 2006 19:55:49 +0000 (19:55 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 10 Apr 2006 19:55:49 +0000 (19:55 +0000)
p4raw-id: //depot/perl@27762

embed.fnc
proto.h
regcomp.c

index c7e6495..926fa2e 100644 (file)
--- 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 (file)
--- 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)
index fe32ce2..ff17478 100644 (file)
--- 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);