From: Nicholas Clark Date: Thu, 22 Sep 2005 14:35:52 +0000 (+0000) Subject: As SvPVX_mutable and SvPVX_const are new, they don't need to be LVALUEs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2134e298decea1cc32a8c5a0f08ef824144a9e5a;p=p5sagit%2Fp5-mst-13.2.git As SvPVX_mutable and SvPVX_const are new, they don't need to be LVALUEs p4raw-id: //depot/perl@25571 --- diff --git a/sv.h b/sv.h index 376e191..77731c4 100644 --- a/sv.h +++ b/sv.h @@ -858,8 +858,6 @@ in gv.h: */ # else # define SvPVX(sv) SvPVX_mutable(sv) # endif -# define SvPVX_mutable(sv) (0 + (sv)->sv_u.svu_pv) -# define SvPVX_const(sv) ((const char*)(0 + (sv)->sv_u.svu_pv)) # define SvCUR(sv) (0 + ((XPV*) SvANY(sv))->xpv_cur) # define SvLEN(sv) (0 + ((XPV*) SvANY(sv))->xpv_len) # define SvEND(sv) ((sv)->sv_u.svu_pv + ((XPV*)SvANY(sv))->xpv_cur) @@ -885,12 +883,15 @@ in gv.h: */ # define SvUVX(sv) ((XPVUV*) SvANY(sv))->xuv_uv # define SvNVX(sv) ((XPVNV*) SvANY(sv))->xnv_nv # define SvPVX(sv) ((sv)->sv_u.svu_pv) -# define SvPVX_mutable(sv) SvPVX(sv) -# define SvPVX_const(sv) ((const char*)SvPVX(sv)) # define SvCUR(sv) ((XPV*) SvANY(sv))->xpv_cur # define SvLEN(sv) ((XPV*) SvANY(sv))->xpv_len # define SvEND(sv) ((sv)->sv_u.svu_pv + ((XPV*)SvANY(sv))->xpv_cur) +/* Given that these two are new, there can't be any existing code using them + * as LVALUEs */ +#define SvPVX_mutable(sv) (0 + (sv)->sv_u.svu_pv) +#define SvPVX_const(sv) ((const char*)(0 + (sv)->sv_u.svu_pv)) + # ifdef DEBUGGING # define SvMAGIC(sv) (*(assert(SvTYPE(sv) >= SVt_PVMG), &((XPVMG*) SvANY(sv))->xmg_magic)) # define SvSTASH(sv) (*(assert(SvTYPE(sv) >= SVt_PVMG), &((XPVMG*) SvANY(sv))->xmg_stash))