regcomp.c: Add parameter to static function
authorKarl Williamson <public@khwilliamson.com>
Thu, 15 Aug 2013 17:19:02 +0000 (11:19 -0600)
committerKarl Williamson <public@khwilliamson.com>
Tue, 24 Sep 2013 17:36:16 +0000 (11:36 -0600)
This parameter will be used in future commits.  This commit is really
only to make the difference listing smaller in those, by committing
separately just the book-keeping parts.  This parameter requires also
passing the aTHX_ thread parameter

embed.fnc
embed.h
proto.h
regcomp.c

index 7e50627..9e69596 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -2059,7 +2059,8 @@ Esn       |void   |ssc_anything   |NN const RExC_state_t *pRExC_state \
 EsRn   |int    |ssc_is_anything|NN const regnode_ssc *ssc
 Esn    |void   |ssc_init       |NN const RExC_state_t *pRExC_state \
                                |NN regnode_ssc *ssc
-Esn    |void   |ssc_and        |NN regnode_ssc *ssc \
+Es     |void   |ssc_and        |NN const RExC_state_t *pRExC_state \
+                               |NN regnode_ssc *ssc                \
                                |NN const regnode_ssc *and_with
 Esn    |void   |ssc_or         |NN const RExC_state_t *pRExC_state \
                                |NN regnode_ssc *ssc \
diff --git a/embed.h b/embed.h
index a060cce..45d9f89 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define regwhite               S_regwhite
 #define scan_commit(a,b,c,d)   S_scan_commit(aTHX_ a,b,c,d)
 #define set_ANYOF_arg(a,b,c,d,e,f)     S_set_ANYOF_arg(aTHX_ a,b,c,d,e,f)
-#define ssc_and                        S_ssc_and
+#define ssc_and(a,b,c)         S_ssc_and(aTHX_ a,b,c)
 #define ssc_anything           S_ssc_anything
 #define ssc_init               S_ssc_init
 #define ssc_is_anything                S_ssc_is_anything
diff --git a/proto.h b/proto.h
index 74c50e8..184805d 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -6809,11 +6809,12 @@ STATIC void     S_set_ANYOF_arg(pTHX_ RExC_state_t* const pRExC_state, regnode* cons
 #define PERL_ARGS_ASSERT_SET_ANYOF_ARG \
        assert(pRExC_state); assert(node)
 
-STATIC void    S_ssc_and(regnode_ssc *ssc, const regnode_ssc *and_with)
-                       __attribute__nonnull__(1)
-                       __attribute__nonnull__(2);
+STATIC void    S_ssc_and(pTHX_ const RExC_state_t *pRExC_state, regnode_ssc *ssc, const regnode_ssc *and_with)
+                       __attribute__nonnull__(pTHX_1)
+                       __attribute__nonnull__(pTHX_2)
+                       __attribute__nonnull__(pTHX_3);
 #define PERL_ARGS_ASSERT_SSC_AND       \
-       assert(ssc); assert(and_with)
+       assert(pRExC_state); assert(ssc); assert(and_with)
 
 STATIC void    S_ssc_anything(const RExC_state_t *pRExC_state, regnode_ssc *ssc)
                        __attribute__nonnull__(1)
index 7d863be..af43194 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -875,7 +875,7 @@ S_ssc_init(const RExC_state_t *pRExC_state, regnode_ssc *ssc)
  * should not be inverted.  'and_with->flags & ANYOF_POSIXL' should be 0 if
  * 'and_with' is a regnode_charclass instead of a regnode_ssc. */
 STATIC void
-S_ssc_and(regnode_ssc *ssc, const regnode_ssc *and_with)
+S_ssc_and(pTHX_ const RExC_state_t *pRExC_state, regnode_ssc *ssc, const regnode_ssc *and_with)
 {
     PERL_ARGS_ASSERT_SSC_AND;
 
@@ -3210,13 +3210,13 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
                if (flags & SCF_DO_STCLASS_OR) {
                    ssc_or(pRExC_state, data->start_class, &accum);
                    if (min1) {
-                       ssc_and(data->start_class, and_withp);
+                       ssc_and(pRExC_state, data->start_class, and_withp);
                        flags &= ~SCF_DO_STCLASS;
                    }
                }
                else if (flags & SCF_DO_STCLASS_AND) {
                    if (min1) {
-                       ssc_and(data->start_class, &accum);
+                       ssc_and(pRExC_state, data->start_class, &accum);
                        flags &= ~SCF_DO_STCLASS;
                    }
                    else {
@@ -3674,7 +3674,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
                else
                    data->start_class->flags |= ANYOF_UNICODE_ALL;
                 CLEAR_SSC_EOS(data->start_class);
-               ssc_and(data->start_class, and_withp);
+               ssc_and(pRExC_state, data->start_class, and_withp);
            }
            flags &= ~SCF_DO_STCLASS;
        }
@@ -3794,7 +3794,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
                    }
                     CLEAR_SSC_EOS(data->start_class);
                }
