diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2014-11-16 04:49:50 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2014-11-16 04:49:50 +0000 |
commit | f2273a76226705a4e8f5e015d1835449da4e3242 (patch) | |
tree | 9aa8ab3b6fae60c8e2a7a05923b9b6f239d3f864 /games/tetris | |
parent | 3243c629699c25f7f4a576fe1c2f58e274eba8f7 (diff) |
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.c | 9 | ||||
-rw-r--r-- | games/tetris/scores.h | 10 | ||||
-rw-r--r-- | games/tetris/tetris.c | 4 |
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> |