Module Name: src Committed By: rillig Date: Sat May 28 04:52:23 UTC 2022
Modified Files: src/games/gomoku: makemove.c Log Message: gomoku: reduce scope of local variable No functional change. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/games/gomoku/makemove.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/makemove.c diff -u src/games/gomoku/makemove.c:1.25 src/games/gomoku/makemove.c:1.26 --- src/games/gomoku/makemove.c:1.25 Fri May 27 23:29:15 2022 +++ src/games/gomoku/makemove.c Sat May 28 04:52:23 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: makemove.c,v 1.25 2022/05/27 23:29:15 rillig Exp $ */ +/* $NetBSD: makemove.c,v 1.26 2022/05/28 04:52:23 rillig Exp $ */ /* * Copyright (c) 1994 @@ -34,7 +34,7 @@ #include <sys/cdefs.h> /* @(#)makemove.c 8.2 (Berkeley) 5/3/95 */ -__RCSID("$NetBSD: makemove.c,v 1.25 2022/05/27 23:29:15 rillig Exp $"); +__RCSID("$NetBSD: makemove.c,v 1.26 2022/05/28 04:52:23 rillig Exp $"); #include "gomoku.h" @@ -217,7 +217,6 @@ static void update_overlap(struct spotstr *osp) { - struct spotstr *esp = NULL; for (int r = 4; --r >= 0; ) { /* for each direction */ int d = dd[r]; struct spotstr *sp1 = osp; @@ -251,12 +250,14 @@ update_overlap(struct spotstr *osp) */ int n = 0; struct spotstr *sp = sp1; + struct spotstr *esp = NULL; for (int b = i - f; b < 5; b++, sp += d) { if (sp->s_occ == EMPTY) { esp = sp; /* save the intersection point */ n++; } } + int b = (int)(sp2->s_frame[r] - frames); if (n == 0) { if (sp->s_occ == EMPTY) {