From 35335a0a3c4bd5c973962212601eb60fc1964698 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 7 Oct 2009 14:49:38 -0600 Subject: [PATCH] maint: minor cleanups * lib/fts.c (ATTRIBUTE_UNUSED): Delete; use gnulib-guaranteed _ATTRIBUTE_UNUSED instead. * lib/getdate.y (ATTRIBUTE_UNUSED): Likewise. * lib/utimens.c (ATTRIBUTE_UNUSED): Likewise. * modules/linkat-tests (Files): Distribute test-link.h. Signed-off-by: Eric Blake --- ChangeLog | 7 +++++++ lib/fts.c | 16 +++------------- lib/getdate.y | 14 ++------------ lib/utimens.c | 12 +----------- modules/linkat-tests | 1 + 5 files changed, 14 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8fc68cf2..d7ba020e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2009-10-07 Eric Blake + maint: minor cleanups + * lib/fts.c (ATTRIBUTE_UNUSED): Delete; use gnulib-guaranteed + _UNUSED_PARAMETER_ instead. + * lib/getdate.y (ATTRIBUTE_UNUSED): Likewise. + * lib/utimens.c (ATTRIBUTE_UNUSED): Likewise. + * modules/linkat-tests (Files): Distribute test-link.h. + openat, utimens: whitespace cleanup * lib/openat.c: Prefer space throughout, rather than mix of 8 spaces vs. tabs. diff --git a/lib/fts.c b/lib/fts.c index 041f9f070..40a837ed8 100644 --- a/lib/fts.c +++ b/lib/fts.c @@ -173,16 +173,6 @@ enum Fts_stat # define __set_errno(Val) errno = (Val) #endif -#ifndef __attribute__ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) -# define __attribute__(x) /* empty */ -# endif -#endif - -#ifndef ATTRIBUTE_UNUSED -# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) -#endif - /* If this host provides the openat function, then we can avoid attempting to open "." in some initialization code below. */ #ifdef HAVE_OPENAT @@ -727,9 +717,9 @@ leaf_optimization_applies (int dir_fd) #else static bool -dirent_inode_sort_may_be_useful (int dir_fd ATTRIBUTE_UNUSED) { return true; } +dirent_inode_sort_may_be_useful (int dir_fd _UNUSED_PARAMETER_) { return true; } static bool -leaf_optimization_applies (int dir_fd ATTRIBUTE_UNUSED) { return false; } +leaf_optimization_applies (int dir_fd _UNUSED_PARAMETER_) { return false; } #endif #if GNULIB_FTS @@ -1079,7 +1069,7 @@ check_for_dir: */ /* ARGSUSED */ int -fts_set(FTS *sp ATTRIBUTE_UNUSED, FTSENT *p, int instr) +fts_set(FTS *sp _UNUSED_PARAMETER_, FTSENT *p, int instr) { if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW && instr != FTS_NOINSTR && instr != FTS_SKIP) { diff --git a/lib/getdate.y b/lib/getdate.y index f02271081..94160b266 100644 --- a/lib/getdate.y +++ b/lib/getdate.y @@ -78,16 +78,6 @@ of `digit' even when the host does not conform to POSIX. */ #define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9) -#ifndef __attribute__ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ -# define __attribute__(x) -# endif -#endif - -#ifndef ATTRIBUTE_UNUSED -# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) -#endif - /* Shift A right by B bits portably, by dividing A by 2**B and truncating towards minus infinity. A and B should be free of side effects, and B should be in the range 0 <= B <= INT_BITS - 2, where @@ -1155,8 +1145,8 @@ yylex (YYSTYPE *lvalp, parser_control *pc) /* Do nothing if the parser reports an error. */ static int -yyerror (parser_control const *pc ATTRIBUTE_UNUSED, - char const *s ATTRIBUTE_UNUSED) +yyerror (parser_control const *pc _UNUSED_PARAMETER_, + char const *s _UNUSED_PARAMETER_) { return 0; } diff --git a/lib/utimens.c b/lib/utimens.c index 86c1c5a22..10d2c8246 100644 --- a/lib/utimens.c +++ b/lib/utimens.c @@ -44,16 +44,6 @@ struct utimbuf }; #endif -#ifndef __attribute__ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) -# define __attribute__(x) -# endif -#endif - -#ifndef ATTRIBUTE_UNUSED -# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) -#endif - /* Set the access and modification time stamps of FD (a.k.a. FILE) to be TIMESPEC[0] and TIMESPEC[1], respectively. FD must be either negative -- in which case it is ignored -- @@ -65,7 +55,7 @@ struct utimbuf Return 0 on success, -1 (setting errno) on failure. */ int -gl_futimens (int fd ATTRIBUTE_UNUSED, +gl_futimens (int fd _UNUSED_PARAMETER_, char const *file, struct timespec const timespec[2]) { /* Some Linux-based NFS clients are buggy, and mishandle time stamps diff --git a/modules/linkat-tests b/modules/linkat-tests index 9fb650520..1f9aafae2 100644 --- a/modules/linkat-tests +++ b/modules/linkat-tests @@ -1,4 +1,5 @@ Files: +tests/test-link.h tests/test-linkat.c Depends-on: -- 2.11.0