From: Andy Lester Date: Thu, 16 Jun 2005 09:35:21 +0000 (-0500) Subject: Lint support X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ad73156c09397f3cfc63484d3edc50554da0fe15;p=p5sagit%2Fp5-mst-13.2.git Lint support Message-ID: <20050616143521.GB22188@petdance.com> p4raw-id: //depot/perl@24873 --- diff --git a/XSUB.h b/XSUB.h index 52f66a6..bec91a8 100644 --- a/XSUB.h +++ b/XSUB.h @@ -82,6 +82,15 @@ is a lexical $_ in scope. =cut */ +#ifndef LINT_UNUSED_ARG +# ifdef lint +# include +# define LINT_UNUSED_ARG(x) NOTE(ARGUNUSED(x)) +# else +# define LINT_UNUSED_ARG(x) +# endif +#endif + #define ST(off) PL_stack_base[ax + (off)] #undef XS @@ -107,7 +116,8 @@ is a lexical $_ in scope. #define dITEMS I32 items = SP - MARK -#define dXSARGS \ +#define dXSARGS \ + LINT_UNUSED_ARG(cv) \ dSP; dAXMARK; dITEMS #define dXSTARG SV * const targ = ((PL_op->op_private & OPpENTERSUB_HASTARG) \ @@ -601,3 +611,13 @@ Rethrows a previously caught exception. See L. #endif /* PERL_IMPLICIT_SYS && !PERL_CORE */ #endif /* _INC_PERL_XSUB_H */ /* include guard */ + +/* + * Local variables: + * c-indentation-style: bsd + * c-basic-offset: 4 + * indent-tabs-mode: t + * End: + * + * ex: set ts=8 sts=4 sw=4 noet: + */ diff --git a/perl.h b/perl.h index 5eff7de..c85543d 100644 --- a/perl.h +++ b/perl.h @@ -212,6 +212,15 @@ */ #define PERL_UNUSED_VAR(var) ((void)var) +#ifndef LINT_UNUSED_ARG +# ifdef lint +# include +# define LINT_UNUSED_ARG(x) NOTE(ARGUNUSED(x)) +# else +# define LINT_UNUSED_ARG(x) +# endif +#endif + #define NOOP (void)0 #define dNOOP extern int Perl___notused PERL_UNUSED_DECL diff --git a/universal.c b/universal.c index 1564b59..99a3dd9 100644 --- a/universal.c +++ b/universal.c @@ -819,6 +819,7 @@ XS(XS_Internals_hv_clear_placehold) XS(XS_Regexp_DESTROY) { + LINT_UNUSED_ARG(cv) } XS(XS_PerlIO_get_layers) @@ -951,7 +952,8 @@ XS(XS_Internals_hash_seed) /* Using dXSARGS would also have dITEM and dSP, * which define 2 unused local variables. */ dAXMARK; - (void)mark; + LINT_UNUSED_ARG(cv) + PERL_UNUSED_VAR(mark); XSRETURN_UV(PERL_HASH_SEED); } @@ -960,7 +962,8 @@ XS(XS_Internals_rehash_seed) /* Using dXSARGS would also have dITEM and dSP, * which define 2 unused local variables. */ dAXMARK; - (void)mark; + LINT_UNUSED_ARG(cv) + PERL_UNUSED_VAR(mark); XSRETURN_UV(PL_rehash_seed); }