On 03/15/15 19:24, Kamil Rytarowski wrote:
> Hello, Currently sysdef.h includes C headers for little purpose, as
> the same headers are already pulled in appropriate .c files. In the
> result the headers listed in sysdef.h are pulled in twice. I propose
> to move the remaining content (literally 11 lines-of-code) to def.h or
> a better place. I think that back in time all system includes were
> pulled in from sysdef.h, today I see no need for it any more.

I'm not sure you've tried doing that. There's a warning to include those
files in order for a reason.

However, there are some files that have redundant includes. Below is a
diff to remove those.

OK?

~Brian

Index: dired.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/dired.c,v
retrieving revision 1.69
diff -u -p -r1.69 dired.c
--- dired.c    30 Dec 2014 22:05:32 -0000    1.69
+++ dired.c    15 Mar 2015 23:44:45 -0000
@@ -10,7 +10,6 @@
 #include "funmap.h"
 #include "kbd.h"
 
-#include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <sys/resource.h>
Index: extend.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/extend.c,v
retrieving revision 1.58
diff -u -p -r1.58 extend.c
--- extend.c    6 Dec 2014 23:20:17 -0000    1.58
+++ extend.c    15 Mar 2015 23:44:45 -0000
@@ -10,7 +10,6 @@
 #include "kbd.h"
 #include "funmap.h"
 
-#include <sys/types.h>
 #include <ctype.h>
 #include <limits.h>
 
Index: fileio.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/fileio.c,v
retrieving revision 1.98
diff -u -p -r1.98 fileio.c
--- fileio.c    16 Nov 2014 04:16:41 -0000    1.98
+++ fileio.c    15 Mar 2015 23:44:45 -0000
@@ -7,7 +7,6 @@
  */
 #include "def.h"
 
-#include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <sys/resource.h>
Index: grep.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/grep.c,v
retrieving revision 1.42
diff -u -p -r1.42 grep.c
--- grep.c    16 Nov 2014 04:16:41 -0000    1.42
+++ grep.c    15 Mar 2015 23:44:45 -0000
@@ -6,11 +6,9 @@
 #include "kbd.h"
 #include "funmap.h"
 
-#include <sys/types.h>
 #include <ctype.h>
 #include <libgen.h>
 #include <limits.h>
-#include <time.h>
 
 int     globalwd = FALSE;
 static int     compile_goto_error(int, int);
Index: line.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/line.c,v
retrieving revision 1.54
diff -u -p -r1.54 line.c
--- line.c    16 Nov 2014 04:16:41 -0000    1.54
+++ line.c    15 Mar 2015 23:44:45 -0000
@@ -20,8 +20,6 @@
 #include "def.h"
 
 #include <limits.h>
-#include <stdlib.h>
-#include <string.h>
 
 /*
  * Allocate a new line of size `used'.  lrealloc() can be called if the
line
Index: re_search.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/re_search.c,v
retrieving revision 1.30
diff -u -p -r1.30 re_search.c
--- re_search.c    20 Mar 2014 07:47:29 -0000    1.30
+++ re_search.c    15 Mar 2015 23:44:45 -0000
@@ -16,7 +16,6 @@
 #ifdef REGEX
 #include "def.h"
 
-#include <sys/types.h>
 #include <regex.h>
 
 #include "macro.h"
Index: region.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/region.c,v
retrieving revision 1.34
diff -u -p -r1.34 region.c
--- region.c    20 Mar 2014 07:47:29 -0000    1.34
+++ region.c    15 Mar 2015 23:44:45 -0000
@@ -9,12 +9,10 @@
  * internal use.
  */
 
-#include <sys/types.h>
 #include <sys/socket.h>
 
 #include <fcntl.h>
 #include <poll.h>
-#include <string.h>
 #include <unistd.h>
 
 #include "def.h"
Index: tags.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/tags.c,v
retrieving revision 1.10
diff -u -p -r1.10 tags.c
--- tags.c    16 Nov 2014 00:59:25 -0000    1.10
+++ tags.c    15 Mar 2015 23:44:45 -0000
@@ -6,16 +6,11 @@
  * Author: Sunil Nimmagadda <[email protected]>
  */
 
-#include <sys/queue.h>
 #include <sys/stat.h>
 #include <sys/tree.h>
-#include <sys/types.h>
 
 #include <ctype.h>
 #include <err.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
 #include <util.h>
 
 #include "def.h"
Index: tty.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/tty.c,v
retrieving revision 1.32
diff -u -p -r1.32 tty.c
--- tty.c    16 Nov 2014 00:50:00 -0000    1.32
+++ tty.c    15 Mar 2015 23:44:45 -0000
@@ -29,7 +29,6 @@
 
 #include "def.h"
 
-#include <sys/types.h>
 #include <sys/time.h>
 #include <sys/ioctl.h>
 
Index: ttyio.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/ttyio.c,v
retrieving revision 1.35
diff -u -p -r1.35 ttyio.c
--- ttyio.c    20 Mar 2014 07:47:29 -0000    1.35
+++ ttyio.c    15 Mar 2015 23:44:45 -0000
@@ -11,7 +11,6 @@
  */
 #include "def.h"
 
-#include <sys/types.h>
 #include <sys/time.h>
 #include <sys/ioctl.h>
 #include <fcntl.h>
Index: yank.c
===================================================================
RCS file: /cvs/src/usr.bin/mg/yank.c,v
retrieving revision 1.11
diff -u -p -r1.11 yank.c
--- yank.c    20 Mar 2014 07:47:29 -0000    1.11
+++ yank.c    15 Mar 2015 23:44:45 -0000
@@ -8,8 +8,6 @@
 
 #include "def.h"
 
-#include <string.h>
-
 #ifndef KBLOCK
 #define KBLOCK    256        /* Kill buffer block size.     */
 #endif

Reply via email to