-/* $NetBSD: shapes.c,v 1.3 1997/10/12 02:03:47 lukem Exp $ */
+/* $NetBSD: shapes.c,v 1.8 2009/05/25 04:33:53 dholland Exp $ */
/*-
* Copyright (c) 1992, 1993
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
#define BC B_COLS /* bottom center */
#define BR B_COLS+1 /* bottom right */
-struct shape shapes[] = {
+const struct shape shapes[] = {
/* 0*/ { 7, { TL, TC, MR, } },
/* 1*/ { 8, { TC, TR, ML, } },
/* 2*/ { 9, { ML, MR, BC, } },
* taking the current board into account.
*/
int
-fits_in(shape, pos)
- struct shape *shape;
- register int pos;
+fits_in(const struct shape *shape, int pos)
{
- register int *o = shape->off;
+ const int *o = shape->off;
if (board[pos] || board[pos + *o++] || board[pos + *o++] ||
board[pos + *o])
* if `onoff' is 1, and off if `onoff' is 0.
*/
void
-place(shape, pos, onoff)
- struct shape *shape;
- register int pos, onoff;
+place(const struct shape *shape, int pos, int onoff)
{
- register int *o = shape->off;
+ const int *o = shape->off;
board[pos] = onoff;
board[pos + *o++] = onoff;