summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-09-22 14:35:52 +0000
committerNicholas Clark <nick@ccl4.org>2005-09-22 14:35:52 +0000
commit2134e298decea1cc32a8c5a0f08ef824144a9e5a (patch)
tree2db34c5970d0e0e7668c399675862307dfe47656 /sv.h
parenta6f6820f3c7eaca644bb35f910322669c1493ccd (diff)
downloadperl-2134e298decea1cc32a8c5a0f08ef824144a9e5a.tar.gz
As SvPVX_mutable and SvPVX_const are new, they don't need to be LVALUEs
p4raw-id: //depot/perl@25571
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/sv.h b/sv.h
index 376e191a51..77731c4793 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))