summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-07-26 21:33:29 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-07-26 21:33:29 +0000
commit593989ca06e239c26d8b2fe773d4e69a53195c5b (patch)
tree2934d8465183f22231a3bd188c58b087178c9db5
parent43770fd2c09d8d82eaad23392e0ecf01beec04da (diff)
give it some healthy dosage of vitamin const
-rw-r--r--games/tetris/screen.c6
-rw-r--r--games/tetris/shapes.c8
-rw-r--r--games/tetris/tetris.c16
-rw-r--r--games/tetris/tetris.h12
4 files changed, 21 insertions, 21 deletions
diff --git a/games/tetris/screen.c b/games/tetris/screen.c
index d345dbe4a49..47864a69263 100644
--- a/games/tetris/screen.c
+++ b/games/tetris/screen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen.c,v 1.9 2002/07/26 20:19:22 mickey Exp $ */
+/* $OpenBSD: screen.c,v 1.10 2002/07/26 21:33:28 mickey Exp $ */
/* $NetBSD: screen.c,v 1.4 1995/04/29 01:11:36 mycroft Exp $ */
/*-
@@ -94,7 +94,7 @@ static int
MSflag; /* can move in standout mode */
-struct tcsinfo { /* termcap string info; some abbrevs above */
+struct tcsinfo { /* termcap string info; some abbrevs above */
char tcname[3];
char **tcaddr;
} tcstrings[] = {
@@ -374,7 +374,7 @@ scr_update()
regcell so, cur_so = 0;
int i, ccol, j;
sigset_t sigset, osigset;
- static struct shape *lastshape;
+ static const struct shape *lastshape;
sigemptyset(&sigset);
sigaddset(&sigset, SIGTSTP);
diff --git a/games/tetris/shapes.c b/games/tetris/shapes.c
index 3158f37566b..b168f4571f4 100644
--- a/games/tetris/shapes.c
+++ b/games/tetris/shapes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: shapes.c,v 1.5 2002/07/26 20:19:22 mickey Exp $ */
+/* $OpenBSD: shapes.c,v 1.6 2002/07/26 21:33:28 mickey Exp $ */
/* $NetBSD: shapes.c,v 1.2 1995/04/22 07:42:44 cgd Exp $ */
/*-
@@ -57,7 +57,7 @@
#define BC B_COLS /* bottom center */
#define BR B_COLS+1 /* bottom right */
-struct shape shapes[] = {
+const struct shape shapes[] = {
/* 0*/ { 7, 7, { TL, TC, MR } },
/* 1*/ { 8, 8, { TC, TR, ML } },
/* 2*/ { 9, 11, { ML, MR, BC } },
@@ -85,7 +85,7 @@ struct shape shapes[] = {
*/
int
fits_in(shape, pos)
- struct shape *shape;
+ const struct shape *shape;
int pos;
{
int *o = shape->off;
@@ -102,7 +102,7 @@ fits_in(shape, pos)
*/
void
place(shape, pos, onoff)
- struct shape *shape;
+ const struct shape *shape;
int pos, onoff;
{
int *o = shape->off;
diff --git a/games/tetris/tetris.c b/games/tetris/tetris.c
index 356588ace83..1044b1e73a8 100644
--- a/games/tetris/tetris.c
+++ b/games/tetris/tetris.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tetris.c,v 1.13 2002/07/26 20:19:22 mickey Exp $ */
+/* $OpenBSD: tetris.c,v 1.14 2002/07/26 21:33:28 mickey Exp $ */
/* $NetBSD: tetris.c,v 1.2 1995/04/22 07:42:47 cgd Exp $ */
/*-
@@ -40,7 +40,7 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1992, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
@@ -67,8 +67,8 @@ static char copyright[] =
cell board[B_SIZE];
int Rows, Cols;
-struct shape *curshape;
-struct shape *nextshape;
+const struct shape *curshape;
+const struct shape *nextshape;
long fallrate;
int score;
gid_t gid, egid;
@@ -77,7 +77,7 @@ int showpreview, classic;
static void elide(void);
static void setup_board(void);
-struct shape *randshape(void);
+const struct shape *randshape(void);
void onintr(int);
void usage(void);
@@ -125,10 +125,10 @@ elide()
}
}
-struct shape *
+const struct shape *
randshape()
{
- struct shape *tmp;
+ const struct shape *tmp;
int i, j;
tmp = &shapes[random() % 7];
@@ -293,7 +293,7 @@ main(argc, argv)
}
if (c == keys[1]) {
/* turn */
- struct shape *new = &shapes[
+ const struct shape *new = &shapes[
classic? curshape->rotc : curshape->rot];
if (fits_in(new, pos))
diff --git a/games/tetris/tetris.h b/games/tetris/tetris.h
index 5502d289246..6106aaaf0d4 100644
--- a/games/tetris/tetris.h
+++ b/games/tetris/tetris.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tetris.h,v 1.7 2002/07/26 20:19:22 mickey Exp $ */
+/* $OpenBSD: tetris.h,v 1.8 2002/07/26 21:33:28 mickey Exp $ */
/* $NetBSD: tetris.h,v 1.2 1995/04/22 07:42:48 cgd Exp $ */
/*-
@@ -131,10 +131,10 @@ struct shape {
int off[3]; /* offsets to other blots if center is at (0,0) */
};
-extern struct shape shapes[];
+extern const struct shape shapes[];
-extern struct shape *curshape;
-extern struct shape *nextshape;
+extern const struct shape *curshape;
+extern const struct shape *nextshape;
/*
* Shapes fall at a rate faster than once per second.
@@ -177,6 +177,6 @@ extern char key_msg[100];
extern int showpreview;
extern int classic;
-int fits_in(struct shape *, int);
-void place(struct shape *, int, int);
+int fits_in(const struct shape *, int);
+void place(const struct shape *, int, int);
void stop(char *);