summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian M. Enache <enache@rdslink.ro>2003-12-22 23:19:25 +0000
committerEnache Adrian <enache@rdslink.ro>2003-12-22 23:19:25 +0000
commit3de3296fe030c736fdb0cd3fba952c479e6bf141 (patch)
tree522bdb507c0eec50daa3f2c91e646171091a12e3
parent2666606c37c09f62a1f69e2cae2faf375d42fc41 (diff)
downloadperl-3de3296fe030c736fdb0cd3fba952c479e6bf141.tar.gz
sanitize some macros - based on Chip Salzenberg suggestions and
on the way GNU people use the gcc-ish 'blocks in parens' p4raw-id: //depot/perl@21950
-rw-r--r--XSUB.h14
-rw-r--r--sv.h34
2 files changed, 24 insertions, 24 deletions
diff --git a/XSUB.h b/XSUB.h
index 4a1079f9ba..af42f9cf9a 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -213,23 +213,23 @@ C<xsubpp>. See L<perlxs/"The VERSIONCHECK: Keyword">.
#ifdef XS_VERSION
# define XS_VERSION_BOOTCHECK \
STMT_START { \
- SV *tmpsv; STRLEN n_a; \
+ SV *_sv; STRLEN n_a; \
char *vn = Nullch, *module = SvPV(ST(0),n_a); \
if (items >= 2) /* version supplied as bootstrap arg */ \
- tmpsv = ST(1); \
+ _sv = ST(1); \
else { \
/* XXX GV_ADDWARN */ \
- tmpsv = get_sv(Perl_form(aTHX_ "%s::%s", module, \
+ _sv = get_sv(Perl_form(aTHX_ "%s::%s", module, \
vn = "XS_VERSION"), FALSE); \
- if (!tmpsv || !SvOK(tmpsv)) \
- tmpsv = get_sv(Perl_form(aTHX_ "%s::%s", module, \
+ if (!_sv || !SvOK(_sv)) \
+ _sv = get_sv(Perl_form(aTHX_ "%s::%s", module, \
vn = "VERSION"), FALSE); \
} \
- if (tmpsv && (!SvOK(tmpsv) || strNE(XS_VERSION, SvPV(tmpsv, n_a)))) \
+ if (_sv && (!SvOK(_sv) || strNE(XS_VERSION, SvPV(_sv, n_a)))) \
Perl_croak(aTHX_ "%s object version %s does not match %s%s%s%s %"SVf,\
module, XS_VERSION, \
vn ? "$" : "", vn ? module : "", vn ? "::" : "", \
- vn ? vn : "bootstrap parameter", tmpsv); \
+ vn ? vn : "bootstrap parameter", _sv); \
} STMT_END
#else
# define XS_VERSION_BOOTCHECK
diff --git a/sv.h b/sv.h
index a9a57dfdda..b31cb14851 100644
--- a/sv.h
+++ b/sv.h
@@ -129,10 +129,10 @@ perform the upgrade if necessary. See C<svtype>.
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && !defined(PERL_GCC_PEDANTIC)
# define SvREFCNT_inc(sv) \
({ \
- SV *nsv = (SV*)(sv); \
- if (nsv) \
- (SvREFCNT(nsv))++; \
- nsv; \
+ SV *_sv = (SV*)(sv); \
+ if (_sv) \
+ (SvREFCNT(_sv))++; \
+ _sv; \
})
#else
# define SvREFCNT_inc(sv) \
@@ -142,13 +142,13 @@ perform the upgrade if necessary. See C<svtype>.
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && !defined(PERL_GCC_PEDANTIC)
# define SvREFCNT_dec(sv) \
({ \
- SV *nsv = (SV*)(sv); \
- if (nsv) { \
- if (SvREFCNT(nsv)) { \
- if (--(SvREFCNT(nsv)) == 0) \
- Perl_sv_free2(aTHX_ nsv); \
+ SV *_sv = (SV*)(sv); \
+ if (_sv) { \
+ if (SvREFCNT(_sv)) { \
+ if (--(SvREFCNT(_sv)) == 0) \
+ Perl_sv_free2(aTHX_ _sv); \
} else { \
- sv_free(nsv); \
+ sv_free(_sv); \
} \
} \
})
@@ -1006,12 +1006,12 @@ scalar.
#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
-# define SvIVx(sv) ({SV *nsv = (SV*)(sv); SvIV(nsv); })
-# define SvUVx(sv) ({SV *nsv = (SV*)(sv); SvUV(nsv); })
-# define SvNVx(sv) ({SV *nsv = (SV*)(sv); SvNV(nsv); })
-# define SvPVx(sv, lp) ({SV *nsv = (sv); SvPV(nsv, lp); })
-# define SvPVutf8x(sv, lp) ({SV *nsv = (sv); SvPVutf8(nsv, lp); })
-# define SvPVbytex(sv, lp) ({SV *nsv = (sv); SvPVbyte(nsv, lp); })
+# define SvIVx(sv) ({SV *_sv = (SV*)(sv); SvIV(_sv); })
+# define SvUVx(sv) ({SV *_sv = (SV*)(sv); SvUV(_sv); })
+# define SvNVx(sv) ({SV *_sv = (SV*)(sv); SvNV(_sv); })
+# define SvPVx(sv, lp) ({SV *_sv = (sv); SvPV(_sv, lp); })
+# define SvPVutf8x(sv, lp) ({SV *_sv = (sv); SvPVutf8(_sv, lp); })
+# define SvPVbytex(sv, lp) ({SV *_sv = (sv); SvPVbyte(_sv, lp); })
# define SvTRUE(sv) ( \
!sv \
? 0 \
@@ -1028,7 +1028,7 @@ scalar.
: SvNOK(sv) \
? SvNVX(sv) != 0.0 \
: sv_2bool(sv) )
-# define SvTRUEx(sv) ({SV *nsv = (sv); SvTRUE(nsv); })
+# define SvTRUEx(sv) ({SV *_sv = (sv); SvTRUE(_sv); })
#else /* __GNUC__ */