bug-findutils
[Top][All Lists]
Advanced

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

[PATCH 1/3] Take gnulib-tool's advice about which header files to includ


From: James Youngman
Subject: [PATCH 1/3] Take gnulib-tool's advice about which header files to include.
Date: Mon, 20 Jun 2011 10:37:11 +0100

* locate/locate.c: Include <regex.h> instead of "regex.h".
Include "fnmatch.h" instead of <fnmatch.h> (because we use
fnmatch-gnu).  Include "gettext.h".
* lib/regexprops.c: Include <regex.h> instead of "regex.h".
* find/tree.c: Include "gettext.h".  Include "fnmatch.h" instead
of <fnmatch.h> (because we use fnmatch-gnu).
* find/parser.c: Include "gettext.h" and <regex.h>.  Include
"fnmatch.h" instead of <fnmatch.h> (because we use fnmatch-gnu).
* find/pred.c: Likewise.
* find/exec.c: Include "gettext.h".
* find/find.c: Likewise.
* find/fstype.c: Likewise.
* find/ftsfind.c: Likewise.
* find/print.c: Likewise.
* lib/buildcmd.c: Likewise.
* lib/fdleak.c: Likewise.
* lib/findutils-version.c: Likewise.
* lib/regextype.c: Likewise.
* lib/safe-atoi.c: Likewise.
* find/util.c: Likewise.
* locate/bigram.c: Likewise.
* locate/code.c: Likewise.
* locate/frcode.c: Likewise.
* locate/word_io.c: Likewise.
* xargs/xargs.c: Likewise.
* find/Makefile.am: Add a comment explaining why gnulib-tool
advised us to use each library.
---
 ChangeLog               |   31 +++++++++++++++++++++++++++++++
 find/Makefile.am        |    9 ++++++++-
 find/exec.c             |    1 +
 find/find.c             |    1 +
 find/fstype.c           |    1 +
 find/ftsfind.c          |    1 +
 find/parser.c           |    4 +++-
 find/pred.c             |    3 ++-
 find/print.c            |    1 +
 find/tree.c             |    3 ++-
 find/util.c             |    1 +
 lib/buildcmd.c          |    1 +
 lib/fdleak.c            |    1 +
 lib/findutils-version.c |    2 ++
 lib/regexprops.c        |    2 +-
 lib/regextype.c         |    1 +
 lib/safe-atoi.c         |    1 +
 locate/bigram.c         |    1 +
 locate/code.c           |    1 +
 locate/frcode.c         |    1 +
 locate/locate.c         |    5 +++--
 locate/word_io.c        |    1 +
 xargs/xargs.c           |    1 +
 23 files changed, 67 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4caf006..a5cb978 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,34 @@
+2011-06-20  James Youngman  <address@hidden>
+
+       Take gnulib-tool's advice about which header files to include.
+       * locate/locate.c: Include <regex.h> instead of "regex.h".
+       Include "fnmatch.h" instead of <fnmatch.h> (because we use
+       fnmatch-gnu).  Include "gettext.h".
+       * lib/regexprops.c: Include <regex.h> instead of "regex.h".
+       * find/tree.c: Include "gettext.h".  Include "fnmatch.h" instead
+       of <fnmatch.h> (because we use fnmatch-gnu).
+       * find/parser.c: Include "gettext.h" and <regex.h>.  Include
+       "fnmatch.h" instead of <fnmatch.h> (because we use fnmatch-gnu).
+       * find/pred.c: Likewise.
+       * find/exec.c: Include "gettext.h".
+       * find/find.c: Likewise.
+       * find/fstype.c: Likewise.
+       * find/ftsfind.c: Likewise.
+       * find/print.c: Likewise.
+       * lib/buildcmd.c: Likewise.
+       * lib/fdleak.c: Likewise.
+       * lib/findutils-version.c: Likewise.
+       * lib/regextype.c: Likewise.
+       * lib/safe-atoi.c: Likewise.
+       * find/util.c: Likewise.
+       * locate/bigram.c: Likewise.
+       * locate/code.c: Likewise.
+       * locate/frcode.c: Likewise.
+       * locate/word_io.c: Likewise.
+       * xargs/xargs.c: Likewise.
+       * find/Makefile.am: Add a comment explaining why gnulib-tool
+       advised us to use each library.
+
 2011-06-19  James Youngman  <address@hidden>
 
        Update gnulib.
diff --git a/find/Makefile.am b/find/Makefile.am
index 67fd682..c0f7c3b 100644
--- a/find/Makefile.am
+++ b/find/Makefile.am
@@ -31,7 +31,14 @@ endif
 # man_MANS is not always the same, we want to distribute all of those files.
 EXTRA_DIST = defs.h sharefile.h print.h find.1 ftsfind.1 oldfind.1
 INCLUDES = -I../gl/lib -I$(top_srcdir)/lib -I$(top_srcdir)/gl/lib -I../intl 
