regcomp.c: Add some const's to static fcn
authorKarl Williamson <khw@cpan.org>
Sun, 14 Oct 2018 22:10:01 +0000 (16:10 -0600)
committerKarl Williamson <khw@cpan.org>
Sat, 20 Oct 2018 06:09:55 +0000 (00:09 -0600)
Since it's static, the compiler can figure out these are consts, but
knowing this helped me read the code

embed.fnc
proto.h
regcomp.c

index 6ef9629..eadc706 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -2429,7 +2429,9 @@ Es        |bool   |grok_bslash_N  |NN RExC_state_t *pRExC_state               \
                                |const bool strict                          \
                                |const U32 depth
 Es     |void   |reginsert      |NN RExC_state_t *pRExC_state \
-                               |U8 op|regnode_offset operand|U32 depth
+                               |const U8 op                                \
+                               |const regnode_offset operand               \
+                               |const U32 depth
 Es     |void   |regtail        |NN RExC_state_t * pRExC_state              \
                                |NN const regnode_offset p                  \
                                |NN const regnode_offset val                \
diff --git a/proto.h b/proto.h
index 49eadfb..b72bd2a 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -5539,7 +5539,7 @@ STATIC regnode_offset     S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U3
 STATIC unsigned int    S_regex_set_precedence(const U8 my_operator)
                        __attribute__warn_unused_result__;
 
-STATIC void    S_reginsert(pTHX_ RExC_state_t *pRExC_state, U8 op, regnode_offset operand, U32 depth);
+STATIC void    S_reginsert(pTHX_ RExC_state_t *pRExC_state, const U8 op, const regnode_offset operand, const U32 depth);
 #define PERL_ARGS_ASSERT_REGINSERT     \
        assert(pRExC_state)
 STATIC regnode_offset  S_regnode_guts(pTHX_ RExC_state_t *pRExC_state, const U8 op, const STRLEN extra_len, const char* const name);
index 299ab21..5a5ef57 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -19322,8 +19322,8 @@ S_reg2Lanode(pTHX_ RExC_state_t *pRExC_state, const U8 op, const U32 arg1, const
 * ALSO NOTE - FLAGS(newly-inserted-operator) will be set to 0 as well.
 */
 STATIC void
-S_reginsert(pTHX_ RExC_state_t *pRExC_state, U8 op,
-                  regnode_offset operand, U32 depth)
+S_reginsert(pTHX_ RExC_state_t *pRExC_state, const U8 op,
+                  const regnode_offset operand, const U32 depth)
 {
     regnode *src;
     regnode *dst;