diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-07-10 07:26:25 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-07-10 07:26:25 +0000 |
commit | 81fbdc5dca4ba4f9673c612f03fede15c8ad3f91 (patch) | |
tree | bb4eddffc1438ca1405dde0867782c5b37066a26 /games/tetris | |
parent | 123f3b7651527e3cd41a6956ecd641c00442b6c7 (diff) |
more ansi; khalek@linuxgamers.net
Diffstat (limited to 'games/tetris')
-rw-r--r-- | games/tetris/input.c | 9 | ||||
-rw-r--r-- | games/tetris/scores.c | 26 | ||||
-rw-r--r-- | games/tetris/screen.c | 28 | ||||
-rw-r--r-- | games/tetris/shapes.c | 10 | ||||
-rw-r--r-- | games/tetris/tetris.c | 17 |
5 files changed, 33 insertions, 57 deletions
diff --git a/games/tetris/input.c b/games/tetris/input.c index 6fef4732e4a..2bdd0686d46 100644 --- a/games/tetris/input.c +++ b/games/tetris/input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input.c,v 1.10 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: input.c,v 1.11 2004/07/10 07:26:24 deraadt Exp $ */ /* $NetBSD: input.c,v 1.3 1996/02/06 22:47:33 jtc Exp $ */ /*- @@ -73,8 +73,7 @@ * Return 0 => no input, 1 => can read() from stdin */ int -rwait(tvp) - struct timeval *tvp; +rwait(struct timeval *tvp) { struct timeval starttv, endtv, *s; fd_set fds; @@ -124,7 +123,7 @@ again: * Eat any input that might be available. */ void -tsleep() +tsleep(void) { struct timeval tv; char c; @@ -140,7 +139,7 @@ tsleep() * getchar with timeout. */ int -tgetchar() +tgetchar(void) { static struct timeval timeleft; char c; diff --git a/games/tetris/scores.c b/games/tetris/scores.c index ac7c16f011e..3442e2cda53 100644 --- a/games/tetris/scores.c +++ b/games/tetris/scores.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scores.c,v 1.9 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: scores.c,v 1.10 2004/07/10 07:26:24 deraadt Exp $ */ /* $NetBSD: scores.c,v 1.2 1995/04/22 07:42:38 cgd Exp $ */ /*- @@ -93,8 +93,7 @@ static char *thisuser(void); * Note, we assume closing the stdio file releases the lock. */ static void -getscores(fpp) - FILE **fpp; +getscores(FILE **fpp) { int sd, mint, lck, mask, i; char *mstr, *human; @@ -150,8 +149,7 @@ getscores(fpp) } void -savescore(level) - int level; +savescore(int level) { struct highscore *sp; int i; @@ -217,7 +215,7 @@ savescore(level) * The result is always trimmed to fit in a score. */ static char * -thisuser() +thisuser(void) { const char *p; struct passwd *pw; @@ -244,8 +242,7 @@ thisuser() * listed first in the highscore file. */ static int -cmpscores(x, y) - const void *x, *y; +cmpscores(const void *x, const void *y) { const struct highscore *a, *b; long l; @@ -274,9 +271,7 @@ cmpscores(x, y) * Caveat: the highest score on each level is always kept. */ static int -checkscores(hs, num) - struct highscore *hs; - int num; +checkscores(struct highscore *hs, int num) { struct highscore *sp; int i, j, k, numnames; @@ -348,8 +343,7 @@ checkscores(hs, num) * before it can be shown anyway. */ void -showscores(level) - int level; +showscores(int level) { struct highscore *sp; int i, n, c; @@ -404,11 +398,7 @@ showscores(level) } static void -printem(level, offset, hs, n, me) - int level, offset; - struct highscore *hs; - int n; - const char *me; +printem(int level, int offset, struct highscore *hs, int n, const char *me) { struct highscore *sp; int row, highlight, i; diff --git a/games/tetris/screen.c b/games/tetris/screen.c index 6c1b882ffc5..dc647fb00d1 100644 --- a/games/tetris/screen.c +++ b/games/tetris/screen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screen.c,v 1.11 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: screen.c,v 1.12 2004/07/10 07:26:24 deraadt Exp $ */ /* $NetBSD: screen.c,v 1.4 1995/04/29 01:11:36 mycroft Exp $ */ /*- @@ -120,8 +120,7 @@ static char combuf[1024], tbuf[1024]; * Routine used by tputs(). */ int -put(c) - int c; +put(int c) { return (putchar(c)); @@ -139,7 +138,7 @@ put(c) * Set up from termcap. */ void -scr_init() +scr_init(void) { static int bsflag, xsflag, sgnum; #ifdef unneeded @@ -208,8 +207,7 @@ scr_init() static jmp_buf scr_onstop; static void -stopset(sig) - int sig; +stopset(int sig) { sigset_t sigset; @@ -222,8 +220,7 @@ stopset(sig) } static void -scr_stop(sig) - int sig; +scr_stop(int sig) { sigset_t sigset; @@ -240,7 +237,7 @@ scr_stop(sig) * Set up screen mode. */ void -scr_set() +scr_set(void) { struct winsize ws; struct termios newtt; @@ -308,7 +305,7 @@ scr_set() * End screen mode. */ void -scr_end() +scr_end(void) { sigset_t sigset, osigset; @@ -333,8 +330,7 @@ scr_end() } void -stop(why) - char *why; +stop(char *why) { if (isset) @@ -346,7 +342,7 @@ stop(why) * Clear the screen, forgetting the current contents in the process. */ void -scr_clear() +scr_clear(void) { putpad(CLstr); @@ -364,7 +360,7 @@ typedef cell regcell; * Update the screen. */ void -scr_update() +scr_update(void) { cell *bp, *sp; regcell so, cur_so = 0; @@ -478,9 +474,7 @@ scr_update() * (We need its length in case we have to overwrite with blanks.) */ void -scr_msg(s, set) - char *s; - int set; +scr_msg(char *s, int set) { if (set || CEstr == NULL) { diff --git a/games/tetris/shapes.c b/games/tetris/shapes.c index fe59deed073..05ea602f06b 100644 --- a/games/tetris/shapes.c +++ b/games/tetris/shapes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shapes.c,v 1.7 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: shapes.c,v 1.8 2004/07/10 07:26:24 deraadt Exp $ */ /* $NetBSD: shapes.c,v 1.2 1995/04/22 07:42:44 cgd Exp $ */ /*- @@ -80,9 +80,7 @@ const struct shape shapes[] = { * taking the current board into account. */ int -fits_in(shape, pos) - const struct shape *shape; - int pos; +fits_in(const struct shape *shape, int pos) { int *o = shape->off; @@ -97,9 +95,7 @@ fits_in(shape, pos) * if `onoff' is 1, and off if `onoff' is 0. */ void -place(shape, pos, onoff) - const struct shape *shape; - int pos, onoff; +place(const struct shape *shape, int pos, int onoff) { int *o = shape->off; diff --git a/games/tetris/tetris.c b/games/tetris/tetris.c index 778a5f3e72b..65db7ddf0f6 100644 --- a/games/tetris/tetris.c +++ b/games/tetris/tetris.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tetris.c,v 1.19 2004/01/10 01:23:20 tedu Exp $ */ +/* $OpenBSD: tetris.c,v 1.20 2004/07/10 07:26:24 deraadt Exp $ */ /* $NetBSD: tetris.c,v 1.2 1995/04/22 07:42:47 cgd Exp $ */ /*- @@ -83,7 +83,7 @@ void usage(void); * right edges are set. */ static void -setup_board() +setup_board(void) { int i; cell *p; @@ -97,7 +97,7 @@ setup_board() * Elide any full active rows. */ static void -elide() +elide(void) { int rows = 0; int i, j, base; @@ -140,7 +140,7 @@ elide() } const struct shape * -randshape() +randshape(void) { const struct shape *tmp; int i, j; @@ -154,9 +154,7 @@ randshape() int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int pos, c; char *keys; @@ -360,8 +358,7 @@ main(argc, argv) } void -onintr(signo) - int signo; +onintr(int signo) { scr_clear(); /* XXX signal race */ scr_end(); /* XXX signal race */ @@ -369,7 +366,7 @@ onintr(signo) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: tetris [-ps] [-k keys] [-l level]\n"); exit(1); |