summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-12-08 22:56:54 +0000
committerNicholas Clark <nick@ccl4.org>2006-12-08 22:56:54 +0000
commit55c1d76f9af684ffb624841d197d3ddfdb081f8e (patch)
tree0b6ca3a66927e8f3fbea1b4c275f5f0d1f8b2583 /sv.h
parentd372c83436cd3dfedd4d4b8b3f2affc2c1133af3 (diff)
downloadperl-55c1d76f9af684ffb624841d197d3ddfdb081f8e.tar.gz
Wrap some macro arguments in () to avoid precedence problems.
p4raw-id: //depot/perl@29490
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/sv.h b/sv.h
index 4d3e488074..4ec96e8efc 100644
--- a/sv.h
+++ b/sv.h
@@ -1132,7 +1132,7 @@ the scalar's value cannot change unless written to.
# if defined (DEBUGGING) && defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
/* These get expanded inside other macros that already use a variable _sv */
# define SvPVX(sv) \
- (*({ SV *const _svi = (SV *) sv; \
+ (*({ SV *const _svi = (SV *) (sv); \
assert(SvTYPE(_svi) >= SVt_PV); \
assert(SvTYPE(_svi) != SVt_PVAV); \
assert(SvTYPE(_svi) != SVt_PVHV); \
@@ -1140,7 +1140,7 @@ the scalar's value cannot change unless written to.
&((_svi)->sv_u.svu_pv); \
}))
# define SvCUR(sv) \
- (*({ SV *const _svi = (SV *) sv; \
+ (*({ SV *const _svi = (SV *) (sv); \
assert(SvTYPE(_svi) >= SVt_PV); \
assert(SvTYPE(_svi) != SVt_PVAV); \
assert(SvTYPE(_svi) != SVt_PVHV); \
@@ -1148,7 +1148,7 @@ the scalar's value cannot change unless written to.
&(((XPV*) SvANY(_svi))->xpv_cur); \
}))
# define SvIVX(sv) \
- (*({ SV *const _svi = (SV *) sv; \
+ (*({ SV *const _svi = (SV *) (sv); \
assert(SvTYPE(_svi) == SVt_IV || SvTYPE(_svi) >= SVt_PVIV); \
assert(SvTYPE(_svi) != SVt_PVAV); \
assert(SvTYPE(_svi) != SVt_PVHV); \
@@ -1157,7 +1157,7 @@ the scalar's value cannot change unless written to.
&(((XPVIV*) SvANY(_svi))->xiv_iv); \
}))
# define SvUVX(sv) \
- (*({ SV *const _svi = (SV *) sv; \
+ (*({ SV *const _svi = (SV *) (sv); \
assert(SvTYPE(_svi) == SVt_IV || SvTYPE(_svi) >= SVt_PVIV); \
assert(SvTYPE(_svi) != SVt_PVAV); \
assert(SvTYPE(_svi) != SVt_PVHV); \
@@ -1166,7 +1166,7 @@ the scalar's value cannot change unless written to.
&(((XPVUV*) SvANY(_svi))->xuv_uv); \
}))
# define SvNVX(sv) \
- (*({ SV *const _svi = (SV *) sv; \
+ (*({ SV *const _svi = (SV *) (sv); \
assert(SvTYPE(_svi) == SVt_NV || SvTYPE(_svi) >= SVt_PVNV); \
assert(SvTYPE(_svi) != SVt_PVAV); \
assert(SvTYPE(_svi) != SVt_PVHV); \
@@ -1176,14 +1176,14 @@ the scalar's value cannot change unless written to.
&(((XPVNV*) SvANY(_svi))->xnv_u.xnv_nv); \
}))
# define SvMAGIC(sv) \
- (*({ SV *const _svi = (SV *) sv; \
+ (*({ SV *const _svi = (SV *) (sv); \
assert(SvTYPE(_svi) >= SVt_PVMG); \
if(SvTYPE(_svi) == SVt_PVMG) \
assert(!SvPAD_OUR(_svi)); \
&(((XPVMG*) SvANY(_svi))->xmg_u.xmg_magic); \
}))
# define SvSTASH(sv) \
- (*({ SV *const _svi = (SV *) sv; \
+ (*({ SV *const _svi = (SV *) (sv); \
assert(SvTYPE(_svi) >= SVt_PVMG); \
&(((XPVMG*) SvANY(_svi))->xmg_stash); \
}))