-               ssc_and(data->start_class, and_withp);
+               ssc_and(pRExC_state, data->start_class, and_withp);
            }
            flags &= ~SCF_DO_STCLASS;
        }
@@ -3912,10 +3912,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
                } else {                /* Non-zero len */
                    if (flags & SCF_DO_STCLASS_OR) {
                        ssc_or(pRExC_state, data->start_class, &this_class);
-                       ssc_and(data->start_class, and_withp);
+                       ssc_and(pRExC_state, data->start_class, and_withp);
                    }
                    else if (flags & SCF_DO_STCLASS_AND)
-                       ssc_and(data->start_class, &this_class);
+                       ssc_and(pRExC_state, data->start_class, &this_class);
                    flags &= ~SCF_DO_STCLASS;
                }
                if (!scan)              /* It was not CURLYX, but CURLY. */
@@ -4186,7 +4186,7 @@ PerlIO_printf(Perl_debug_log, "LHS=%"UVdf" RHS=%"UVdf"\n",
                             ANYOF_BITMAP_SET(data->start_class, value);
                 }
                 if (flags & SCF_DO_STCLASS_OR)
-                   ssc_and(data->start_class, and_withp);
+                   ssc_and(pRExC_state, data->start_class, and_withp);
                flags &= ~SCF_DO_STCLASS;
             }
            min++;
@@ -4237,7 +4237,7 @@ PerlIO_printf(Perl_debug_log, "LHS=%"UVdf" RHS=%"UVdf"\n",
                    break;
                case ANYOF:
                    if (flags & SCF_DO_STCLASS_AND)
-                       ssc_and(data->start_class, (regnode_ssc*)scan);
+                       ssc_and(pRExC_state, data->start_class, (regnode_ssc*)scan);
                    else
                        ssc_or(pRExC_state, data->start_class,
                                                           (regnode_ssc*)scan);
@@ -4318,7 +4318,7 @@ PerlIO_printf(Perl_debug_log, "LHS=%"UVdf" RHS=%"UVdf"\n",
                    break;
                }
                if (flags & SCF_DO_STCLASS_OR)
-                   ssc_and(data->start_class, and_withp);
+                   ssc_and(pRExC_state, data->start_class, and_withp);
                flags &= ~SCF_DO_STCLASS;
            }
        }
@@ -4420,7 +4420,7 @@ PerlIO_printf(Perl_debug_log, "LHS=%"UVdf" RHS=%"UVdf"\n",
                        /* AND before and after: combine and continue */
                        const int was = TEST_SSC_EOS(data->start_class);
 
-                       ssc_and(data->start_class, &intrnl);
+                       ssc_and(pRExC_state, data->start_class, &intrnl);
                        if (was)
                             SET_SSC_EOS(data->start_class);
                    }
@@ -4492,7 +4492,7 @@ PerlIO_printf(Perl_debug_log, "LHS=%"UVdf" RHS=%"UVdf"\n",
                 if (f & SCF_DO_STCLASS_AND) {
                     const int was = TEST_SSC_EOS(data->start_class);
 
-                    ssc_and(data->start_class, &intrnl);
+                    ssc_and(pRExC_state, data->start_class, &intrnl);
                     if (was)
                         SET_SSC_EOS(data->start_class);
                 }
@@ -4679,13 +4679,13 @@ PerlIO_printf(Perl_debug_log, "LHS=%"UVdf" RHS=%"UVdf"\n",
             if (flags & SCF_DO_STCLASS_OR) {
                 ssc_or(pRExC_state, data->start_class, &accum);
                 if (min1) {
-                    ssc_and(data->start_class, and_withp);
+                    ssc_and(pRExC_state, data->start_class, and_withp);
                     flags &= ~SCF_DO_STCLASS;
                 }
             }
             else if (flags & SCF_DO_STCLASS_AND) {
                 if (min1) {
-                    ssc_and(data->start_class, &accum);
+                    ssc_and(pRExC_state, data->start_class, &accum);
                     flags &= ~SCF_DO_STCLASS;
                 }
                 else {
@@ -4753,7 +4753,7 @@ PerlIO_printf(Perl_debug_log, "LHS=%"UVdf" RHS=%"UVdf"\n",
        data->flags &= ~SF_IN_PAR;
     }
     if (flags & SCF_DO_STCLASS_OR)
-       ssc_and(data->start_class, and_withp);
+       ssc_and(pRExC_state, data->start_class, and_withp);
     if (flags & SCF_TRIE_RESTUDY)
         data->flags |=         SCF_TRIE_RESTUDY;