gomoku: clean up unused code and lint warnings

No binary change.
This commit is contained in:
rillig 2022-05-14 16:21:04 +00:00
parent 6a3fc5908f
commit 8e531acc76
3 changed files with 8 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bdisp.c,v 1.18 2021/05/02 12:50:44 rillig Exp $ */
/* $NetBSD: bdisp.c,v 1.19 2022/05/14 16:21:04 rillig Exp $ */
/*
* Copyright (c) 1994
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)bdisp.c 8.2 (Berkeley) 5/3/95";
#else
__RCSID("$NetBSD: bdisp.c,v 1.18 2021/05/02 12:50:44 rillig Exp $");
__RCSID("$NetBSD: bdisp.c,v 1.19 2022/05/14 16:21:04 rillig Exp $");
#endif
#endif /* not lint */
@ -262,7 +262,7 @@ get_key(const char *allowed)
{
int ch;
while (1) {
for (;;) {
ch = getch();
if (allowed != NULL &&
ch != '\0' && strchr(allowed, ch) == NULL) {
@ -448,16 +448,13 @@ get_coord(void)
case 'Q':
case 'q':
return RESIGN;
break;
case 'S':
case 's':
return SAVE;
break;
case ' ':
case '\r':
(void) mvaddstr(BSZ3, (BSZ -6)/2, " ");
return PT(curx+1,cury+1);
break;
}
curx = nx % BSZ;

View File

@ -1,4 +1,4 @@
/* $NetBSD: gomoku.h,v 1.20 2014/03/22 18:58:57 dholland Exp $ */
/* $NetBSD: gomoku.h,v 1.21 2022/05/14 16:21:04 rillig Exp $ */
/*
* Copyright (c) 1994
@ -268,8 +268,6 @@ extern int debug;
extern int interactive;
extern const char *plyr[];
#define ASSERT(x)
void bdinit(struct spotstr *);
int get_coord(void);
int get_key(const char *allowedkeys);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pickmove.c,v 1.22 2013/10/19 17:23:08 christos Exp $ */
/* $NetBSD: pickmove.c,v 1.23 2022/05/14 16:21:04 rillig Exp $ */
/*
* Copyright (c) 1994
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)pickmove.c 8.2 (Berkeley) 5/3/95";
#else
__RCSID("$NetBSD: pickmove.c,v 1.22 2013/10/19 17:23:08 christos Exp $");
__RCSID("$NetBSD: pickmove.c,v 1.23 2022/05/14 16:21:04 rillig Exp $");
#endif
#endif /* not lint */
@ -806,7 +806,7 @@ static struct combostr *ecombo[MAXDEPTH]; /* separate from elist to save space *
static void
makeempty(struct combostr *ocbp)
{
struct combostr *cbp, *tcbp, **cbpp;
struct combostr *cbp, **cbpp;
struct elist *ep, *nep;
struct spotstr *sp;
int s, d, m, emask, i;
@ -835,8 +835,7 @@ makeempty(struct combostr *ocbp)
*/
ep = &einfo[nframes];
cbpp = &ecombo[nframes];
for (cbp = ocbp; (tcbp = cbp->c_link[1]) != NULL;
cbp = cbp->c_link[0]) {
for (cbp = ocbp; cbp->c_link[1] != NULL; cbp = cbp->c_link[0]) {
ep--;
ep->e_combo = cbp;
*--cbpp = cbp->c_link[1];