Re: mg(1): refactor sysdef.h?

2015-03-15 Thread Brian Callahan

On 03/15/15 21:01, Kamil Rytarowski wrote:
> Brian Callahan wrote:
>> 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?
>>
> Thank you, this is another approach. OK from me!

No no. When I say "OK?" I'm asking another developer to look at it and
say whether or not I can commit it.

Anyhow I've talked to Theo about this and I will be bringing mg in line
with the rest of how OpenBSD handles includes.

~Brian



Re: mg(1): refactor sysdef.h?

2015-03-15 Thread Kamil Rytarowski
Brian Callahan wrote:
> 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?
> 

Thank you, this is another approach. OK from me!



Re: mg(1): refactor sysdef.h?

2015-03-15 Thread Brian Callahan

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.c30 Dec 2014 22:05:32 -1.69
+++ dired.c15 Mar 2015 23:44:45 -
@@ -10,7 +10,6 @@
 #include "funmap.h"
 #include "kbd.h"
 
-#include 
 #include 
 #include 
 #include 
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.c6 Dec 2014 23:20:17 -1.58
+++ extend.c15 Mar 2015 23:44:45 -
@@ -10,7 +10,6 @@
 #include "kbd.h"
 #include "funmap.h"
 
-#include 
 #include 
 #include 
 
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.c16 Nov 2014 04:16:41 -1.98
+++ fileio.c15 Mar 2015 23:44:45 -
@@ -7,7 +7,6 @@
  */
 #include "def.h"
 
-#include 
 #include 
 #include 
 #include 
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.c16 Nov 2014 04:16:41 -1.42
+++ grep.c15 Mar 2015 23:44:45 -
@@ -6,11 +6,9 @@
 #include "kbd.h"
 #include "funmap.h"
 
-#include 
 #include 
 #include 
 #include 
-#include 
 
 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.c16 Nov 2014 04:16:41 -1.54
+++ line.c15 Mar 2015 23:44:45 -
@@ -20,8 +20,6 @@
 #include "def.h"
 
 #include 
-#include 
-#include 
 
 /*
  * 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.c20 Mar 2014 07:47:29 -1.30
+++ re_search.c15 Mar 2015 23:44:45 -
@@ -16,7 +16,6 @@
 #ifdef REGEX
 #include "def.h"
 
-#include 
 #include 
 
 #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.c20 Mar 2014 07:47:29 -1.34
+++ region.c15 Mar 2015 23:44:45 -
@@ -9,12 +9,10 @@
  * internal use.
  */
 
-#include 
 #include 
 
 #include 
 #include 
-#include 
 #include 
 
 #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.c16 Nov 2014 00:59:25 -1.10
+++ tags.c15 Mar 2015 23:44:45 -
@@ -6,16 +6,11 @@
  * Author: Sunil Nimmagadda 
  */
 
-#include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include 
 
 #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.c16 Nov 2014 00:50:00 -1.32
+++ tty.c15 Mar 2015 23:44:45 -
@@ -29,7 +29,6 @@
 
 #include "def.h"
 
-#include 
 #include 
 #include 
 
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.c20 Mar 2014 07:47:29 -1.35
+++ ttyio.c15 Mar 2015 23:44:45 -
@@ -11,7 +11,6 @@
  */
 #include "def.h"
 
-#include 
 #include 
 #include 
 #include 
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.c20 Mar 2014 07:47:29 -1.11
+++ yank.c15 Mar 2015 23:44:45 -
@@ -8,8 +8,6 @@
 
 #include "def.h"
 
-#include 
-
 #ifndef KBLOCK
 #define KBLOCK256/* Kill buffer block size. */
 #endif



mg(1): refactor sysdef.h?

2015-03-15 Thread Kamil Rytarowski
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.