summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avar@cpan.org>2007-04-27 02:22:25 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-04-30 08:42:44 +0000
commit49d7dfbcef7527d25e8c34643f831ef2416923a3 (patch)
treee6aab75bbf4b4b188a44c1c2de72cfcfb77ec33c /regcomp.c
parent8fc8005d410ad8042b6d15ffc54dff4894a7075f (diff)
downloadperl-49d7dfbcef7527d25e8c34643f831ef2416923a3.tar.gz
Re: [PATCH] Cleanup of the regexp API
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com> Message-ID: <51dd1af80704261922j3db0615wa86ccc4cb65b2713@mail.gmail.com> p4raw-id: //depot/perl@31106
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/regcomp.c b/regcomp.c
index fcc30bfaf5..35125d9a47 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -4796,7 +4796,7 @@ reStudy:
SV*
-Perl_reg_named_buff_get(pTHX_ const REGEXP * const rx, SV* namesv, U32 flags)
+Perl_reg_named_buff_get(pTHX_ REGEXP * const rx, SV * const namesv, const U32 flags)
{
AV *retarray = NULL;
SV *ret;
@@ -4814,7 +4814,8 @@ Perl_reg_named_buff_get(pTHX_ const REGEXP * const rx, SV* namesv, U32 flags)
&& rx->offs[nums[i]].start != -1
&& rx->offs[nums[i]].end != -1)
{
- ret = CALLREG_NUMBUF(rx,nums[i],NULL);
+ ret = newSVpvs("");
+ CALLREG_NUMBUF(rx,nums[i],ret);
if (!retarray)
return ret;
} else {
@@ -4832,17 +4833,16 @@ Perl_reg_named_buff_get(pTHX_ const REGEXP * const rx, SV* namesv, U32 flags)
return NULL;
}
-SV*
-Perl_reg_numbered_buff_get(pTHX_ const REGEXP * const rx, I32 paren, SV* usesv)
+void
+Perl_reg_numbered_buff_get(pTHX_ REGEXP * const rx, const I32 paren, SV * const sv)
{
char *s = NULL;
I32 i = 0;
I32 s1, t1;
- SV *sv = usesv ? usesv : newSVpvs("");
if (!rx->subbeg) {
sv_setsv(sv,&PL_sv_undef);
- return sv;
+ return;
}
else
if (paren == -2 && rx->offs[0].start != -1) {
@@ -4866,7 +4866,7 @@ Perl_reg_numbered_buff_get(pTHX_ const REGEXP * const rx, I32 paren, SV* usesv)
s = rx->subbeg + s1;
} else {
sv_setsv(sv,&PL_sv_undef);
- return sv;
+ return;
}
assert(rx->sublen >= (s - rx->subbeg) + i );
if (i >= 0) {
@@ -4904,12 +4904,12 @@ Perl_reg_numbered_buff_get(pTHX_ const REGEXP * const rx, I32 paren, SV* usesv)
}
} else {
sv_setsv(sv,&PL_sv_undef);
+ return;
}
- return sv;
}
SV*
-Perl_reg_qr_pkg(pTHX_ const REGEXP * const rx)
+Perl_reg_qr_package(pTHX_ REGEXP * const rx)
{
PERL_UNUSED_ARG(rx);
return newSVpvs("Regexp");
@@ -8750,7 +8750,7 @@ Perl_regprop(pTHX_ const regexp *prog, SV *sv, const regnode *o)
}
SV *
-Perl_re_intuit_string(pTHX_ regexp *prog)
+Perl_re_intuit_string(pTHX_ REGEXP * const prog)
{ /* Assume that RE_INTUIT is set */
dVAR;
GET_RE_DEBUG_FLAGS_DECL;
@@ -9117,7 +9117,7 @@ Perl_re_dup(pTHX_ const regexp *r, CLONE_PARAMS *param)
*/
void *
-Perl_regdupe_internal(pTHX_ const regexp *r, CLONE_PARAMS *param)
+Perl_regdupe_internal(pTHX_ REGEXP * const r, CLONE_PARAMS *param)
{
dVAR;
regexp_internal *reti;