X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xsutils.c;h=518e54369b3a8d054f2540d2bce88509a2a047d6;hb=3246d7a3ad86dfa806dd7e514ae5fd2dacd5c0ef;hp=490988bc243e4881e09a1adf1338786550f3a87b;hpb=4373e329bbd25cac77cfe128757db8cbb63c47bb;p=p5sagit%2Fp5-mst-13.2.git diff --git a/xsutils.c b/xsutils.c index 490988b..518e543 100644 --- a/xsutils.c +++ b/xsutils.c @@ -61,7 +61,7 @@ modify_SV_attributes(pTHX_ SV *sv, SV **retlist, SV **attrlist, int numattrs) for (nret = 0 ; numattrs && (attr = *attrlist++); numattrs--) { STRLEN len; - const char *name = SvPV(attr, len); + const char *name = SvPV_const(attr, len); const bool negated = (*name == '-'); if (negated) { @@ -132,10 +132,11 @@ modify_SV_attributes(pTHX_ SV *sv, SV **retlist, SV **attrlist, int numattrs) case 'e': if (memEQ(name, "uniqu", 5)) { if (SvTYPE(sv) == SVt_PVGV) { - if (negated) + if (negated) { GvUNIQUE_off(sv); - else + } else { GvUNIQUE_on(sv); + } } /* Hope this came from toke.c if not a GV. */ continue; @@ -258,13 +259,13 @@ usage: sv = SvRV(rv); if (SvOBJECT(sv)) - sv_setpv(TARG, HvNAME(SvSTASH(sv))); + sv_setpvn(TARG, HvNAME_get(SvSTASH(sv)), HvNAMELEN_get(SvSTASH(sv))); #if 0 /* this was probably a bad idea */ else if (SvPADMY(sv)) sv_setsv(TARG, &PL_sv_no); /* unblessed lexical */ #endif else { - const HV *stash = Nullhv; + const HV *stash = NULL; switch (SvTYPE(sv)) { case SVt_PVCV: if (CvGV(sv) && isGV(CvGV(sv)) && GvSTASH(CvGV(sv))) @@ -284,7 +285,7 @@ usage: break; } if (stash) - sv_setpv(TARG, HvNAME(stash)); + sv_setpvn(TARG, HvNAME_get(stash), HvNAMELEN_get(stash)); } SvSETMAGIC(TARG); @@ -305,8 +306,7 @@ usage: rv = ST(0); ST(0) = TARG; - if (SvGMAGICAL(rv)) - mg_get(rv); + SvGETMAGIC(rv); if (!(SvOK(rv) && SvROK(rv))) goto usage; sv = SvRV(rv); @@ -331,3 +331,12 @@ XS(XS_attributes__warn_reserved) XSRETURN(1); } +/* + * Local variables: + * c-indentation-style: bsd + * c-basic-offset: 4 + * indent-tabs-mode: t + * End: + * + * ex: set ts=8 sts=4 sw=4 noet: + */