-DLOCALEDIR=\"$(localedir)\"
-LDADD = ./libfindtools.a ../lib/libfind.a ../gl/lib/libgnulib.a $(LIBINTL) 
$(LIB_CLOCK_GETTIME) $(LIB_EACCESS) $(LIB_SELINUX) $(LIB_CLOSE) $(MODF_LIBM) 
$(FINDLIBS)
+LDADD = ./libfindtools.a ../lib/libfind.a ../gl/lib/libgnulib.a $(LIBINTL) 
$(LIB_CLOCK_GETTIME) $(LIB_EACCESS) $(LIB_SELINUX) $(LIB_CLOSE) $(MODF_LIBM) 
$(FINDLIBS) $(GETHOSTNAME_LIB) $(LIB_EACCESS)
+# gnulib advises we link against <first> because we use <second>:
+# $(GETHOSTNAME_LIB)            uname
+# $(LIB_CLOCK_GETTIME)          (some inditrect dependency)
+# $(LIB_EACCESS)                faccessat
+# $(LIB_SELINUX)                selinux-h
+# $(MODF_LIBM)                  modf
+
 SUBDIRS = . testsuite
 
 #$(PROGRAMS): ../lib/libfind.a
diff --git a/find/exec.c b/find/exec.c
index 989f207..927081a 100644
--- a/find/exec.c
+++ b/find/exec.c
@@ -30,6 +30,7 @@
 /* gnulib headers */
 #include "error.h"
 #include "dirname.h"
+#include "gettext.h"
 #include "xalloc.h"
 #include "cloexec.h"
 #include "save-cwd.h"
diff --git a/find/find.c b/find/find.c
index c1b57f2..c3e05c5 100644
--- a/find/find.c
+++ b/find/find.c
@@ -47,6 +47,7 @@
 #include "savedirinfo.h"
 #include "buildcmd.h"
 #include "dirname.h"
+#include "gettext.h"
 #include "xgetcwd.h"
 #include "error.h"
 #include "fdleak.h"
diff --git a/find/fstype.c b/find/fstype.c
index e9230fb..32a557a 100644
--- a/find/fstype.c
+++ b/find/fstype.c
@@ -59,6 +59,7 @@ extern int errno;
 #include "extendbuf.h"
 #include "mountlist.h"
 #include "error.h"
+#include "gettext.h"
 
 
 
diff --git a/find/ftsfind.c b/find/ftsfind.c
index 51d5749..dcb81ca 100644
--- a/find/ftsfind.c
+++ b/find/ftsfind.c
@@ -54,6 +54,7 @@
 #include "dircallback.h"
 #include "cloexec.h"
 #include "fdleak.h"
+#include "gettext.h"
 #include "unused-result.h"
 
 #if ENABLE_NLS
diff --git a/find/parser.c b/find/parser.c
index d10e5ee..6a04e51 100644
--- a/find/parser.c
+++ b/find/parser.c
@@ -26,8 +26,9 @@
 #include <pwd.h>
 #include <errno.h>
 #include <grp.h>
-#include <fnmatch.h>
 #include <sys/stat.h>
+#include <regex.h>
+#include "fnmatch.h"
 #include "mountlist.h"
 #include "modechange.h"
 #include "xstrtol.h"
@@ -40,6 +41,7 @@
 #include "fts_.h"
 #include "parse-datetime.h"
 #include "error.h"
+#include "gettext.h"
 #include "findutils-version.h"
 #include "safe-atoi.h"
 #include "fdleak.h"
diff --git a/find/pred.c b/find/pred.c
index b17c4f9..9f5b8a4 100644
--- a/find/pred.c
+++ b/find/pred.c
@@ -19,7 +19,6 @@
 #include <config.h>
 #include "defs.h"
 
-#include <fnmatch.h>
 #include <math.h>
 #include <pwd.h>
 #include <grp.h>
@@ -42,6 +41,8 @@
 #include "stat-size.h"
 #include "dircallback.h"
 #include "error.h"
+#include "fnmatch.h"
+#include "gettext.h"
 #include "areadlink.h"
 
 #include <selinux/selinux.h>
diff --git a/find/print.c b/find/print.c
index b1f5d68..0e15123 100644
--- a/find/print.c
+++ b/find/print.c
@@ -37,6 +37,7 @@
 #include "dirname.h"
 #include "error.h"
 #include "filemode.h"
+#include "gettext.h"
 #include "human.h"
 #include "printquoted.h"
 #include "stat-size.h"
diff --git a/find/tree.c b/find/tree.c
index 0177aac..d525b31 100644
--- a/find/tree.c
+++ b/find/tree.c
@@ -21,10 +21,11 @@
 
 #include <assert.h>
 #include <stdlib.h>
-#include <fnmatch.h>
 
 #include "xalloc.h"
 #include "error.h"
+#include "fnmatch.h"
+#include "gettext.h"
 
 
 #if ENABLE_NLS
diff --git a/find/util.c b/find/util.c
index f639d0b..b59e703 100644
--- a/find/util.c
+++ b/find/util.c
@@ -33,6 +33,7 @@
 #include "quotearg.h"
 #include "timespec.h"
 #include "error.h"
+#include "gettext.h"
 #include "verify.h"
 #include "fdleak.h"
 #include "dircallback.h"
