summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-03-08 16:20:52 -0700
committerKarl Williamson <public@khwilliamson.com>2011-03-08 23:22:16 -0700
commit1051e1c4d07fec1c36934f253d2baa8842339cbf (patch)
treecaa6569f6fa193b079b47b6f1387433ef3aacf40
parentcf34198ebe3dd876d67c10caa9acf491ad2a0c51 (diff)
downloadperl-1051e1c4d07fec1c36934f253d2baa8842339cbf.tar.gz
regcomp.c: Merge identical functions
These two functions now have identical code, so merge them, but use a macro in case they ever need to diverge again.
-rw-r--r--embed.fnc2
-rw-r--r--embed.h1
-rw-r--r--proto.h6
-rw-r--r--regcomp.c11
4 files changed, 2 insertions, 18 deletions
diff --git a/embed.fnc b/embed.fnc
index 7dcb82e4d3..cc748c8fb9 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -1808,8 +1808,6 @@ Esn |void |cl_anything |NN const struct RExC_state_t *pRExC_state \
EsRn |int |cl_is_anything |NN const struct regnode_charclass_class *cl
Esn |void |cl_init |NN const struct RExC_state_t *pRExC_state \
|NN struct regnode_charclass_class *cl
-Esn |void |cl_init_zero |NN const struct RExC_state_t *pRExC_state \
- |NN struct regnode_charclass_class *cl
Esn |void |cl_and |NN struct regnode_charclass_class *cl \
|NN const struct regnode_charclass_class *and_with
Esn |void |cl_or |NN const struct RExC_state_t *pRExC_state \
diff --git a/embed.h b/embed.h
index 743eb46ad7..1ae431d04b 100644
--- a/embed.h
+++ b/embed.h
@@ -874,7 +874,6 @@
#define cl_and S_cl_and
#define cl_anything S_cl_anything
#define cl_init S_cl_init
-#define cl_init_zero S_cl_init_zero
#define cl_is_anything S_cl_is_anything
#define cl_or S_cl_or
#define invlist_array(a) S_invlist_array(aTHX_ a)
diff --git a/proto.h b/proto.h
index 80f3bc0fe7..03ced95ef2 100644
--- a/proto.h
+++ b/proto.h
@@ -6000,12 +6000,6 @@ STATIC void S_cl_init(const struct RExC_state_t *pRExC_state, struct regnode_cha
#define PERL_ARGS_ASSERT_CL_INIT \
assert(pRExC_state); assert(cl)
-STATIC void S_cl_init_zero(const struct RExC_state_t *pRExC_state, struct regnode_charclass_class *cl)
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-#define PERL_ARGS_ASSERT_CL_INIT_ZERO \
- assert(pRExC_state); assert(cl)
-
STATIC int S_cl_is_anything(const struct regnode_charclass_class *cl)
__attribute__warn_unused_result__
__attribute__nonnull__(1);
diff --git a/regcomp.c b/regcomp.c
index 18079ff034..620b0264bd 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -758,15 +758,8 @@ S_cl_init(const RExC_state_t *pRExC_state, struct regnode_charclass_class *cl)
cl_anything(pRExC_state, cl);
}
-STATIC void
-S_cl_init_zero(const RExC_state_t *pRExC_state, struct regnode_charclass_class *cl)
-{
- PERL_ARGS_ASSERT_CL_INIT_ZERO;
-
- Zero(cl, 1, struct regnode_charclass_class);
- cl->type = ANYOF;
- cl_anything(pRExC_state, cl);
-}
+/* These two functions currently do the exact same thing */
+#define cl_init_zero S_cl_init
/* 'And' a given class with another one. Can create false positives */
/* cl should not be inverted */