typedef struct hv HV;
typedef struct cv CV;
typedef struct regexp ORANGE; /* This is the body structure. */
-typedef SV REGEXP;
+typedef struct p5rx REGEXP;
typedef struct gp GP;
typedef struct gv GV;
typedef struct io IO;
if (SvROK(tmpstr)) {
SV * const sv = SvRV(tmpstr);
if (SvTYPE(sv) == SVt_REGEXP)
- re = sv;
+ re = (REGEXP*) sv;
}
if (re) {
re = reg_temp_copy(re);
# define SM_REGEX ( \
(SvROK(d) && (SvTYPE(This = SvRV(d)) == SVt_REGEXP) \
- && (this_regex = This) \
+ && (this_regex = (REGEXP*) This) \
&& (Other = e)) \
|| \
(SvROK(e) && (SvTYPE(This = SvRV(e)) == SVt_REGEXP) \
- && (this_regex = This) \
+ && (this_regex = (REGEXP*) This) \
&& (Other = d)) )
# define SM_OTHER_REGEX (SvROK(Other) \
&& (SvTYPE(SvRV(Other)) == SVt_REGEXP) \
- && (other_regex = SvRV(Other)))
+ && (other_regex = (REGEXP*) SvRV(Other)))
# define SM_SEEN_THIS(sv) hv_exists_ent(seen_this, \
/* This RV is about to own a reference to the regexp. (In addition to the
reference already owned by the PMOP. */
ReREFCNT_inc(rx);
- SvRV_set(rv, rx);
+ SvRV_set(rv, (SV*) rx);
SvROK_on(rv);
if (pkg) {
/* Allocate space and zero-initialize. Note, the two step process
of zeroing when in debug mode, thus anything assigned has to
happen after that */
- rx = newSV_type(SVt_REGEXP);
+ rx = (REGEXP*) newSV_type(SVt_REGEXP);
r = (struct regexp*)SvANY(rx);
Newxc(ri, sizeof(regexp_internal) + (unsigned)RExC_size * sizeof(regnode),
char, regexp_internal);
+ (sizeof(STD_PAT_MODS) - 1)
+ (sizeof("(?:)") - 1);
- p = sv_grow(rx, wraplen + 1);
+ p = sv_grow((SV *)rx, wraplen + 1);
SvCUR_set(rx, wraplen);
SvPOK_on(rx);
SvFLAGS(rx) |= SvUTF8(pattern);
REGEXP *
Perl_reg_temp_copy (pTHX_ REGEXP *rx) {
- REGEXP *ret_x = newSV_type(SVt_REGEXP);
+ REGEXP *ret_x = (REGEXP*) newSV_type(SVt_REGEXP);
struct regexp *ret = (struct regexp *)SvANY(ret_x);
struct regexp *const r = (struct regexp *)SvANY(rx);
register const I32 npar = r->nparens+1;
#define ST st->u.eval
{
SV *ret;
- SV *re_sv;
+ REGEXP *re_sv;
regexp *re;
regexp_internal *rei;
regnode *startpoint;
SV *const sv = SvRV(ret);
if (SvTYPE(sv) == SVt_REGEXP) {
- rx = sv;
+ rx = (REGEXP*) sv;
} else if (SvSMAGICAL(sv)) {
mg = mg_find(sv, PERL_MAGIC_qr);
assert(mg);
}
} else if (SvTYPE(ret) == SVt_REGEXP) {
- rx = ret;
+ rx = (REGEXP*) ret;
} else if (SvSMAGICAL(ret)) {
if (SvGMAGICAL(ret)) {
/* I don't believe that there is ever qr magic
}
if (mg) {
- rx = mg->mg_obj; /*XXX:dmq*/
+ rx = (REGEXP *) mg->mg_obj; /*XXX:dmq*/
assert(rx);
}
if (rx) {
/* This isn't a first class regexp. Instead, it's
caching a regexp onto an existing, Perl visible
scalar. */
- sv_magic(ret, rx, PERL_MAGIC_qr, 0, 0);
+ sv_magic(ret, (SV*) rx, PERL_MAGIC_qr, 0, 0);
}
PL_regsize = osize;
}
goto freescalar;
case SVt_REGEXP:
/* FIXME for plugins */
- pregfree2(sv);
+ pregfree2((REGEXP*) sv);
goto freescalar;
case SVt_PVCV:
case SVt_PVFM:
break;
case SVt_REGEXP:
/* FIXME for plugins */
- re_dup_guts(sstr, dstr, param);
+ re_dup_guts((REGEXP*) sstr, (REGEXP*) dstr, param);
break;
case SVt_PVLV:
/* XXX LvTARGOFF sometimes holds PMOP* when DEBUGGING */
pointer inside an IV hack? */
SV * const sv =
SvREPADTMP(regex)
- ? sv_dup_inc(regex, param)
+ ? sv_dup_inc((SV*) regex, param)
: SvREFCNT_inc(
- newSViv(PTR2IV(sv_dup_inc(INT2PTR(REGEXP *, SvIVX(regex)), param))))
+ newSViv(PTR2IV(sv_dup_inc(INT2PTR(SV *, SvIVX(regex)), param))))
;
if (SvFLAGS(regex) & SVf_BREAK)
SvFLAGS(sv) |= SVf_BREAK; /* unrefcnted PL_curpm */
_SV_HEAD_UNION;
};
+struct p5rx {
+ _SV_HEAD(struct regexp*); /* pointer to regexp body */
+ _SV_HEAD_UNION;
+};
+
#undef _SV_HEAD
#undef _SV_HEAD_UNION /* ensure no pollution */
(tmpsv = (SV*)SvRV(sv)) && /* assign deliberate */
SvTYPE(tmpsv) == SVt_REGEXP)
{
- return tmpsv;
+ return (REGEXP*) tmpsv;
}
}