findutils-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Findutils-patches] [PATCH 2/5] maint: adjust preprocessor indentation v


From: Bernhard Voelker
Subject: [Findutils-patches] [PATCH 2/5] maint: adjust preprocessor indentation via cppi
Date: Tue, 18 Dec 2018 01:12:12 +0100

Run 'cppi -a' for all *.[ch] files, and add a syntax-check rule for it.

* cfg.mk (sc_preprocessor_indentation): Add rule.
* find/defs.h: Run 'cppi -a' on this file.
* find/fstype.c: Likewise.
* find/oldfind.c: Likewise.
* find/parser.c: Likewise.
* find/pred.c: Likewise.
* find/print.h: Likewise.
* find/sharefile.h: Likewise.
* gnulib-local/lib/gcc-function-attributes.h: Likewise.
* lib/bugreports.h: Likewise.
* lib/buildcmd.c: Likewise.
* lib/buildcmd.h: Likewise.
* lib/extendbuf.h: Likewise.
* lib/fdleak.h: Likewise.
* lib/findutils-version.h: Likewise.
* lib/listfile.c: Likewise.
* lib/printquoted.h: Likewise.
* lib/regextype.h: Likewise.
* lib/safe-atoi.h: Likewise.
* lib/splitstring.h: Likewise.
* lib/system.h: Likewise.
* locate/locatedb.h: Likewise.
* xargs/xargs.c: Likewise.
---
 cfg.mk                                     |  10 ++
 find/defs.h                                |  94 ++++++------
 find/fstype.c                              |  18 +--
 find/oldfind.c                             |  28 ++--
 find/parser.c                              |   4 +-
 find/pred.c                                |  36 ++---
 find/print.h                               |   4 +-
 find/sharefile.h                           |   6 +-
 gnulib-local/lib/gcc-function-attributes.h | 170 ++++++++++-----------
 lib/bugreports.h                           |   2 +-
 lib/buildcmd.c                             |   4 +-
 lib/buildcmd.h                             |   4 +-
 lib/extendbuf.h                            |   2 +-
 lib/fdleak.h                               |   2 +-
 lib/findutils-version.h                    |   2 +-
 lib/listfile.c                             |  16 +-
 lib/printquoted.h                          |   8 +-
 lib/regextype.h                            |   2 +-
 lib/safe-atoi.h                            |   4 +-
 lib/splitstring.h                          |   6 +-
 lib/system.h                               |  32 ++--
 locate/locatedb.h                          |  22 +--
 xargs/xargs.c                              |   6 +-
 23 files changed, 246 insertions(+), 236 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 89b27c52..1522f7ac 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -102,6 +102,16 @@ sc_die_EXIT_FAILURE:
               exit 1; }  \
          || :
 
+# Enforce recommended preprocessor indentation style.
+sc_preprocessor_indentation:
+       @if cppi --version >/dev/null 2>&1; then                        \
+         $(VC_LIST_EXCEPT) | grep '\.[ch]$$' | xargs cppi -a -c        \
+           || { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
+               exit 1; };                                              \
+       else                                                            \
+         echo '$(ME): skipping test $@: cppi not installed' 1>&2;      \
+       fi
+
 # During 'make update-copyright', convert a sequence with gaps to the minimal
 # containing range.
 update-copyright-env = \
diff --git a/find/defs.h b/find/defs.h
index f4ce0c59..1939ab30 100644
--- a/find/defs.h
+++ b/find/defs.h
@@ -17,9 +17,9 @@
 
 
 #ifndef INC_DEFS_H
-#define INC_DEFS_H 1
+# define INC_DEFS_H 1
 
-#if !defined ALREADY_INCLUDED_CONFIG_H
+# if !defined ALREADY_INCLUDED_CONFIG_H
 /*
  * Savannah bug #20128: if we include some system header and it
  * includes some other second system header, the second system header
@@ -29,40 +29,40 @@
  * configure script fragments.  So <config.h> should be the first
  * thing included.
  */
-#error "<config.h> should be #included before defs.h, and indeed before any 
other header"
+#  error "<config.h> should be #included before defs.h, and indeed before any 
other header"
 Please stop compiling the program now
-#endif
+# endif
 
 
-#include <sys/types.h>
+# include <sys/types.h>
 
 /* XXX: some of these includes probably don't belong in a common header file */
