summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
authorMarcus Holland-Moritz <mhx-perl@gmx.net>2008-01-04 01:06:10 +0000
committerMarcus Holland-Moritz <mhx-perl@gmx.net>2008-01-04 01:06:10 +0000
commit6e449a3ab1e3bd9d7e138ca681c733e57d4daa49 (patch)
treead260a44d03e2cd4466a3495bd249239dc834046 /universal.c
parentad25789c15269a04312e0efede81842547aa8212 (diff)
downloadperl-6e449a3ab1e3bd9d7e138ca681c733e57d4daa49.tar.gz
Add macros mPUSHs() and mXPUSHs() for pushing SVs on the stack
and mortalizing them. Use these macros where possible. And also mX?PUSH[inpu] where possible. p4raw-id: //depot/perl@32821
Diffstat (limited to 'universal.c')
-rw-r--r--universal.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/universal.c b/universal.c
index 50a76d6e8c..7d1bd559dd 100644
--- a/universal.c
+++ b/universal.c
@@ -158,7 +158,7 @@ Perl_sv_does(pTHX_ SV *sv, const char *name)
PUSHMARK(SP);
XPUSHs(sv);
- XPUSHs(sv_2mortal(newSVpv(name, 0)));
+ mXPUSHs(newSVpv(name, 0));
PUTBACK;
methodname = newSVpvs_flags("isa", SVs_TEMP);
@@ -487,7 +487,7 @@ XS(XS_version_new)
if ( strcmp(classname,"version") != 0 ) /* inherited new() */
sv_bless(rv, gv_stashpv(classname, GV_ADD));
- PUSHs(sv_2mortal(rv));
+ mPUSHs(rv);
PUTBACK;
return;
}
@@ -510,7 +510,7 @@ XS(XS_version_stringify)
else
Perl_croak(aTHX_ "lobj is not of type version");
- PUSHs(sv_2mortal(vstringify(lobj)));
+ mPUSHs(vstringify(lobj));
PUTBACK;
return;
@@ -534,7 +534,7 @@ XS(XS_version_numify)
else
Perl_croak(aTHX_ "lobj is not of type version");
- PUSHs(sv_2mortal(vnumify(lobj)));
+ mPUSHs(vnumify(lobj));
PUTBACK;
return;
@@ -558,7 +558,7 @@ XS(XS_version_normal)
else
Perl_croak(aTHX_ "lobj is not of type version");
- PUSHs(sv_2mortal(vnormal(lobj)));
+ mPUSHs(vnormal(lobj));
PUTBACK;
return;
@@ -603,7 +603,7 @@ XS(XS_version_vcmp)
rs = newSViv(vcmp(lobj,rvs));
}
- PUSHs(sv_2mortal(rs));
+ mPUSHs(rs);
}
PUTBACK;
@@ -622,7 +622,7 @@ XS(XS_version_boolean)
if (sv_derived_from(ST(0), "version")) {
SV * const lobj = SvRV(ST(0));
SV * const rs = newSViv( vcmp(lobj,new_version(newSVpvs("0"))) );
- PUSHs(sv_2mortal(rs));
+ mPUSHs(rs);
PUTBACK;
return;
}
@@ -685,7 +685,7 @@ XS(XS_version_qv)
}
else
{
- PUSHs(sv_2mortal(new_version(ver)));
+ mPUSHs(new_version(ver));
}
PUTBACK;
@@ -1418,8 +1418,8 @@ XS(XS_Tie_Hash_NamedCapture_flags)
if (items != 0)
Perl_croak(aTHX_ "Usage: Tie::Hash::NamedCapture::flags()");
- XPUSHs(sv_2mortal(newSVuv(RXapif_ONE)));
- XPUSHs(sv_2mortal(newSVuv(RXapif_ALL)));
+ mXPUSHu(RXapif_ONE);
+ mXPUSHu(RXapif_ALL);
PUTBACK;
return;
}