Module Name:    src
Committed By:   rillig
Date:           Sat May 14 16:21:04 UTC 2022

Modified Files:
        src/games/gomoku: bdisp.c gomoku.h pickmove.c

Log Message:
gomoku: clean up unused code and lint warnings

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/games/gomoku/bdisp.c
cvs rdiff -u -r1.20 -r1.21 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.22 -r1.23 src/games/gomoku/pickmove.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/gomoku/bdisp.c
diff -u src/games/gomoku/bdisp.c:1.18 src/games/gomoku/bdisp.c:1.19
--- src/games/gomoku/bdisp.c:1.18	Sun May  2 12:50:44 2021
+++ src/games/gomoku/bdisp.c	Sat May 14 16:21:04 2022
@@ -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;

Index: src/games/gomoku/gomoku.h
diff -u src/games/gomoku/gomoku.h:1.20 src/games/gomoku/gomoku.h:1.21
--- src/games/gomoku/gomoku.h:1.20	Sat Mar 22 18:58:57 2014
+++ src/games/gomoku/gomoku.h	Sat May 14 16:21:04 2022
@@ -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);

Index: src/games/gomoku/pickmove.c
diff -u src/games/gomoku/pickmove.c:1.22 src/games/gomoku/pickmove.c:1.23
--- src/games/gomoku/pickmove.c:1.22	Sat Oct 19 17:23:08 2013
+++ src/games/gomoku/pickmove.c	Sat May 14 16:21:04 2022
@@ -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]
 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];

Reply via email to