-#include <sys/stat.h>
-#include <stdio.h>             /* for FILE* */
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <time.h>
-#include <limits.h>            /* for CHAR_BIT */
-#include <stdbool.h>           /* for bool */
-#include <stdint.h>            /* for uintmax_t */
-#include <sys/stat.h> /* S_ISUID etc. */
-#include <selinux/selinux.h>
-
-
-
-#ifndef CHAR_BIT
-# define CHAR_BIT 8
-#endif
+# include <sys/stat.h>
+# include <stdio.h>            /* for FILE* */
+# include <string.h>
+# include <stdlib.h>
+# include <unistd.h>
+# include <time.h>
+# include <limits.h>           /* for CHAR_BIT */
+# include <stdbool.h>          /* for bool */
+# include <stdint.h>           /* for uintmax_t */
+# include <sys/stat.h> /* S_ISUID etc. */
+# include <selinux/selinux.h>
+
+
+
+# ifndef CHAR_BIT
+#  define CHAR_BIT 8
+# endif
 
 # include <inttypes.h>
 
-#include "regex.h"
-#include "timespec.h"
-#include "buildcmd.h"
-#include "quotearg.h"
-#include "sharefile.h"
-#include "gcc-function-attributes.h"
+# include "regex.h"
+# include "timespec.h"
+# include "buildcmd.h"
+# include "quotearg.h"
+# include "sharefile.h"
+# include "gcc-function-attributes.h"
 
 int optionl_stat (const char *name, struct stat *p);
 int optionp_stat (const char *name, struct stat *p);
@@ -73,11 +73,11 @@ void set_stat_placeholders (struct stat *p);
 int get_statinfo (const char *pathname, const char *name, struct stat *p);
 
 
-#define MODE_WXUSR     (S_IWUSR | S_IXUSR)
-#define MODE_R         (S_IRUSR | S_IRGRP | S_IROTH)
-#define MODE_RW                (S_IWUSR | S_IWGRP | S_IWOTH | MODE_R)
-#define MODE_RWX       (S_IXUSR | S_IXGRP | S_IXOTH | MODE_RW)
-#define MODE_ALL       (S_ISUID | S_ISGID | S_ISVTX | MODE_RWX)
+# define MODE_WXUSR    (S_IWUSR | S_IXUSR)
+# define MODE_R                (S_IRUSR | S_IRGRP | S_IROTH)
+# define MODE_RW               (S_IWUSR | S_IWGRP | S_IWOTH | MODE_R)
+# define MODE_RWX      (S_IXUSR | S_IXGRP | S_IXOTH | MODE_RW)
+# define MODE_ALL      (S_ISUID | S_ISGID | S_ISVTX | MODE_RWX)
 
 
 struct predicate;
@@ -87,7 +87,7 @@ struct options;
 typedef bool (*PRED_FUNC)(const char *pathname, struct stat *stat_buf, struct 
predicate *pred_ptr);
 
 /* The number of seconds in a day. */
-#define                DAYSECS     86400
+# define DAYSECS           86400
 
 /* Argument structures for predicates. */
 
@@ -169,18 +169,18 @@ enum file_type
     FTYPE_CHR,
     FTYPE_DIR,
     FTYPE_REG,
-#ifdef S_IFLNK
+# ifdef S_IFLNK
     FTYPE_LNK,
-#endif
-#ifdef S_IFIFO
+# endif
+# ifdef S_IFIFO
     FTYPE_FIFO,
-#endif
-#ifdef S_IFSOCK
+# endif
+# ifdef S_IFSOCK
     FTYPE_SOCK,
-#endif
-#ifdef S_IFDOOR
+# endif
+# ifdef S_IFDOOR
     FTYPE_DOOR,
-#endif
+# endif
     FTYPE_COUNT
   };
 
@@ -520,14 +520,14 @@ int process_leading_options (int argc, char *argv[]);
 void set_option_defaults (struct options *p);
 void error_severity (int level);
 
-#if 0
-#define apply_predicate(pathname, stat_buf_ptr, node)  \
+# if 0
+#  define apply_predicate(pathname, stat_buf_ptr, node)        \
   (*(node)->pred_func)((pathname), (stat_buf_ptr), (node))
-#else
+# else
 bool apply_predicate(const char *pathname, struct stat *stat_buf, struct 
predicate *p);
-#endif
+# endif
 
-#define pred_is(node, fn) ( ((node)->pred_func) == (fn) )
+# define pred_is(node, fn) ( ((node)->pred_func) == (fn) )
 
 
 /* oldfind.c. */
diff --git a/find/fstype.c b/find/fstype.c
index 578ea8ee..4fb6a321 100644
--- a/find/fstype.c
+++ b/find/fstype.c
@@ -78,17 +78,17 @@ free_file_system_list (struct mount_entry *p)
 
 
 #ifdef AFS
-#include <netinet/in.h>
-#include <afs/venus.h>
-#if __STDC__
+# include <netinet/in.h>
+# include <afs/venus.h>
+# if __STDC__
 /* On SunOS 4, afs/vice.h defines this to rely on a pre-ANSI cpp.  */
