summaryrefslogtreecommitdiffstats
path: root/tetris
diff options
context:
space:
mode:
Diffstat (limited to 'tetris')
-rw-r--r--tetris/input.c9
-rw-r--r--tetris/scores.c26
-rw-r--r--tetris/screen.c28
-rw-r--r--tetris/shapes.c10
-rw-r--r--tetris/tetris.c15
-rw-r--r--tetris/tetris.h4
6 files changed, 34 insertions, 58 deletions
diff --git a/tetris/input.c b/tetris/input.c
index cd4d431e..e5f8c12a 100644
--- a/tetris/input.c
+++ b/tetris/input.c
@@ -1,4 +1,4 @@
-/* $NetBSD: input.c,v 1.10 2006/03/19 00:50:28 christos Exp $ */
+/* $NetBSD: input.c,v 1.11 2009/05/25 04:33:53 dholland Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -72,8 +72,7 @@
* Return 0 => no input, 1 => can read() from stdin
*/
int
-rwait(tvp)
- struct timeval *tvp;
+rwait(struct timeval *tvp)
{
struct pollfd set[1];
struct timeval starttv, endtv;
@@ -120,7 +119,7 @@ again:
* Eat any input that might be available.
*/
void
-tsleep()
+tsleep(void)
{
struct timeval tv;
char c;
@@ -136,7 +135,7 @@ tsleep()
* getchar with timeout.
*/
int
-tgetchar()
+tgetchar(void)
{
static struct timeval timeleft;
char c;
diff --git a/tetris/scores.c b/tetris/scores.c
index d215261c..0ebd03cf 100644
--- a/tetris/scores.c
+++ b/tetris/scores.c
@@ -1,4 +1,4 @@
-/* $NetBSD: scores.c,v 1.14 2006/06/01 16:12:27 drochner Exp $ */
+/* $NetBSD: scores.c,v 1.15 2009/05/25 04:33:53 dholland Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -90,8 +90,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;
mode_t mask;
@@ -145,8 +144,7 @@ getscores(fpp)
}
void
-savescore(level)
- int level;
+savescore(int level)
{
struct highscore *sp;
int i;
@@ -212,7 +210,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;
@@ -349,8 +344,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 nrows, row, col, item, i, highlight;
diff --git a/tetris/screen.c b/tetris/screen.c
index ffb57bb4..edbcddf9 100644
--- a/tetris/screen.c
+++ b/tetris/screen.c
@@ -1,4 +1,4 @@
-/* $NetBSD: screen.c,v 1.22 2008/01/28 01:38:59 dholland Exp $ */
+/* $NetBSD: screen.c,v 1.23 2009/05/25 04:33:53 dholland Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -123,8 +123,7 @@ static struct tinfo *info;
* Routine used by tputs().
*/
int
-put(c)
- int c;
+put(int c)
{
return (putchar(c));
@@ -150,7 +149,7 @@ moveto(int r, int c)
* Set up from termcap.
*/
void
-scr_init()
+scr_init(void)
{
static int bsflag, xsflag, sgnum;
#ifdef unneeded
@@ -217,8 +216,7 @@ scr_init()
static jmp_buf scr_onstop;
static void
-stopset(sig)
- int sig;
+stopset(int sig)
{
sigset_t set;
@@ -231,8 +229,7 @@ stopset(sig)
}
static void
-scr_stop(sig)
- int sig;
+scr_stop(int sig)
{
sigset_t set;
@@ -249,7 +246,7 @@ scr_stop(sig)
* Set up screen mode.
*/
void
-scr_set()
+scr_set(void)
{
struct winsize ws;
struct termios newtt;
@@ -316,7 +313,7 @@ scr_set()
* End screen mode.
*/
void
-scr_end()
+scr_end(void)
{
sigset_t nsigset, osigset;
@@ -341,8 +338,7 @@ scr_end()
}
void
-stop(why)
- const char *why;
+stop(const char *why)
{
if (isset)
@@ -355,7 +351,7 @@ stop(why)
* Clear the screen, forgetting the current contents in the process.
*/
void
-scr_clear()
+scr_clear(void)
{
putpad(CLstr);
@@ -373,7 +369,7 @@ typedef cell regcell;
* Update the screen.
*/
void
-scr_update()
+scr_update(void)
{
cell *bp, *sp;
regcell so, cur_so = 0;
@@ -485,9 +481,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/tetris/shapes.c b/tetris/shapes.c
index 9fb3ae27..0ab43106 100644
--- a/tetris/shapes.c
+++ b/tetris/shapes.c
@@ -1,4 +1,4 @@
-/* $NetBSD: shapes.c,v 1.7 2006/10/22 08:09:24 mrg Exp $ */
+/* $NetBSD: shapes.c,v 1.8 2009/05/25 04:33:53 dholland Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -79,9 +79,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)
{
const int *o = shape->off;
@@ -96,9 +94,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)
{
const int *o = shape->off;
diff --git a/tetris/tetris.c b/tetris/tetris.c
index 930ce46b..69b2312f 100644
--- a/tetris/tetris.c
+++ b/tetris/tetris.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tetris.c,v 1.20 2009/05/25 00:46:01 dholland Exp $ */
+/* $NetBSD: tetris.c,v 1.21 2009/05/25 04:33:53 dholland Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -86,7 +86,7 @@ static void setup_board(void);
* right edges are set.
*/
static void
-setup_board()
+setup_board(void)
{
int i;
cell *p;
@@ -100,7 +100,7 @@ setup_board()
* Elide any full active rows.
*/
static void
-elide()
+elide(void)
{
int i, j, base;
cell *p;
@@ -125,9 +125,7 @@ elide()
}
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int pos, c;
const char *keys;
@@ -321,8 +319,7 @@ main(argc, argv)
}
void
-onintr(signo)
- int signo __unused;
+onintr(int signo __unused)
{
scr_clear();
scr_end();
@@ -330,7 +327,7 @@ onintr(signo)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: tetris [-ps] [-k keys] [-l level]\n");
exit(1);
diff --git a/tetris/tetris.h b/tetris/tetris.h
index 6b3664ba..35a70a3c 100644
--- a/tetris/tetris.h
+++ b/tetris/tetris.h
@@ -1,4 +1,4 @@
-/* $NetBSD: tetris.h,v 1.10 2004/01/27 20:30:30 jsm Exp $ */
+/* $NetBSD: tetris.h,v 1.11 2009/05/25 04:33:53 dholland Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -171,4 +171,4 @@ extern int showpreview;
int fits_in(const struct shape *, int);
void place(const struct shape *, int, int);
-void stop(const char *) __attribute__((__noreturn__));
+void stop(const char *) __dead;