summaryrefslogtreecommitdiffstats
path: root/games/tetris
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2014-11-16 04:49:48 +0000
committerguenther <guenther@openbsd.org>2014-11-16 04:49:48 +0000
commit34278d36bdc7f846d8005fae83450c1c510268e0 (patch)
tree01c05c4d62e09e297dfcc54a3fdfbb034d6074d4 /games/tetris
parentStop using <sys/param.h>; replace MAXPATHLEN with PATH_MAX, stop using MAX(), (diff)
downloadwireguard-openbsd-34278d36bdc7f846d8005fae83450c1c510268e0.tar.xz
wireguard-openbsd-34278d36bdc7f846d8005fae83450c1c510268e0.zip
Eliminate pointless use of <sys/param.h>, <sys/file.h>, <sys/sockio.h>,
and <sys/ttydefaults.h> Replace MAXPATHLEN with PATH_MAX and MAXLOGNAME with LOGIN_NAME_MAX Pull in <limits.h> where needed Prefer sizeof(var) over MAXFOO or FOO_MAX ok deraadt@
Diffstat (limited to 'games/tetris')
-rw-r--r--games/tetris/scores.c9
-rw-r--r--games/tetris/scores.h10
-rw-r--r--games/tetris/tetris.c4
3 files changed, 12 insertions, 11 deletions
diff --git a/games/tetris/scores.c b/games/tetris/scores.c
index 5f52b02b706..6903d6221cb 100644
--- a/games/tetris/scores.c
+++ b/games/tetris/scores.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scores.c,v 1.11 2006/04/20 03:25:36 ray Exp $ */
+/* $OpenBSD: scores.c,v 1.12 2014/11/16 04:49:49 guenther Exp $ */
/* $NetBSD: scores.c,v 1.2 1995/04/22 07:42:38 cgd Exp $ */
/*-
@@ -42,9 +42,13 @@
*
* Major whacks since then.
*/
+#include <sys/types.h>
+#include <sys/stat.h>
+
#include <errno.h>
#include <err.h>
#include <fcntl.h>
+#include <limits.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
@@ -52,9 +56,6 @@
#include <time.h>
#include <term.h>
#include <unistd.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/types.h>
#include "pathnames.h"
#include "screen.h"
diff --git a/games/tetris/scores.h b/games/tetris/scores.h
index cd3f9d27b4b..6aaa0741a41 100644
--- a/games/tetris/scores.h
+++ b/games/tetris/scores.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scores.h,v 1.5 2003/06/03 03:01:41 millert Exp $ */
+/* $OpenBSD: scores.h,v 1.6 2014/11/16 04:49:49 guenther Exp $ */
/* $NetBSD: scores.h,v 1.2 1995/04/22 07:42:40 cgd Exp $ */
/*-
@@ -39,10 +39,10 @@
* Tetris scores.
*/
struct highscore {
- char hs_name[MAXLOGNAME]; /* login name */
- int hs_score; /* raw score */
- int hs_level; /* play level */
- time_t hs_time; /* time at game end */
+ char hs_name[LOGIN_NAME_MAX]; /* login name */
+ int hs_score; /* raw score */
+ int hs_level; /* play level */
+ time_t hs_time; /* time at game end */
};
#define MAXHISCORES 80
diff --git a/games/tetris/tetris.c b/games/tetris/tetris.c
index 7e7bc9f281a..eff466b7b5f 100644
--- a/games/tetris/tetris.c
+++ b/games/tetris/tetris.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tetris.c,v 1.24 2013/08/29 20:22:20 naddy Exp $ */
+/* $OpenBSD: tetris.c,v 1.25 2014/11/16 04:49:49 guenther Exp $ */
/* $NetBSD: tetris.c,v 1.2 1995/04/22 07:42:47 cgd Exp $ */
/*-
@@ -39,11 +39,11 @@
* Tetris (or however it is spelled).
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/types.h>
#include <err.h>
+#include <limits.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>