-#undef _VICEIOCTL
-#define _VICEIOCTL(id)  ((unsigned int ) _IOW('V', id, struct ViceIoctl))
-#endif
-#ifndef _IOW
+#  undef _VICEIOCTL
+#  define _VICEIOCTL(id)  ((unsigned int ) _IOW('V', id, struct ViceIoctl))
+# endif
+# ifndef _IOW
 /* AFS on Solaris 2.3 doesn't get this definition.  */
-#include <sys/ioccom.h>
-#endif
+#  include <sys/ioccom.h>
+# endif
 
 static int
 in_afs (char *path)
diff --git a/find/oldfind.c b/find/oldfind.c
index 4dcd9b25..666ebbe9 100644
--- a/find/oldfind.c
+++ b/find/oldfind.c
@@ -120,27 +120,27 @@ type_to_mode (unsigned type)
 {
   switch (type)
     {
-#ifdef DT_FIFO
+# ifdef DT_FIFO
     case DT_FIFO: return S_IFIFO;
-#endif
-#ifdef DT_CHR
+# endif
+# ifdef DT_CHR
     case DT_CHR:  return S_IFCHR;
-#endif
-#ifdef DT_DIR
+# endif
+# ifdef DT_DIR
     case DT_DIR:  return S_IFDIR;
-#endif
-#ifdef DT_BLK
+# endif
+# ifdef DT_BLK
     case DT_BLK:  return S_IFBLK;
-#endif
-#ifdef DT_REG
+# endif
+# ifdef DT_REG
     case DT_REG:  return S_IFREG;
-#endif
-#ifdef DT_LNK
+# endif
+# ifdef DT_LNK
     case DT_LNK:  return S_IFLNK;
-#endif
-#ifdef DT_SOCK
+# endif
+# ifdef DT_SOCK
     case DT_SOCK: return S_IFSOCK;
-#endif
+# endif
     default:
       return 0;                        /* Unknown. */
     }
diff --git a/find/parser.c b/find/parser.c
index d6621506..64d8931f 100644
--- a/find/parser.c
+++ b/find/parser.c
@@ -69,10 +69,10 @@
 
 
 #ifndef HAVE_ENDGRENT
-#define endgrent ()
+# define endgrent ()
 #endif
 #ifndef HAVE_ENDPWENT
-#define endpwent ()
+# define endpwent ()
 #endif
 
 static bool parse_accesscheck   (const struct parser_table*, char *argv[], int 
*arg_ptr);
diff --git a/find/pred.c b/find/pred.c
index 2014b5ab..55dc7e25 100644
--- a/find/pred.c
+++ b/find/pred.c
@@ -55,9 +55,9 @@
 
 #ifdef CLOSEDIR_VOID
 /* Fake a return value. */
-#define CLOSEDIR(d) (closedir (d), 0)
+# define CLOSEDIR(d) (closedir (d), 0)
 #else
-#define CLOSEDIR(d) closedir (d)
+# define CLOSEDIR(d) closedir (d)
 #endif
 
 static bool match_lname (const char *pathname, struct stat *stat_buf, struct 
predicate *pred_ptr, bool ignore_case);
@@ -1067,26 +1067,26 @@ pred_type (const char *pathname, struct stat *stat_buf, 
struct predicate *pred_p
      type = FTYPE_REG;
   else if (S_ISDIR (mode))
      type = FTYPE_DIR;
-#ifdef S_IFLNK
+# ifdef S_IFLNK
   else if (S_ISLNK (mode))
      type = FTYPE_LNK;
-#endif
+# endif
   else if (S_ISBLK (mode))
      type = FTYPE_BLK;
   else if (S_ISCHR (mode))
      type = FTYPE_CHR;
-#ifdef S_IFSOCK
+# ifdef S_IFSOCK
   else if (S_ISSOCK (mode))
      type = FTYPE_SOCK;
-#endif
-#ifdef S_IFIFO
+# endif
+# ifdef S_IFIFO
   else if (S_ISFIFO (mode))
      type = FTYPE_FIFO;
-#endif
-#ifdef S_IFDOOR
+# endif
+# ifdef S_IFDOOR
   else if (S_ISDOOR (mode))
     type = FTYPE_DOOR;
-#endif
+# endif
 #else /* S_IFMT */
   /* Unix system; check `mode' the fast way. */
   switch (mode & S_IFMT)
@@ -1097,32 +1097,32 @@ pred_type (const char *pathname, struct stat *stat_buf, 
struct predicate *pred_p
     case S_IFDIR:
       type = FTYPE_DIR;
       break;
-#ifdef S_IFLNK
+# ifdef S_IFLNK
     case S_IFLNK:
       type = FTYPE_LNK;
       break;
-#endif
+# endif
     case S_IFBLK:
       type = FTYPE_BLK;
       break;
     case S_IFCHR:
       type = FTYPE_CHR;
       break;
-#ifdef S_IFSOCK
+# ifdef S_IFSOCK
     case S_IFSOCK:
       type = FTYPE_SOCK;
       break;
-#endif
-#ifdef S_IFIFO
+# endif
+# ifdef S_IFIFO
     case S_IFIFO:
       type = FTYPE_FIFO;
       break;
-#endif
-#ifdef S_IFDOOR
+# endif
+# ifdef S_IFDOOR
     case S_IFDOOR:
       type = FTYPE_DOOR;
       break;
-#endif
+# endif
     }
 #endif /* S_IFMT */
 
diff --git a/find/print.h b/find/print.h
index 79ec7911..4b039b19 100644
--- a/find/print.h
+++ b/find/print.h
@@ -15,9 +15,9 @@
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 #ifndef PRINT_H
-#define PRINT_H
+# define PRINT_H
 
-#include "defs.h"
+# include "defs.h"
 
 struct format_val;
 struct parser_table;
diff --git a/find/sharefile.h b/find/sharefile.h
index 44e8a9d6..6009e382 100644
--- a/find/sharefile.h
+++ b/find/sharefile.h
@@ -17,10 +17,10 @@
 
 
 #ifndef INC_SHAREFILE_H
-#define INC_SHAREFILE_H 1
+# define INC_SHAREFILE_H 1
 
-#include <stdlib.h>
-#include <stdio.h>
+# include <stdlib.h>
+# include <stdio.h>
 
 typedef void * sharefile_handle;
 
diff --git a/gnulib-local/lib/gcc-function-attributes.h 
b/gnulib-local/lib/gcc-function-attributes.h
index 7d1ffd05..5c557226 100644
--- a/gnulib-local/lib/gcc-function-attributes.h
+++ b/gnulib-local/lib/gcc-function-attributes.h
@@ -23,16 +23,16 @@
  for details.
 */
 #ifndef _GCC_FUNCTION_ATTRIBUTES_H
-#define _GCC_FUNCTION_ATTRIBUTES_H
+# define _GCC_FUNCTION_ATTRIBUTES_H
 
-#ifndef __GNUC_PREREQ
-# if defined __GNUC__ && defined __GNUC_MINOR__
-#  define __GNUC_PREREQ(maj, min) \
+# ifndef __GNUC_PREREQ
+#  if defined __GNUC__ && defined __GNUC_MINOR__
+#   define __GNUC_PREREQ(maj, min) \
          ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-# else
-#  define __GNUC_PREREQ(maj, min) 0
+#  else
+#   define __GNUC_PREREQ(maj, min) 0
+#  endif
 # endif
-#endif
 
 /*
 The following attributes are currently (GCC-4.4.5) defined for
@@ -98,116 +98,116 @@ visibility    "default"
 */
 
 
-#ifndef _GL_ATTRIBUTE_ALLOC_SIZE
-# if __GNUC_PREREQ(4,3)
-#  define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
-# else
-#  define _GL_ATTRIBUTE_ALLOC_SIZE(args) /* unsupported */
+# ifndef _GL_ATTRIBUTE_ALLOC_SIZE
+#  if __GNUC_PREREQ(4,3)
+#   define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
+#  else
+#   define _GL_ATTRIBUTE_ALLOC_SIZE(args) /* unsupported */
+#  endif
 # endif
-#endif
 
-#ifndef _GL_ATTRIBUTE_DEPRECATED
-# if __GNUC_PREREQ(3,1)
-#  define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
-# else
-#  define _GL_ATTRIBUTE_DEPRECATED /* empty */
+# ifndef _GL_ATTRIBUTE_DEPRECATED
+#  if __GNUC_PREREQ(3,1)
+#   define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
+#  else
+#   define _GL_ATTRIBUTE_DEPRECATED /* empty */
+#  endif
 # endif
-#endif
 
-#ifndef _GL_ATTRIBUTE_FORMAT
-# if __GNUC_PREREQ(2,7)
-#  define _GL_ATTRIBUTE_FORMAT(spec)  __attribute__ ((__format__ spec))
-# else
-#  define _GL_ATTRIBUTE_FORMAT(spec) /* unsupported */
+# ifndef _GL_ATTRIBUTE_FORMAT
+#  if __GNUC_PREREQ(2,7)
+#   define _GL_ATTRIBUTE_FORMAT(spec)  __attribute__ ((__format__ spec))
+#  else
+#   define _GL_ATTRIBUTE_FORMAT(spec) /* unsupported */
+#  endif
 # endif
-#endif
 
-#ifndef _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM
-# if __GNUC_PREREQ(2,7)
-#  define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, 
first_argument) \
+# ifndef _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM
+#  if __GNUC_PREREQ(2,7)
+#   define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, 
first_argument) \
     _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
