Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/gomoku gomoku: clean up unused code and lint warnings



details:   https://anonhg.NetBSD.org/src/rev/71eb09aaaeda
branches:  trunk
changeset: 366104:71eb09aaaeda
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat May 14 16:21:04 2022 +0000

description:
gomoku: clean up unused code and lint warnings

No binary change.

diffstat:

 games/gomoku/bdisp.c    |  9 +++------
 games/gomoku/gomoku.h   |  4 +---
 games/gomoku/pickmove.c |  9 ++++-----
 3 files changed, 8 insertions(+), 14 deletions(-)

diffs (99 lines):

diff -r fc0f4e18e8cd -r 71eb09aaaeda games/gomoku/bdisp.c
--- a/games/gomoku/bdisp.c      Sat May 14 15:29:08 2022 +0000
+++ b/games/gomoku/bdisp.c      Sat May 14 16:21:04 2022 +0000
@@ -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 @@
 {
        int ch;
 
-       while (1) {
+       for (;;) {
                ch = getch();
                if (allowed != NULL &&
                    ch != '\0' && strchr(allowed, ch) == NULL) {
@@ -448,16 +448,13 @@
                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;
diff -r fc0f4e18e8cd -r 71eb09aaaeda games/gomoku/gomoku.h
--- a/games/gomoku/gomoku.h     Sat May 14 15:29:08 2022 +0000
+++ b/games/gomoku/gomoku.h     Sat May 14 16:21:04 2022 +0000
@@ -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 interactive;
 extern const char *plyr[];
 
-#define ASSERT(x)
-
 void   bdinit(struct spotstr *);
 int    get_coord(void);
 int    get_key(const char *allowedkeys);
diff -r fc0f4e18e8cd -r 71eb09aaaeda games/gomoku/pickmove.c
--- a/games/gomoku/pickmove.c   Sat May 14 15:29:08 2022 +0000
+++ b/games/gomoku/pickmove.c   Sat May 14 16:21:04 2022 +0000
@@ -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 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 @@
         */
        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];



Home | Main Index | Thread Index | Old Index