sed: #include file cleanup
This mostly avoids including files no longer needed. It also moves dfa.h down, and removes stat-macros.h. * bootstrap.conf (gnulib_modules): Remove stat-macros. * lib/.gitignore: Adjust. * sed/compile.c: Don’t include stdio.h, sys/types.h. stdio.h is guaranteed by sed/sed.h, and sys/types.h should now be redundant. * sed/debug.c: Don’t include ctype.h, stdio.h, string.h, sys/types.h. * sed/execute.c: Don’t include stat-macros.h, ctype.h, selinux/context.h, stdio.h, sys/types.h. * sed/local.mk (sed/version.c): Include "version.h" to check interface consistency. * sed/regexp.c: Don’t include ctype.h, limits.h, stdio.h. Do include dfa.h. * sed/sed.c: Don’t include stdio.h, sys/types.h, unistd.h. * sed/sed.h: Don’t include dfa.h. Don’t include stdio.h or unlocked-io.h, as utils.h does that for us. * sed/utils.c: Don’t include unlocked-io.h, stdio.h, sys/types.h. * sed/utils.h: Include unlocked-io.h instead of stdio.h.
This commit is contained in:
1 parent
7a1fda23a9
commit
077b4d4099
11 files changed
+3
-26
No files matched your search
@@ -61,7 +61,6 @@ regex
|
||||
rename
|
||||
selinux-h
|
||||
ssize_t
|
||||
stat-macros
|
||||
stdckdint-h
|
||||
streq
|
||||
strerror
|
||||
|
||||
@@ -216,7 +216,6 @@
|
||||
/setlocale_null-unlocked.c
|
||||
/setlocale_null.c
|
||||
/setlocale_null.h
|
||||
/stat-macros.h
|
||||
/stat-time.c
|
||||
/stat-time.h
|
||||
/stat-w32.c
|
||||
|
||||
@@ -27,10 +27,8 @@
|
||||
#include <errno.h>
|
||||
#include <obstack.h>
|
||||
#include <stdckdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#define obstack_chunk_alloc xzalloc
|
||||
#define obstack_chunk_free free
|
||||
|
||||
@@ -20,11 +20,7 @@
|
||||
|
||||
#include "sed.h"
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/* indentation level when printing the program */
|
||||
static off_t block_level = 0;
|
||||
|
||||
@@ -23,20 +23,15 @@
|
||||
#include <ignore-value.h>
|
||||
#include <minmax.h>
|
||||
#include <progname.h>
|
||||
#include <stat-macros.h>
|
||||
#include <xalloc.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <selinux/context.h>
|
||||
#include <selinux/selinux.h>
|
||||
#include <stdckdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* The number of extra bytes that must be allocated/usable, beyond
|
||||
|
||||
@@ -44,6 +44,7 @@ DISTCLEANFILES += sed/version.c
|
||||
sed/version.c: Makefile
|
||||
$(AM_V_GEN)rm -f $@
|
||||
$(AM_V_at)printf '#include <config.h>\n' > $@t
|
||||
$(AM_V_at)printf '#include "version.h"\n' >> $@t
|
||||
$(AM_V_at)printf 'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t
|
||||
$(AM_V_at)chmod a-w $@t
|
||||
$(AM_V_at)mv $@t $@
|
||||
|
||||
+1
-3
@@ -18,10 +18,8 @@
|
||||
|
||||
#include <xalloc.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <dfa.h>
|
||||
#include <stdckdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
@@ -29,11 +29,8 @@
|
||||
#include <limits.h>
|
||||
#include <locale.h>
|
||||
#include <selinux/selinux.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define AUTHORS \
|
||||
_("Jay Fenlason"), \
|
||||
|
||||
@@ -18,14 +18,11 @@
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
#include <dfa.h>
|
||||
#include <localeinfo.h>
|
||||
#include <mcel.h>
|
||||
#include <unlocked-io.h>
|
||||
|
||||
#include <regex.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <gettext.h>
|
||||
#define _(msgid) gettext (msgid)
|
||||
|
||||
@@ -24,17 +24,14 @@
|
||||
#include <minmax.h>
|
||||
#include <progname.h>
|
||||
#include <quotearg.h>
|
||||
#include <unlocked-io.h>
|
||||
#include <xalloc.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <gettext.h>
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
|
||||
#include <idx.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unlocked-io.h>
|
||||
|
||||
enum exit_codes {
|
||||
/* EXIT_SUCCESS is already defined as 0 */
|
||||
|
||||
Reference in new issue
Block a user