-# else
-#  define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(spec) /* unsupported */
+#  else
+#   define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(spec) /* unsupported */
+#  endif
 # endif
-#endif
 
-#ifndef _GL_ATTRIBUTE_FORMAT_PRINTF
-# if __GNUC_PREREQ(2,7)
-#  if __GNUC_PREREQ(4,4)
-#   define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) 
\
+# ifndef _GL_ATTRIBUTE_FORMAT_PRINTF
+#  if __GNUC_PREREQ(2,7)
+#   if __GNUC_PREREQ(4,4)
+#    define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, 
first_argument) \
      _GL_ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, 
first_argument))
-#  else
-#   define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) 
\
+#   else
+#    define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, 
first_argument) \
      _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, 
first_argument))
+#   endif
+#  else
+#   define _GL_ATTRIBUTE_FORMAT_PRINTF(spec) /* unsupported */
 #  endif
-# else
-#  define _GL_ATTRIBUTE_FORMAT_PRINTF(spec) /* unsupported */
 # endif
-#endif
 
-#ifndef _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM
-# if __GNUC_PREREQ(2,7)
-#  define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, 
first_argument) \
+# ifndef _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM
+#  if __GNUC_PREREQ(2,7)
+#   define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, 
first_argument) \
     _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
-# else
-#  define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(spec) /* unsupported */
+#  else
+#   define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(spec) /* unsupported */
+#  endif
 # endif
