diff options
author | James Youngman <jay@gnu.org> | 2011-06-02 12:22:22 +0100 |
---|---|---|
committer | James Youngman <jay@gnu.org> | 2011-06-02 12:22:22 +0100 |
commit | f3d4ac9bb470775df8ceb371b689825a69d8a7fb (patch) | |
tree | aa3ab5edae47eb9fbeb735088e67b4dfdab8b0ed | |
parent | f4171f93f146a71678fd381f628ca2eb2a7b841e (diff) | |
download | findutils-f3d4ac9bb470775df8ceb371b689825a69d8a7fb.tar.gz |
Remove unnecessary header checks and include guards.
* configure.ac (AC_CHECK_HEADERS): Remove checks for header files
that gnulib either assumes are always present, or provides
itself. These include errno.h fcntl.h inttypes.h limits.h
locale.h stddef.h stdint.h stdlib.h string.h sys/types.h
unistd.h.
* lib/buildcmd.c: Remove include guard for limits.h.
* find/fstype.c: Remove include guard for sys/types.h.
* lib/savedirinfo.c: Likewise.
* find/find.c: Remove include guard for locale.h.
* find/ftsfind.c: Likewise.
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | find/find.c | 5 | ||||
-rw-r--r-- | find/fstype.c | 2 | ||||
-rw-r--r-- | find/ftsfind.c | 6 | ||||
-rw-r--r-- | lib/buildcmd.c | 6 | ||||
-rw-r--r-- | lib/savedirinfo.c | 8 |
7 files changed, 19 insertions, 26 deletions
@@ -1,3 +1,17 @@ +2011-06-02 James Youngman <jay@gnu.org> + + Remove unnecessary header checks and include guards. + * configure.ac (AC_CHECK_HEADERS): Remove checks for header files + that gnulib either assumes are always present, or provides + itself. These include errno.h fcntl.h inttypes.h limits.h + locale.h stddef.h stdint.h stdlib.h string.h sys/types.h + unistd.h. + * lib/buildcmd.c: Remove include guard for limits.h. + * find/fstype.c: Remove include guard for sys/types.h. + * lib/savedirinfo.c: Likewise. + * find/find.c: Remove include guard for locale.h. + * find/ftsfind.c: Likewise. + 2011-06-01 James Youngman <jay@gnu.org> Better error handling for the result of set_fstype_devno. diff --git a/configure.ac b/configure.ac index 9aff8c83..c46ffc2d 100644 --- a/configure.ac +++ b/configure.ac @@ -119,15 +119,13 @@ AC_SUBST([FINDLIBS]) dnl Checks for header files. AC_HEADER_STDC -dnl Assume unistd.h is present - coreutils does too. -AC_CHECK_HEADERS(fcntl.h string.h limits.h errno.h stdlib.h stddef.h) -AC_CHECK_HEADERS(unistd.h sys/types.h inttypes.h fcntl.h locale.h stdint.h) AC_CHECK_HEADERS(sys/param.h mntent.h sys/mnttab.h sys/mntio.h sys/mkdev.h) dnl find.c needs sys/utsname.h because it calls uname(2). AC_CHECK_HEADERS(sys/utsname.h) dnl fdleak.c needs sys/resource.h because it calls getrlimit(2). AC_CHECK_HEADERS(sys/resource.h) AC_HEADER_MAJOR +dnl TODO: it's possible gnulib eliminates the need for AC_HEADER_DIRENT. AC_HEADER_DIRENT AC_HEADER_STAT AC_HEADER_SYS_WAIT diff --git a/find/find.c b/find/find.c index 98d5a376..67da83a3 100644 --- a/find/find.c +++ b/find/find.c @@ -37,6 +37,7 @@ #include <sys/stat.h> #include <fcntl.h> +#include <locale.h> #include "fcntl--.h" #include "xalloc.h" @@ -53,10 +54,6 @@ #include "progname.h" #include "save-cwd.h" -#ifdef HAVE_LOCALE_H -#include <locale.h> -#endif - #if ENABLE_NLS # include <libintl.h> # define _(Text) gettext (Text) diff --git a/find/fstype.c b/find/fstype.c index fc8c09ca..cac2d28e 100644 --- a/find/fstype.c +++ b/find/fstype.c @@ -27,9 +27,7 @@ #include <errno.h> #include <stdbool.h> -#ifdef HAVE_SYS_TYPES_H #include <sys/types.h> -#endif #include <sys/stat.h> /* The presence of unistd.h is assumed by gnulib these days, so we diff --git a/find/ftsfind.c b/find/ftsfind.c index 9fdb8ef7..97fb2e4f 100644 --- a/find/ftsfind.c +++ b/find/ftsfind.c @@ -38,10 +38,10 @@ #include <errno.h> #include <assert.h> +#include <locale.h> #include <fcntl.h> #include <sys/stat.h> - #include <unistd.h> #include "progname.h" @@ -56,10 +56,6 @@ #include "fdleak.h" #include "unused-result.h" -#ifdef HAVE_LOCALE_H -#include <locale.h> -#endif - #if ENABLE_NLS # include <libintl.h> # define _(Text) gettext (Text) diff --git a/lib/buildcmd.c b/lib/buildcmd.c index d595e6fd..0bc607cc 100644 --- a/lib/buildcmd.c +++ b/lib/buildcmd.c @@ -23,6 +23,8 @@ #include <wchar.h> #include <locale.h> #include <stdbool.h> +#include <limits.h> + #if ENABLE_NLS # include <libintl.h> @@ -43,10 +45,6 @@ #include <sys/param.h> #endif -#ifdef HAVE_LIMITS_H -#include <limits.h> -#endif - /* The presence of unistd.h is assumed by gnulib these days, so we * might as well assume it too. */ diff --git a/lib/savedirinfo.c b/lib/savedirinfo.c index d9b6000b..f712cdba 100644 --- a/lib/savedirinfo.c +++ b/lib/savedirinfo.c @@ -22,16 +22,8 @@ #include <config.h> #include <sys/stat.h> - -#if HAVE_SYS_TYPES_H # include <sys/types.h> -#endif - -/* The presence of unistd.h is assumed by gnulib these days, so we - * might as well assume it too. - */ #include <unistd.h> - #include <errno.h> #if HAVE_DIRENT_H |