Hi,
Story facts of the day (for myself included), about 13 years ago games section
had srandom(time()+getpid()) and was changed by srandomdev(). Of course in the
course of years they have been changed to arc4random or random, nevertheless
all their consumers kept #include <time.h> so remove it. As another fact,
random(6) was introduced to arcrandom way longer (18 years) and had #include
<dev/rndvar.h>, but now we can pull it up from stdlib.h, so remove that one as
well. Additionally while there I sorted the headers alphabetically.
Is it OK to put a final nail in the coffin for this? Bear in mind though that
there may be other headers that could go away as well, but I didn't want to
pollute the diff with anything else.
Index: adventure/init.c
===================================================================
RCS file: /cvs/src/games/adventure/init.c,v
retrieving revision 1.13
diff -u -p -u -r1.13 init.c
--- adventure/init.c 31 Dec 2014 15:45:57 -0000 1.13
+++ adventure/init.c 2 Jan 2016 20:10:08 -0000
@@ -41,11 +41,10 @@
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
-#include <time.h>
#include <unistd.h>
-#include "hdr.h"
#include "extern.h"
+#include "hdr.h"
int blklin = TRUE;
Index: adventure/wizard.c
===================================================================
RCS file: /cvs/src/games/adventure/wizard.c,v
retrieving revision 1.17
diff -u -p -u -r1.17 wizard.c
--- adventure/wizard.c 31 Dec 2014 15:45:57 -0000 1.17
+++ adventure/wizard.c 2 Jan 2016 20:10:08 -0000
@@ -39,11 +39,11 @@
#include <limits.h>
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
-#include <time.h>
-#include "hdr.h"
+#include <string.h>
+
#include "extern.h"
+#include "hdr.h"
#if 0
void
Index: arithmetic/arithmetic.c
===================================================================
RCS file: /cvs/src/games/arithmetic/arithmetic.c,v
retrieving revision 1.22
diff -u -p -u -r1.22 arithmetic.c
--- arithmetic/arithmetic.c 25 Dec 2015 20:59:09 -0000 1.22
+++ arithmetic/arithmetic.c 2 Jan 2016 20:10:08 -0000
@@ -67,7 +67,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include <unistd.h>
int getrandom(int, int, int);
Index: atc/extern.c
===================================================================
RCS file: /cvs/src/games/atc/extern.c,v
retrieving revision 1.7
diff -u -p -u -r1.7 extern.c
--- atc/extern.c 31 Dec 2015 16:50:29 -0000 1.7
+++ atc/extern.c 2 Jan 2016 20:10:08 -0000
@@ -44,7 +44,6 @@
#include <stdio.h>
#include <termios.h>
-#include <time.h>
#include "def.h"
#include "extern.h"
Index: backgammon/backgammon/main.c
===================================================================
RCS file: /cvs/src/games/backgammon/backgammon/main.c,v
retrieving revision 1.22
diff -u -p -u -r1.22 main.c
--- backgammon/backgammon/main.c 2 Dec 2015 20:05:01 -0000 1.22
+++ backgammon/backgammon/main.c 2 Jan 2016 20:10:08 -0000
@@ -30,7 +30,7 @@
*/
#include <err.h>
-#include <time.h>
+
#include "back.h"
#include "backlocal.h"
Index: boggle/boggle/bog.c
===================================================================
RCS file: /cvs/src/games/boggle/boggle/bog.c,v
retrieving revision 1.26
diff -u -p -u -r1.26 bog.c
--- boggle/boggle/bog.c 30 Nov 2015 08:27:46 -0000 1.26
+++ boggle/boggle/bog.c 2 Jan 2016 20:10:08 -0000
@@ -39,7 +39,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include <unistd.h>
#include "bog.h"
Index: boggle/boggle/mach.c
===================================================================
RCS file: /cvs/src/games/boggle/boggle/mach.c,v
retrieving revision 1.17
diff -u -p -u -r1.17 mach.c
--- boggle/boggle/mach.c 27 Dec 2015 01:28:02 -0000 1.17
+++ boggle/boggle/mach.c 2 Jan 2016 20:10:08 -0000
@@ -49,7 +49,6 @@
#include <stdlib.h>
#include <string.h>
#include <termios.h>
-#include <time.h>
#include "bog.h"
#include "extern.h"
Index: bs/bs.c
===================================================================
RCS file: /cvs/src/games/bs/bs.c,v
retrieving revision 1.34
diff -u -p -u -r1.34 bs.c
--- bs/bs.c 26 Dec 2015 00:26:39 -0000 1.34
+++ bs/bs.c 2 Jan 2016 20:10:08 -0000
@@ -47,7 +47,6 @@
#include <signal.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include <unistd.h>
typedef struct {
Index: canfield/canfield/canfield.c
===================================================================
RCS file: /cvs/src/games/canfield/canfield/canfield.c,v
retrieving revision 1.23
diff -u -p -u -r1.23 canfield.c
--- canfield/canfield/canfield.c 26 Dec 2015 00:26:39 -0000 1.23
+++ canfield/canfield/canfield.c 2 Jan 2016 20:10:09 -0000
@@ -45,15 +45,14 @@
#include <ctype.h>
#include <curses.h>
-#include <errno.h>
#include <err.h>
+#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
-#include <time.h>
#include <unistd.h>
#define decksize 52
Index: fish/fish.c
===================================================================
RCS file: /cvs/src/games/fish/fish.c,v
retrieving revision 1.19
diff -u -p -u -r1.19 fish.c
--- fish/fish.c 25 Dec 2015 20:59:09 -0000 1.19
+++ fish/fish.c 2 Jan 2016 20:10:09 -0000
@@ -35,6 +35,7 @@
#include <sys/types.h>
#include <sys/wait.h>
+
#include <err.h>
#include <fcntl.h>
#include <paths.h>
@@ -42,7 +43,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <time.h>
+
#include "pathnames.h"
#define RANKS 13
Index: fortune/strfile/strfile.c
===================================================================
RCS file: /cvs/src/games/fortune/strfile/strfile.c,v
retrieving revision 1.24
diff -u -p -u -r1.24 strfile.c
--- fortune/strfile/strfile.c 25 Dec 2015 20:59:09 -0000 1.24
+++ fortune/strfile/strfile.c 2 Jan 2016 20:10:09 -0000
@@ -39,8 +39,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include <unistd.h>
+
#include "strfile.h"
/*
Index: grdc/grdc.c
===================================================================
RCS file: /cvs/src/games/grdc/grdc.c,v
retrieving revision 1.22
diff -u -p -u -r1.22 grdc.c
--- grdc/grdc.c 25 Dec 2015 20:59:09 -0000 1.22
+++ grdc/grdc.c 2 Jan 2016 20:10:09 -0000
@@ -11,14 +11,14 @@
* 10-18-89 added signal handling
*/
-#include <sys/types.h>
#include <sys/ioctl.h>
+#include <sys/types.h>
+
#include <curses.h>
#include <limits.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
-#include <time.h>
#include <unistd.h>
#include <err.h>
Index: mille/save.c
===================================================================
RCS file: /cvs/src/games/mille/save.c,v
retrieving revision 1.9
diff -u -p -u -r1.9 save.c
--- mille/save.c 11 Nov 2015 01:12:10 -0000 1.9
+++ mille/save.c 2 Jan 2016 20:10:09 -0000
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
-#include <time.h>
#include "mille.h"
/*
Index: phantasia/include.h
===================================================================
RCS file: /cvs/src/games/phantasia/include.h,v
retrieving revision 1.5
diff -u -p -u -r1.5 include.h
--- phantasia/include.h 16 Nov 2014 04:49:48 -0000 1.5
+++ phantasia/include.h 2 Jan 2016 20:10:09 -0000
@@ -16,7 +16,6 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include <unistd.h>
#include "macros.h"
Index: quiz/quiz.c
===================================================================
RCS file: /cvs/src/games/quiz/quiz.c,v
retrieving revision 1.24
diff -u -p -u -r1.24 quiz.c
--- quiz/quiz.c 25 Dec 2015 20:59:09 -0000 1.24
+++ quiz/quiz.c 2 Jan 2016 20:10:09 -0000
@@ -35,16 +35,17 @@
*/
#include <sys/types.h>
+
+#include <ctype.h>
+#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
-#include <err.h>
-#include <time.h>
#include <unistd.h>
-#include "quiz.h"
+
#include "pathnames.h"
+#include "quiz.h"
static QE qlist;
static int catone, cattwo, tflag;
Index: random/random.c
===================================================================
RCS file: /cvs/src/games/random/random.c,v
retrieving revision 1.15
diff -u -p -u -r1.15 random.c
--- random/random.c 25 Dec 2015 20:59:09 -0000 1.15
+++ random/random.c 2 Jan 2016 20:10:09 -0000
@@ -35,13 +35,10 @@
#include <sys/types.h>
-#include <dev/rndvar.h>
-
#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
-#include <time.h>
#include <unistd.h>
#include <limits.h>
Index: snake/snake.c
===================================================================
RCS file: /cvs/src/games/snake/snake.c,v
retrieving revision 1.20
diff -u -p -u -r1.20 snake.c
--- snake/snake.c 2 Dec 2015 18:52:23 -0000 1.20
+++ snake/snake.c 2 Jan 2016 20:10:10 -0000
@@ -55,7 +55,6 @@
#include <stdlib.h>
#include <string.h>
#include <termios.h>
-#include <time.h>
#include <unistd.h>
#ifdef DEBUG
Index: tetris/scores.c
===================================================================
RCS file: /cvs/src/games/tetris/scores.c,v
retrieving revision 1.17
diff -u -p -u -r1.17 scores.c
--- tetris/scores.c 27 Dec 2015 01:24:27 -0000 1.17
+++ tetris/scores.c 2 Jan 2016 20:10:10 -0000
@@ -42,22 +42,21 @@
*
* Major whacks since then.
*/
-#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/types.h>
-#include <errno.h>
#include <err.h>
+#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include <term.h>
#include <unistd.h>
-#include "screen.h"
#include "scores.h"
+#include "screen.h"
#include "tetris.h"
/*
Index: worm/worm.c
===================================================================
RCS file: /cvs/src/games/worm/worm.c,v
retrieving revision 1.35
diff -u -p -u -r1.35 worm.c
--- worm/worm.c 26 Dec 2015 00:26:40 -0000 1.35
+++ worm/worm.c 2 Jan 2016 20:10:10 -0000
@@ -35,13 +35,13 @@
*/
#include <sys/types.h>
+
#include <ctype.h>
#include <curses.h>
#include <err.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include <unistd.h>
#include <poll.h>
Index: wump/wump.c
===================================================================
RCS file: /cvs/src/games/wump/wump.c,v
retrieving revision 1.28
diff -u -p -u -r1.28 wump.c
--- wump/wump.c 25 Dec 2015 20:59:09 -0000 1.28
+++ wump/wump.c 2 Jan 2016 20:10:10 -0000
@@ -41,14 +41,15 @@
#include <sys/types.h>
#include <sys/wait.h>
+
#include <err.h>
#include <fcntl.h>
#include <paths.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include <unistd.h>
+
#include "pathnames.h"
/* some defines to spec out what our wumpus cave should look like */