-#endif
 
-#ifndef _GL_ATTRIBUTE_FORMAT_SCANF
-# if __GNUC_PREREQ(2,7)
-#  if __GNUC_PREREQ(4,4)
-#   define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
+# ifndef _GL_ATTRIBUTE_FORMAT_SCANF
+#  if __GNUC_PREREQ(2,7)
+#   if __GNUC_PREREQ(4,4)
+#    define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) 
\
      _GL_ATTRIBUTE_FORMAT ((__gnu_scanf__, formatstring_parameter, 
first_argument))
-#  else
-#   define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) \
+#   else
+#    define _GL_ATTRIBUTE_FORMAT_SCANF(formatstring_parameter, first_argument) 
\
      _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
+#   endif
+#  else
+#   define _GL_ATTRIBUTE_FORMAT_SCANF(spec) /* unsupported */
 #  endif
-# else
-#  define _GL_ATTRIBUTE_FORMAT_SCANF(spec) /* unsupported */
 # endif
-#endif
 
-#ifndef _GL_ATTRIBUTE_MALLOC
-# if __GNUC_PREREQ(3,0)
-#  define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
-# else
-#  define _GL_ATTRIBUTE_MALLOC /* unsupported */
+# ifndef _GL_ATTRIBUTE_MALLOC
+#  if __GNUC_PREREQ(3,0)
+#   define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+#  else
+#   define _GL_ATTRIBUTE_MALLOC /* unsupported */
+#  endif
 # endif
-#endif
 
 
-#ifndef _GL_ATTRIBUTE_NONNULL
-# if __GNUC_PREREQ(3,3)
+# ifndef _GL_ATTRIBUTE_NONNULL
+#  if __GNUC_PREREQ(3,3)
 #   define _GL_ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
 #  else
 #   define _GL_ATTRIBUTE_NONNULL(m) /* unsupported */
+#  endif
 # endif
-#endif
-#ifndef _GL_ARG_NONNULL
+# ifndef _GL_ARG_NONNULL
 /* alternative spelling used in gnulib's stdio.h */
-# define _GL_ARG_NONNULL(m) _GL_ATTRIBUTE_NONNULL(m)
-#endif
+#  define _GL_ARG_NONNULL(m) _GL_ATTRIBUTE_NONNULL(m)
+# endif
 
 
-#ifndef _GL_ATTRIBUTE_NORETURN
-# if __GNUC_PREREQ(2,8)
+# ifndef _GL_ATTRIBUTE_NORETURN
+#  if __GNUC_PREREQ(2,8)
 #   define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
 #  else
 #   define _GL_ATTRIBUTE_NORETURN /* unsupported */
+#  endif
 # endif
-#endif
 
-#ifndef _GL_ATTRIBUTE_PURE
-# if __GNUC_PREREQ(2,96)
+# ifndef _GL_ATTRIBUTE_PURE
+#  if __GNUC_PREREQ(2,96)
 #   define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
 #  else
 #   define _GL_ATTRIBUTE_PURE /* unsupported */
+#  endif
 # endif
-#endif
 
-#ifndef _GL_ATTRIBUTE_SENTINEL
-# if __GNUC_PREREQ(4,0)
+# ifndef _GL_ATTRIBUTE_SENTINEL
+#  if __GNUC_PREREQ(4,0)
   /* gnulib uses the __attribute__((__sentinel__)) variant, for which the
     argument number 0 is assumed.  Arguments are counted backwards, the last
     being 0.
@@ -215,19 +215,19 @@ visibility    "default"
 #   define _GL_ATTRIBUTE_SENTINEL(backward_arg_num) __attribute__ 
((__sentinel__(backward_arg_num)))
 #  else
 #   define _GL_ATTRIBUTE_SENTINEL(backward_arg_num) /* unsupported */
