summaryrefslogtreecommitdiffstats
path: root/tetris
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1997-10-12 02:03:45 +0000
committerlukem <lukem@NetBSD.org>1997-10-12 02:03:45 +0000
commit97701376dead7753607380b36cc8c6ca5b06528e (patch)
treee55cddf6fa923df8cf644f78fa037193dff67276 /tetris
parent80379c039e586e212d931ae2ab9e91611c6ac5e9 (diff)
downloadbsdgames-darwin-97701376dead7753607380b36cc8c6ca5b06528e.tar.gz
bsdgames-darwin-97701376dead7753607380b36cc8c6ca5b06528e.tar.zst
bsdgames-darwin-97701376dead7753607380b36cc8c6ca5b06528e.zip
minor WARNSify
Diffstat (limited to 'tetris')
-rw-r--r--tetris/screen.c55
-rw-r--r--tetris/shapes.c40
-rw-r--r--tetris/tetris.c17
3 files changed, 59 insertions, 53 deletions
diff --git a/tetris/screen.c b/tetris/screen.c
index 99a9d3e7..9598227d 100644
--- a/tetris/screen.c
+++ b/tetris/screen.c
@@ -1,4 +1,4 @@
-/* $NetBSD: screen.c,v 1.4 1995/04/29 01:11:36 mycroft Exp $ */
+/* $NetBSD: screen.c,v 1.5 1997/10/12 02:03:45 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -71,9 +71,12 @@ static cell curscreen[B_SIZE]; /* 1 => standout (or otherwise marked) */
static int curscore;
static int isset; /* true => terminal is in game mode */
static struct termios oldtt;
-static void (*tstp)();
+static void (*tstp) __P((int));
-char *tgetstr(), *tgoto();
+static void scr_stop __P((int));
+static void stopset __P((int));
+extern char *tgetstr __P((char *, char **));
+extern char *tgoto __P((char *, int, int));
/*
@@ -108,21 +111,21 @@ struct tcsinfo { /* termcap string info; some abbrevs above */
char tcname[3];
char **tcaddr;
} tcstrings[] = {
- "bc", &bcstr,
- "ce", &CEstr,
- "cl", &CLstr,
- "cm", &CMstr,
+ {"bc", &bcstr},
+ {"ce", &CEstr},
+ {"cl", &CLstr},
+ {"cm", &CMstr},
#ifdef unneeded
- "cr", &CRstr,
+ {"cr", &CRstr},
#endif
- "le", &BC, /* move cursor left one space */
- "pc", &pcstr,
- "se", &SEstr,
- "so", &SOstr,
- "te", &TEstr,
- "ti", &TIstr,
- "up", &UP, /* cursor up */
- 0
+ {"le", &BC}, /* move cursor left one space */
+ {"pc", &pcstr},
+ {"se", &SEstr},
+ {"so", &SOstr},
+ {"te", &TEstr},
+ {"ti", &TIstr},
+ {"up", &UP}, /* cursor up */
+ { {0}, NULL}
};
/* This is where we will actually stuff the information */
@@ -164,18 +167,18 @@ scr_init()
char tcname[3];
int *tcaddr;
} tcflags[] = {
- "bs", &bsflag,
- "ms", &MSflag,
+ {"bs", &bsflag},
+ {"ms", &MSflag},
#ifdef unneeded
- "nc", &ncflag,
+ {"nc", &ncflag},
#endif
- "xs", &xsflag,
- 0
+ {"xs", &xsflag},
+ { {0}, NULL}
}, tcnums[] = {
- "co", &COnum,
- "li", &LInum,
- "sg", &sgnum,
- 0
+ {"co", &COnum},
+ {"li", &LInum},
+ {"sg", &sgnum},
+ { {0}, NULL}
};
if ((term = getenv("TERM")) == NULL)
@@ -257,7 +260,7 @@ scr_set()
struct winsize ws;
struct termios newtt;
sigset_t sigset, osigset;
- void (*ttou)();
+ void (*ttou) __P((int));
sigemptyset(&sigset);
sigaddset(&sigset, SIGTSTP);
diff --git a/tetris/shapes.c b/tetris/shapes.c
index 5421bcf0..86309e24 100644
--- a/tetris/shapes.c
+++ b/tetris/shapes.c
@@ -1,4 +1,4 @@
-/* $NetBSD: shapes.c,v 1.2 1995/04/22 07:42:44 cgd Exp $ */
+/* $NetBSD: shapes.c,v 1.3 1997/10/12 02:03:47 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -57,25 +57,25 @@
#define BR B_COLS+1 /* bottom right */
struct shape shapes[] = {
- /* 0*/ 7, TL, TC, MR,
- /* 1*/ 8, TC, TR, ML,
- /* 2*/ 9, ML, MR, BC,
- /* 3*/ 3, TL, TC, ML,
- /* 4*/ 12, ML, BL, MR,
- /* 5*/ 15, ML, BR, MR,
- /* 6*/ 18, ML, MR, /* sticks out */ 2,
- /* 7*/ 0, TC, ML, BL,
- /* 8*/ 1, TC, MR, BR,
- /* 9*/ 10, TC, MR, BC,
- /*10*/ 11, TC, ML, MR,
- /*11*/ 2, TC, ML, BC,
- /*12*/ 13, TC, BC, BR,
- /*13*/ 14, TR, ML, MR,
- /*14*/ 4, TL, TC, BC,
- /*15*/ 16, TR, TC, BC,
- /*16*/ 17, TL, MR, ML,
- /*17*/ 5, TC, BC, BL,
- /*18*/ 6, TC, BC, /* sticks out */ 2*B_COLS,
+ /* 0*/ { 7, { TL, TC, MR, } },
+ /* 1*/ { 8, { TC, TR, ML, } },
+ /* 2*/ { 9, { ML, MR, BC, } },
+ /* 3*/ { 3, { TL, TC, ML, } },
+ /* 4*/ { 12, { ML, BL, MR, } },
+ /* 5*/ { 15, { ML, BR, MR, } },
+ /* 6*/ { 18, { ML, MR, 2 } }, /* sticks out */
+ /* 7*/ { 0, { TC, ML, BL, } },
+ /* 8*/ { 1, { TC, MR, BR, } },
+ /* 9*/ { 10, { TC, MR, BC, } },
+ /*10*/ { 11, { TC, ML, MR, } },
+ /*11*/ { 2, { TC, ML, BC, } },
+ /*12*/ { 13, { TC, BC, BR, } },
+ /*13*/ { 14, { TR, ML, MR, } },
+ /*14*/ { 4, { TL, TC, BC, } },
+ /*15*/ { 16, { TR, TC, BC, } },
+ /*16*/ { 17, { TL, MR, ML, } },
+ /*17*/ { 5, { TC, BC, BL, } },
+ /*18*/ { 6, { TC, BC, 2*B_COLS } } /* sticks out */
};
/*
diff --git a/tetris/tetris.c b/tetris/tetris.c
index ababeeda..63090dbe 100644
--- a/tetris/tetris.c
+++ b/tetris/tetris.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tetris.c,v 1.2 1995/04/22 07:42:47 cgd Exp $ */
+/* $NetBSD: tetris.c,v 1.3 1997/10/12 02:03:48 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -38,10 +38,10 @@
* @(#)tetris.c 8.1 (Berkeley) 5/31/93
*/
+#include <sys/cdefs.h>
#ifndef lint
-static char copyright[] =
-"@(#) Copyright (c) 1992, 1993\n\
- The Regents of the University of California. All rights reserved.\n";
+__COPYRIGHT("@(#) Copyright (c) 1992, 1993\n\
+ The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
/*
@@ -61,8 +61,11 @@ static char copyright[] =
#include "screen.h"
#include "tetris.h"
-void onintr __P((int));
-void usage __P((void));
+static void elide __P((void));
+static void setup_board __P((void));
+ int main __P((int, char **));
+ void onintr __P((int));
+ void usage __P((void));
/*
* Set up the initial board. The bottom display row is completely set,
@@ -126,7 +129,7 @@ main(argc, argv)
keys = "jkl pq";
- while ((ch = getopt(argc, argv, "k:l:s")) != EOF)
+ while ((ch = getopt(argc, argv, "k:l:s")) != -1)
switch(ch) {
case 'k':
if (strlen(keys = optarg) != 6)