summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-10-14 16:10:01 -0600
committerKarl Williamson <khw@cpan.org>2018-10-20 00:09:55 -0600
commita9f8f0e7ea8fdf2c9f0e78f6e01b9ef605907200 (patch)
tree07cb4569bd40110b14ac6180ed9511057ab3fffe
parente3f47c2f4d2eacb0570803023a6dd9c010aac7f4 (diff)
downloadperl-a9f8f0e7ea8fdf2c9f0e78f6e01b9ef605907200.tar.gz
regcomp.c: Add some const's to static fcn
Since it's static, the compiler can figure out these are consts, but knowing this helped me read the code
-rw-r--r--embed.fnc4
-rw-r--r--proto.h2
-rw-r--r--regcomp.c4
3 files changed, 6 insertions, 4 deletions
diff --git a/embed.fnc b/embed.fnc
index 6ef9629132..eadc706496 100644
--- 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 49eadfbd75..b72bd2a2df 100644
--- 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);
diff --git a/regcomp.c b/regcomp.c
index 299ab2104c..5a5ef57b51 100644
--- 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;