From 5d8fde12eeff4659e84a839851125b98eb477200 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 23 Feb 2011 10:58:06 +0100 Subject: [PATCH] Fix misindentation of preprocessor directives. * lib/argp-namefrob.h: Reindent preprocessor directives. * lib/getopt_int.h (struct _getopt_data): Likewise. * lib/progreloc.c (maybe_executable, find_executable): Likewise. * lib/vasnprintf.c (decode_long_double): Likewise. * tests/test-argmatch.c: Insert blank lines, for clarity. * tests/test-exclude.c: Likewise. --- ChangeLog | 10 ++++++++++ lib/argp-namefrob.h | 26 +++++++++++++------------- lib/getopt_int.h | 2 +- lib/progreloc.c | 22 +++++++++++----------- lib/vasnprintf.c | 6 +++--- tests/test-argmatch.c | 2 ++ tests/test-exclude.c | 2 ++ 7 files changed, 42 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index f2e9ee0a8..7d670a568 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2011-02-23 Bruno Haible + + Fix misindentation of preprocessor directives. + * lib/argp-namefrob.h: Reindent preprocessor directives. + * lib/getopt_int.h (struct _getopt_data): Likewise. + * lib/progreloc.c (maybe_executable, find_executable): Likewise. + * lib/vasnprintf.c (decode_long_double): Likewise. + * tests/test-argmatch.c: Insert blank lines, for clarity. + * tests/test-exclude.c: Likewise. + 2011-02-22 Bruno Haible ioctl: Fix for MacOS X in 64-bit mode. diff --git a/lib/argp-namefrob.h b/lib/argp-namefrob.h index 3ce158509..5f6b02023 100644 --- a/lib/argp-namefrob.h +++ b/lib/argp-namefrob.h @@ -100,45 +100,45 @@ #endif #if defined(HAVE_DECL_FEOF_UNLOCKED) && !HAVE_DECL_FEOF_UNLOCKED # define feof_unlocked(x) feof (x) -# endif +#endif #if defined(HAVE_DECL_FERROR_UNLOCKED) && !HAVE_DECL_FERROR_UNLOCKED # define ferror_unlocked(x) ferror (x) -# endif +#endif #if defined(HAVE_DECL_FFLUSH_UNLOCKED) && !HAVE_DECL_FFLUSH_UNLOCKED # define fflush_unlocked(x) fflush (x) -# endif +#endif #if defined(HAVE_DECL_FGETS_UNLOCKED) && !HAVE_DECL_FGETS_UNLOCKED # define fgets_unlocked(x,y,z) fgets (x,y,z) -# endif +#endif #if defined(HAVE_DECL_FPUTC_UNLOCKED) && !HAVE_DECL_FPUTC_UNLOCKED # define fputc_unlocked(x,y) fputc (x,y) -# endif +#endif #if defined(HAVE_DECL_FPUTS_UNLOCKED) && !HAVE_DECL_FPUTS_UNLOCKED # define fputs_unlocked(x,y) fputs (x,y) -# endif +#endif #if defined(HAVE_DECL_FREAD_UNLOCKED) && !HAVE_DECL_FREAD_UNLOCKED # define fread_unlocked(w,x,y,z) fread (w,x,y,z) -# endif +#endif #if defined(HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED # define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z) -# endif +#endif #if defined(HAVE_DECL_GETC_UNLOCKED) && !HAVE_DECL_GETC_UNLOCKED # define getc_unlocked(x) getc (x) -# endif +#endif #if defined(HAVE_DECL_GETCHAR_UNLOCKED) && !HAVE_DECL_GETCHAR_UNLOCKED # define getchar_unlocked() getchar () -# endif +#endif #if defined(HAVE_DECL_PUTC_UNLOCKED) && !HAVE_DECL_PUTC_UNLOCKED # define putc_unlocked(x,y) putc (x,y) -# endif +#endif #if defined(HAVE_DECL_PUTCHAR_UNLOCKED) && !HAVE_DECL_PUTCHAR_UNLOCKED # define putchar_unlocked(x) putchar (x) -# endif +#endif #endif /* !_LIBC */ #ifndef __set_errno -#define __set_errno(e) (errno = (e)) +# define __set_errno(e) (errno = (e)) #endif #if defined GNULIB_ARGP_DISABLE_DIRNAME diff --git a/lib/getopt_int.h b/lib/getopt_int.h index 7a01a6aa4..9f0c7131a 100644 --- a/lib/getopt_int.h +++ b/lib/getopt_int.h @@ -108,7 +108,7 @@ struct _getopt_data #if defined _LIBC && defined USE_NONOPTION_FLAGS int __nonoption_flags_max_len; int __nonoption_flags_len; -# endif +#endif }; /* The initializer is necessary to set OPTIND and OPTERR to their diff --git a/lib/progreloc.c b/lib/progreloc.c index 7a480c804..acfbcb3f7 100644 --- a/lib/progreloc.c +++ b/lib/progreloc.c @@ -117,7 +117,7 @@ maybe_executable (const char *filename) if (access (filename, X_OK) < 0) return false; -#ifdef __linux__ +# ifdef __linux__ if (executable_fd >= 0) { /* If we already have an executable_fd, check that filename points to @@ -135,7 +135,7 @@ maybe_executable (const char *filename) return false; } } -#endif +# endif #endif return true; @@ -157,7 +157,7 @@ find_executable (const char *argv0) /* Shouldn't happen. */ return NULL; { -#if defined __CYGWIN__ +# if defined __CYGWIN__ /* cygwin-1.5.13 (2005-03-01) or newer would also allow a Linux-like implementation: readlink of "/proc/self/exe". But using the result of the Win32 system call is simpler and is consistent with the @@ -176,12 +176,12 @@ find_executable (const char *argv0) return NULL; /* Call canonicalize_file_name, because Cygwin supports symbolic links. */ return canonicalize_file_name (location_as_posix_path); -#else +# else return xstrdup (location); -#endif +# endif } #else /* Unix && !Cygwin */ -#ifdef __linux__ +# ifdef __linux__ /* The executable is accessible as /proc//exe. In newer Linux versions, also as /proc/self/exe. Linux >= 2.1 provides a symlink to the true pathname; older Linux versions give only device and ino, @@ -205,8 +205,8 @@ find_executable (const char *argv0) executable_fd = open (buf, O_EXEC, 0); } } -#endif -#if HAVE_MACH_O_DYLD_H && HAVE__NSGETEXECUTABLEPATH +# endif +# if HAVE_MACH_O_DYLD_H && HAVE__NSGETEXECUTABLEPATH /* On MacOS X 10.2 or newer, the function int _NSGetExecutablePath (char *buf, uint32_t *bufsize); can be used to retrieve the executable's full path. */ @@ -215,7 +215,7 @@ find_executable (const char *argv0) if (_NSGetExecutablePath (location, &length) == 0 && location[0] == '/') return canonicalize_file_name (location); -#endif +# endif /* Guess the executable's full path. We assume the executable has been called via execlp() or execvp() with properly set up argv[0]. The login(1) convention to add a '-' prefix to argv[0] is not supported. */ @@ -256,10 +256,10 @@ find_executable (const char *argv0) /* We have a path item at p, of length p_len. Now concatenate the path item and argv0. */ concat_name = (char *) xmalloc (p_len + strlen (argv0) + 2); -#ifdef NO_XMALLOC +# ifdef NO_XMALLOC if (concat_name == NULL) return NULL; -#endif +# endif if (p_len == 0) /* An empty PATH element designates the current directory. */ strcpy (concat_name, argv0); diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index 8f0730878..d1eeaa5e0 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -935,11 +935,11 @@ decode_long_double (long double x, int *ep, mpn_t *mp) abort (); m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo; } -#if 0 /* On FreeBSD 6.1/x86, 'long double' numbers sometimes have excess - precision. */ +# if 0 /* On FreeBSD 6.1/x86, 'long double' numbers sometimes have excess + precision. */ if (!(y == 0.0L)) abort (); -#endif +# endif /* Normalise. */ while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0) m.nlimbs--; diff --git a/tests/test-argmatch.c b/tests/test-argmatch.c index 7392f571e..fa25a7c0a 100644 --- a/tests/test-argmatch.c +++ b/tests/test-argmatch.c @@ -29,6 +29,7 @@ /* Some packages define ARGMATCH_DIE and ARGMATCH_DIE_DECL in , and thus must link with a definition of that function. Provide it here. */ #ifdef ARGMATCH_DIE_DECL + # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8) # define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) # else @@ -37,6 +38,7 @@ ARGMATCH_DIE_DECL _GL_ATTRIBUTE_NORETURN; ARGMATCH_DIE_DECL { exit (1); } + #endif enum backup_type diff --git a/tests/test-exclude.c b/tests/test-exclude.c index 75d3b891e..8b1164a7d 100644 --- a/tests/test-exclude.c +++ b/tests/test-exclude.c @@ -63,6 +63,7 @@ ARGMATCH_VERIFY (exclude_keywords, exclude_flags); /* Some packages define ARGMATCH_DIE and ARGMATCH_DIE_DECL in , and thus must link with a definition of that function. Provide it here. */ #ifdef ARGMATCH_DIE_DECL + # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8) # define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) # else @@ -71,6 +72,7 @@ ARGMATCH_VERIFY (exclude_keywords, exclude_flags); ARGMATCH_DIE_DECL _GL_ATTRIBUTE_NORETURN; ARGMATCH_DIE_DECL { exit (1); } + #endif int -- 2.11.0