diff --git a/lib/buildcmd.c b/lib/buildcmd.c
index 785c093..15bb91f 100644
--- a/lib/buildcmd.c
+++ b/lib/buildcmd.c
@@ -25,6 +25,7 @@
 #include <stdbool.h>
 #include <limits.h>
 
+#include "gettext.h"
 
 #if ENABLE_NLS
 # include <libintl.h>
diff --git a/lib/fdleak.c b/lib/fdleak.c
index fa3007a..42ee7c2 100644
--- a/lib/fdleak.c
+++ b/lib/fdleak.c
@@ -33,6 +33,7 @@
 #include "dirent-safer.h"
 #include "extendbuf.h"
 #include "cloexec.h"
+#include "gettext.h"
 #include "safe-atoi.h"
 #include "fdleak.h"
 #include "error.h"
diff --git a/lib/findutils-version.c b/lib/findutils-version.c
index 7a9dca9..d37b247 100644
--- a/lib/findutils-version.c
+++ b/lib/findutils-version.c
@@ -16,6 +16,8 @@
 */
 
 #include <config.h>
+
+#include "gettext.h"
 #include "version-etc.h"
 #include "findutils-version.h"
 
diff --git a/lib/regexprops.c b/lib/regexprops.c
index ed7f17b..c0a8e0c 100644
--- a/lib/regexprops.c
+++ b/lib/regexprops.c
@@ -33,8 +33,8 @@
 #include <string.h>
 #include <unistd.h>
 #include <errno.h>
+#include <regex.h>
 
-#include "regex.h"
 #include "regextype.h"
 #include "progname.h"
 
diff --git a/lib/regextype.c b/lib/regextype.c
index efc0609..35106e5 100644
--- a/lib/regextype.c
+++ b/lib/regextype.c
@@ -26,6 +26,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
+#include "gettext.h"
 #include "regextype.h"
 #include "regex.h"
 #include "quote.h"
diff --git a/lib/safe-atoi.c b/lib/safe-atoi.c
index 5a68bd5..9e08ab2 100644
--- a/lib/safe-atoi.c
+++ b/lib/safe-atoi.c
@@ -20,6 +20,7 @@
 #include <stdlib.h>
 #include <errno.h>
 
+#include "gettext.h"
 #include "safe-atoi.h"
 #include "quotearg.h"
 #include "error.h"
diff --git a/locate/bigram.c b/locate/bigram.c
index 477e392..03bc47b 100644
--- a/locate/bigram.c
+++ b/locate/bigram.c
@@ -40,6 +40,7 @@
 #include <sys/types.h>
 
 #include <xalloc.h>
+#include "gettext.h"
 #include "progname.h"
 #include "closeout.h"
 
diff --git a/locate/code.c b/locate/code.c
index d1c6ce5..48cc581 100644
--- a/locate/code.c
+++ b/locate/code.c
@@ -73,6 +73,7 @@
 
 #include "locatedb.h"
 #include "closeout.h"
+#include "gettext.h"
 #include "xalloc.h"
 #include "progname.h"
 #include "error.h"
diff --git a/locate/frcode.c b/locate/frcode.c
index c508472..0cca9db 100644
--- a/locate/frcode.c
+++ b/locate/frcode.c
@@ -98,6 +98,7 @@
 #endif
 
 
+#include "gettext.h"
 #include "locatedb.h"
 #include <getopt.h>
 #include "error.h"
diff --git a/locate/locate.c b/locate/locate.c
index 611b18d..a1a0078 100644
--- a/locate/locate.c
+++ b/locate/locate.c
@@ -67,7 +67,6 @@
 #include <grp.h>                /* for setgroups() */
 #include <sys/stat.h>
 #include <time.h>
-#include <fnmatch.h>
 #include <getopt.h>
 #include <xstrtol.h>
 
@@ -92,6 +91,7 @@
 
 #include <errno.h>
 #include <locale.h>
+#include <regex.h>
 
 
 #if ENABLE_NLS
@@ -116,6 +116,8 @@
 # define N_(String) String
 #endif
 
+#include "fnmatch.h"
+#include "gettext.h"
 #include "locatedb.h"
 #include "progname.h"
 #include "xalloc.h"
@@ -123,7 +125,6 @@
 #include "human.h"
 #include "dirname.h"
 #include "closeout.h"
-#include "regex.h"
 #include "quotearg.h"
 #include "printquoted.h"
 #include "regextype.h"
diff --git a/locate/word_io.c b/locate/word_io.c
index 50dab36..4bb297c 100644
--- a/locate/word_io.c
+++ b/locate/word_io.c
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 
 #include "error.h"
+#include "gettext.h"
 #include "quotearg.h"
 #include "byteswap.h"
 #include "locatedb.h"
diff --git a/xargs/xargs.c b/xargs/xargs.c
index eaa33e0..0c59c6d 100644
--- a/xargs/xargs.c
+++ b/xargs/xargs.c
@@ -57,6 +57,7 @@
 #include <wchar.h>
 #include <stdint.h>
 
+#include "gettext.h"
 #include "verify.h"
 #include "progname.h"
 #include "quotearg.h"
-- 
1.7.2.5




reply via email to

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