diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-01-02 12:06:05 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-01-02 12:06:05 +0000 |
commit | 07bc277f32c1d7aff237dd3f55d558b5d4b93314 (patch) | |
tree | 86a4a36156c095e618d07cc5cb6d35875496d75f /pp_ctl.c | |
parent | 3d66076ad00dfe06380fb774b92fb59dc07fe4ec (diff) | |
download | perl-07bc277f32c1d7aff237dd3f55d558b5d4b93314.tar.gz |
Wrap all deferences of struct regexp* in macros RX_*() [and for
regcomp.c and regexec.c RXp_* where necessary] so that in future we
can maintain source compatibility when we add an extra level of
dereferencing.
p4raw-id: //depot/perl@32802
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 46 |
1 files changed, 23 insertions, 23 deletions
@@ -133,7 +133,7 @@ PP(pp_regcomp) if (!re || !RX_PRECOMP(re) || RX_PRELEN(re) != (I32)len || memNE(RX_PRECOMP(re), t, len)) { - const regexp_engine *eng = re ? re->engine : NULL; + const regexp_engine *eng = re ? RX_ENGINE(re) : NULL; U32 pm_flags = pm->op_pmflags & PMf_COMPILETIME; if (re) { ReREFCNT_dec(re); @@ -166,9 +166,9 @@ PP(pp_regcomp) #ifndef INCOMPLETE_TAINTS if (PL_tainting) { if (PL_tainted) - re->extflags |= RXf_TAINTED; + RX_EXTFLAGS(re) |= RXf_TAINTED; else - re->extflags &= ~RXf_TAINTED; + RX_EXTFLAGS(re) &= ~RXf_TAINTED; } #endif @@ -266,21 +266,21 @@ PP(pp_substcont) } cx->sb_iters = saviters; } - if (RX_MATCH_COPIED(rx) && rx->subbeg != orig) { + if (RX_MATCH_COPIED(rx) && RX_SUBBEG(rx) != orig) { m = s; s = orig; - cx->sb_orig = orig = rx->subbeg; + cx->sb_orig = orig = RX_SUBBEG(rx); s = orig + (m - s); cx->sb_strend = s + (cx->sb_strend - m); } - cx->sb_m = m = rx->offs[0].start + orig; + cx->sb_m = m = RX_OFFS(rx)[0].start + orig; if (m > s) { if (DO_UTF8(dstr) && !SvUTF8(cx->sb_targ)) sv_catpvn_utf8_upgrade(dstr, s, m - s, nsv); else sv_catpvn(dstr, s, m-s); } - cx->sb_s = rx->offs[0].end + orig; + cx->sb_s = RX_OFFS(rx)[0].end + orig; { /* Update the pos() information. */ SV * const sv = cx->sb_targ; MAGIC *mg; @@ -313,11 +313,11 @@ Perl_rxres_save(pTHX_ void **rsp, REGEXP *rx) U32 i; PERL_UNUSED_CONTEXT; - if (!p || p[1] < rx->nparens) { + if (!p || p[1] < RX_NPARENS(rx)) { #ifdef PERL_OLD_COPY_ON_WRITE - i = 7 + rx->nparens * 2; + i = 7 + RX_NPARENS(rx) * 2; #else - i = 6 + rx->nparens * 2; + i = 6 + RX_NPARENS(rx) * 2; #endif if (!p) Newx(p, i, UV); @@ -326,7 +326,7 @@ Perl_rxres_save(pTHX_ void **rsp, REGEXP *rx) *rsp = (void*)p; } - *p++ = PTR2UV(RX_MATCH_COPIED(rx) ? rx->subbeg : NULL); + *p++ = PTR2UV(RX_MATCH_COPIED(rx) ? RX_SUBBEG(rx) : NULL); RX_MATCH_COPIED_off(rx); #ifdef PERL_OLD_COPY_ON_WRITE @@ -334,13 +334,13 @@ Perl_rxres_save(pTHX_ void **rsp, REGEXP *rx) rx->saved_copy = NULL; #endif - *p++ = rx->nparens; + *p++ = RX_NPARENS(rx); - *p++ = PTR2UV(rx->subbeg); - *p++ = (UV)rx->sublen; - for (i = 0; i <= rx->nparens; ++i) { - *p++ = (UV)rx->offs[i].start; - *p++ = (UV)rx->offs[i].end; + *p++ = PTR2UV(RX_SUBBEG(rx)); + *p++ = (UV)RX_SUBLEN(rx); + for (i = 0; i <= RX_NPARENS(rx); ++i) { + *p++ = (UV)RX_OFFS(rx)[i].start; + *p++ = (UV)RX_OFFS(rx)[i].end; } } @@ -362,13 +362,13 @@ Perl_rxres_restore(pTHX_ void **rsp, REGEXP *rx) *p++ = 0; #endif - rx->nparens = *p++; + RX_NPARENS(rx) = *p++; - rx->subbeg = INT2PTR(char*,*p++); - rx->sublen = (I32)(*p++); - for (i = 0; i <= rx->nparens; ++i) { - rx->offs[i].start = (I32)(*p++); - rx->offs[i].end = (I32)(*p++); + RX_SUBBEG(rx) = INT2PTR(char*,*p++); + RX_SUBLEN(rx) = (I32)(*p++); + for (i = 0; i <= RX_NPARENS(rx); ++i) { + RX_OFFS(rx)[i].start = (I32)(*p++); + RX_OFFS(rx)[i].end = (I32)(*p++); } } |