+#  endif
 # endif
-#endif
 
-#ifndef _GL_ATTRIBUTE_WUR
-# if __GNUC_PREREQ(3,4)
-#  define _GL_ATTRIBUTE_WUR __attribute__ ((__warn__unused_result__))
-# else
-#  define _GL_ATTRIBUTE_WUR /* unsupported */
+# ifndef _GL_ATTRIBUTE_WUR
+#  if __GNUC_PREREQ(3,4)
+#   define _GL_ATTRIBUTE_WUR __attribute__ ((__warn__unused_result__))
+#  else
+#   define _GL_ATTRIBUTE_WUR /* unsupported */
+#  endif
 # endif
-#endif
-#ifndef _GL_ATTRIBUTE_RETURN_CHECK
+# ifndef _GL_ATTRIBUTE_RETURN_CHECK
 /* gnulib is inconsistent in which macro it uses; support both for now. */
-# define _GL_ATTRIBUTE_RETURN_CHECK _GL_ATTRIBUTE_WUR
-#endif
+#  define _GL_ATTRIBUTE_RETURN_CHECK _GL_ATTRIBUTE_WUR
+# endif
 
 #endif /* _GCC_FUNCTION_ATTRIBUTES_H */
diff --git a/lib/bugreports.h b/lib/bugreports.h
index b2bb3a7b..752545c6 100644
--- a/lib/bugreports.h
+++ b/lib/bugreports.h
@@ -18,7 +18,7 @@
  */
 #if !defined BUGREPORTS_H
 # define BUGREPORTS_H
-#include <stdio.h>
+# include <stdio.h>
 
 /* Interpreetation of the return code is as for fprintf. */
 int explain_how_to_report_bugs (FILE *f, const char *program_name);
diff --git a/lib/buildcmd.c b/lib/buildcmd.c
index efe6d15c..63384b92 100644
--- a/lib/buildcmd.c
+++ b/lib/buildcmd.c
@@ -44,8 +44,8 @@
    We try to make it as large as possible.  See bc_get_arg_max() below. */
 #if defined NCARGS && !defined ARG_MAX
 /* We include sys/param.h in order to detect this case. */
-#error "You have an unusual system.  Once you remove this error message from 
buildcmd.c, it should work, but please make sure that DejaGnu is installed on 
your system and that 'make check' passes before using the findutils programs.  
Please mail address@hidden to tell us about your system."
-#define ARG_MAX NCARGS
+# error "You have an unusual system.  Once you remove this error message from 
buildcmd.c, it should work, but please make sure that DejaGnu is installed on 
your system and that 'make check' passes before using the findutils programs.  
Please mail address@hidden to tell us about your system."
+# define ARG_MAX NCARGS
 #endif
 
 
diff --git a/lib/buildcmd.h b/lib/buildcmd.h
index 94fea98a..52695cd5 100644
--- a/lib/buildcmd.h
+++ b/lib/buildcmd.h
@@ -18,9 +18,9 @@
  * Written by James Youngman.
  */
 #ifndef INC_BUILDCMD_H
-#define INC_BUILDCMD_H 1
+# define INC_BUILDCMD_H 1
 
