From: Jim Meyering Date: Mon, 1 Feb 2010 18:05:26 +0000 (+0100) Subject: removing useless parentheses in cpp #define directives X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c9191b333f31bf193a4417597015864c7258d04;p=pspp removing useless parentheses in cpp #define directives For motivation, see commit c0221df4, "define STREQ(a,b) consistently, removing useless parentheses" * lib/memcmp.c (CMP_LT_OR_GT): Remove useless parentheses. * lib/mountlist.c (MNT_IGNORE): Likewise. * lib/trim.h (trim, trim_trailing, trim_leading): Likewise. --- diff --git a/ChangeLog b/ChangeLog index b89d1273e7..97402e3094 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-02-01 Jim Meyering + + removing useless parentheses in cpp #define directives + For motivation, see commit c0221df4, "define STREQ(a,b) + consistently, removing useless parentheses" + * lib/memcmp.c (CMP_LT_OR_GT): Remove useless parentheses. + * lib/mountlist.c (MNT_IGNORE): Likewise. + * lib/trim.h (trim, trim_trailing, trim_leading): Likewise. + 2010-02-01 Eric Blake sys_time: use link-warning diff --git a/lib/memcmp.c b/lib/memcmp.c index 847867ab93..0c7ce5e806 100644 --- a/lib/memcmp.c +++ b/lib/memcmp.c @@ -65,7 +65,7 @@ typedef unsigned char byte; #ifdef WORDS_BIGENDIAN # define CMP_LT_OR_GT(a, b) ((a) > (b) ? 1 : -1) #else -# define CMP_LT_OR_GT(a, b) memcmp_bytes ((a), (b)) +# define CMP_LT_OR_GT(a, b) memcmp_bytes (a, b) #endif /* BE VERY CAREFUL IF YOU CHANGE THIS CODE! */ diff --git a/lib/mountlist.c b/lib/mountlist.c index ccb08dde6c..996b71a1f9 100644 --- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -125,7 +125,7 @@ #undef MNT_IGNORE #if defined MNTOPT_IGNORE && defined HAVE_HASMNTOPT -# define MNT_IGNORE(M) hasmntopt ((M), MNTOPT_IGNORE) +# define MNT_IGNORE(M) hasmntopt (M, MNTOPT_IGNORE) #else # define MNT_IGNORE(M) 0 #endif diff --git a/lib/trim.h b/lib/trim.h index 61880c1f60..c70a16fba8 100644 --- a/lib/trim.h +++ b/lib/trim.h @@ -22,13 +22,12 @@ #define TRIM_BOTH 2 /* Removes trailing and leading whitespaces. */ -#define trim(s) trim2((s), TRIM_BOTH) +#define trim(s) trim2(s, TRIM_BOTH) /* Removes trailing whitespaces. */ -#define trim_trailing(s) trim2((s), TRIM_TRAILING) +#define trim_trailing(s) trim2(s, TRIM_TRAILING) /* Removes leading whitespaces. */ -#define trim_leading(s) trim2((s), TRIM_LEADING) +#define trim_leading(s) trim2(s, TRIM_LEADING) char *trim2(const char *, int); -