-#include <stdbool.h>
+# include <stdbool.h>
 
 struct buildcmd_state
 {
diff --git a/lib/extendbuf.h b/lib/extendbuf.h
index b00ca95c..fdc219b3 100644
--- a/lib/extendbuf.h
+++ b/lib/extendbuf.h
@@ -17,7 +17,7 @@
 */
 
 #ifndef INC_EXTENDBUF_H
-#define INC_EXTENDBUF_H 1
+# define INC_EXTENDBUF_H 1
 
 void *extendbuf(void* existing, size_t wanted, size_t *allocated);
 void *xextendbuf(void* existing, size_t wanted, size_t *allocated);
diff --git a/lib/fdleak.h b/lib/fdleak.h
index 3c97b6fd..b73f93e5 100644
--- a/lib/fdleak.h
+++ b/lib/fdleak.h
@@ -15,7 +15,7 @@
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 #ifndef FDLEAK_H
-#define FDLEAK_H
+# define FDLEAK_H
 
 void remember_non_cloexec_fds (void);
 void forget_non_cloexec_fds (void);
diff --git a/lib/findutils-version.h b/lib/findutils-version.h
index 08b2146d..113665a4 100644
--- a/lib/findutils-version.h
+++ b/lib/findutils-version.h
@@ -15,7 +15,7 @@
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 #ifndef FINDUTILS_VERSION_H
-#define FINDUTILS_VERSION_H
+# define FINDUTILS_VERSION_H
 /*
  * display_findutils_version displays GNU coding standard compliant
  * version information.
diff --git a/lib/listfile.c b/lib/listfile.c
index f1c7111c..10f1c531 100644
--- a/lib/listfile.c
+++ b/lib/listfile.c
@@ -48,16 +48,16 @@
 
 /* Since major is a function on SVR4, we can't use `ifndef major'.  */
 #ifdef MAJOR_IN_MKDEV
-#include <sys/mkdev.h>
+# include <sys/mkdev.h>
 #else
-#  ifdef MAJOR_IN_SYSMACROS
-#    include <sys/sysmacros.h>
-#  else
-#    ifndef major                    /* Might be defined in sys/types.h.  */
-#      define major(dev)  (((dev) >> 8) & 0xff)
-#      define minor(dev)  ((dev) & 0xff)
-#    endif
+# ifdef MAJOR_IN_SYSMACROS
+#  include <sys/sysmacros.h>
+# else
+#  ifndef major                    /* Might be defined in sys/types.h.  */
+#   define major(dev)  (((dev) >> 8) & 0xff)
+#   define minor(dev)  ((dev) & 0xff)
 #  endif
+# endif
 #endif
 
 
diff --git a/lib/printquoted.h b/lib/printquoted.h
index 3496f605..c141f6fe 100644
--- a/lib/printquoted.h
+++ b/lib/printquoted.h
@@ -19,11 +19,11 @@
 #if !defined PRINTQUOTED_H
 # define PRINTQUOTED_H
 
-#include <stdbool.h>
-#include <stdio.h>
+# include <stdbool.h>
+# include <stdio.h>
 
-#include "quote.h"
-#include "quotearg.h"
+# include "quote.h"
+# include "quotearg.h"
 
 
 size_t qmark_chars(char *buf, size_t len);
diff --git a/lib/regextype.h b/lib/regextype.h
index 49e6c01d..ad87d3e3 100644
--- a/lib/regextype.h
+++ b/lib/regextype.h
@@ -18,7 +18,7 @@
 /* Written by James Youngman <address@hidden>.
  */
 #ifndef REGEXTPE_H
-#define REGEXTPE_H
+# define REGEXTPE_H
 
 /* Translate a regular expression type name into an option mask.
  * This could convert "grep" into RE_SYNTAX_GREP, for example.
diff --git a/lib/safe-atoi.h b/lib/safe-atoi.h
index 0aff25ef..c8694bea 100644
--- a/lib/safe-atoi.h
+++ b/lib/safe-atoi.h
@@ -16,9 +16,9 @@
 */
 
 #ifndef SAFE_ATOI_H
-#define SAFE_ATOI_H 1
+# define SAFE_ATOI_H 1
 
-#include "quotearg.h"
+# include "quotearg.h"
 
 int safe_atoi (const char *s, enum quoting_style style);
 
diff --git a/lib/splitstring.h b/lib/splitstring.h
index 5c04e83a..c09c5562 100644
--- a/lib/splitstring.h
+++ b/lib/splitstring.h
@@ -18,7 +18,7 @@
  * Written by James Youngman.
  */
 #ifndef SPLITSTRING_H
-#define SPLITSTRING_H
+# define SPLITSTRING_H
 
 /* Split a string into fields.   The string is never modified.
  *
@@ -35,8 +35,8 @@
  * Consecutive field separators are taken to indicate the presence of
  * an empty field.
  */
-#include <stdbool.h>
-#include <stddef.h>
+# include <stdbool.h>
+# include <stddef.h>
 
 bool splitstring(const char *s, const char *separators,
                 bool first, size_t *pos, size_t *len);
diff --git a/lib/system.h b/lib/system.h
index b473cb89..68123649 100644
--- a/lib/system.h
+++ b/lib/system.h
@@ -18,20 +18,20 @@
 #if !defined SYSTEM_H
 # define SYSTEM_H
 
-#include <locale.h>
+# include <locale.h>
 
 /* Take care of NLS matters.  */
 
-#include "gettext.h"
-#if ! ENABLE_NLS
-# undef textdomain
-# define textdomain(Domainname) /* empty */
-# undef bindtextdomain
-# define bindtextdomain(Domainname, Dirname) /* empty */
-#endif
+# include "gettext.h"
+# if ! ENABLE_NLS
+#  undef textdomain
+#  define textdomain(Domainname) /* empty */
+#  undef bindtextdomain
+#  define bindtextdomain(Domainname, Dirname) /* empty */
+# endif
 
-#define _(msgid) gettext (msgid)
-#define N_(msgid) msgid
+# define _(msgid) gettext (msgid)
+# define N_(msgid) msgid
 
 /* FALLTHROUGH
  * Since GCC7, the "-Werror=implicit-fallthrough=" option requires
@@ -47,12 +47,12 @@
  *     ...
  *     }
  */
-#ifndef FALLTHROUGH
-# if __GNUC__ < 7
-#  define FALLTHROUGH ((void) 0)
-# else
-#  define FALLTHROUGH __attribute__ ((__fallthrough__))
+# ifndef FALLTHROUGH
+#  if __GNUC__ < 7
+#   define FALLTHROUGH ((void) 0)
+#  else
+#   define FALLTHROUGH __attribute__ ((__fallthrough__))
+#  endif
 # endif
-#endif
 
 #endif /* SYSTEM_H */
diff --git a/locate/locatedb.h b/locate/locatedb.h
index d8340006..beb10b17 100644
--- a/locate/locatedb.h
+++ b/locate/locatedb.h
@@ -16,22 +16,22 @@
 */
 
 #ifndef INC_LOCATEDB_H
-#define INC_LOCATEDB_H 1
+# define INC_LOCATEDB_H 1
 
 /* The magic string at the start of a locate database, to make sure
    it's in the right format.  The 02 is the database format version number.
    This string has the same format as a database entry, but you can't
    concatenate databases even if you remove it, since the differential count
    in the first entry of the second database will be wrong.  */
-#define LOCATEDB_MAGIC "\0LOCATE02"
+# define LOCATEDB_MAGIC "\0LOCATE02"
 
 /* Common-prefix length differences in the ranges
    0..127, -127..-1 (0x00..0x7f, 0x81..0xff) fit into one byte.
    This value (which is -128) indicates that the difference is
    too large to fit into one byte, and a two-byte integer follows.  */
-#define        LOCATEDB_ESCAPE 0x80
-#define LOCATEDB_ONEBYTE_MAX (127)
-#define LOCATEDB_ONEBYTE_MIN (-127)
+# define LOCATEDB_ESCAPE 0x80
+# define LOCATEDB_ONEBYTE_MAX (127)
+# define LOCATEDB_ONEBYTE_MIN (-127)
 
 
 /* If it is ever possible to try to encode LOCATEDB_MAGIC as a
@@ -40,17 +40,17 @@
  * stream.  We use a compile-time check in the preprocessor to prevent
  * this.
  */
-#if LOCATEDB_ESCAPE <= LOCATEDB_ONEBYTE_MAX
-#error "You have a bad combination of LOCATEDB_ESCAPE and 
LOCATEDB_ONEBYTE_MAX, see above"
-#endif
+# if LOCATEDB_ESCAPE <= LOCATEDB_ONEBYTE_MAX
+#  error "You have a bad combination of LOCATEDB_ESCAPE and 
LOCATEDB_ONEBYTE_MAX, see above"
+# endif
 
 /* These are used for old, bigram-encoded databases:  */
 
 /* Means the differential count follows in a 2-byte int instead. */
-#define        LOCATEDB_OLD_ESCAPE     30
+# define LOCATEDB_OLD_ESCAPE   30
 
 /* Offset added to differential counts to encode them as positive numbers.  */
-#define        LOCATEDB_OLD_OFFSET     14
+# define LOCATEDB_OLD_OFFSET   14
 
 typedef enum
   {
@@ -63,6 +63,6 @@ int getword (FILE *fp, const char *filename,
             size_t maxvalue,
             GetwordEndianState *endian_state_flag);
 
-#define SLOCATE_DB_MAGIC_LEN 2
+# define SLOCATE_DB_MAGIC_LEN 2
 
 #endif /* !INC_LOCATEDB_H */
diff --git a/xargs/xargs.c b/xargs/xargs.c
index 4585d3c0..46307137 100644
--- a/xargs/xargs.c
+++ b/xargs/xargs.c
@@ -70,7 +70,7 @@
 
 
 #ifndef LONG_MAX
-#define LONG_MAX (~(1 << (sizeof (long) * 8 - 1)))
+# define LONG_MAX (~(1 << (sizeof (long) * 8 - 1)))
 #endif
 
 #define ISBLANK(c) (isascii (c) && isblank (c))
@@ -677,7 +677,7 @@ main (int argc, char **argv)
   assert (BC_INIT_OK == bcstatus);
 
 #ifdef SIGUSR1
-#ifdef SIGUSR2
+# ifdef SIGUSR2
   /* Accept signals to increase or decrease the number of running
      child processes.  Do this as early as possible after setting
      proc_max.  */
@@ -692,7 +692,7 @@ main (int argc, char **argv)
   sigact.sa_flags = 0;
   if (0 != sigaction (SIGUSR2, &sigact, (struct sigaction *)NULL))
          error (0, errno, _("Cannot set SIGUSR2 signal handler"));
-#endif /* SIGUSR2 */
+# endif /* SIGUSR2 */
 #endif /* SIGUSR1 */
 
 
-- 
2.19.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]