Module Name:    src
Committed By:   rillig
Date:           Wed May 18 22:30:19 UTC 2022

Modified Files:
        src/games/gomoku: bdinit.c bdisp.c makemove.c pickmove.c stoc.c

Log Message:
gomoku: reduce scope of 'for' loop variables

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/games/gomoku/bdinit.c
cvs rdiff -u -r1.27 -r1.28 src/games/gomoku/bdisp.c
cvs rdiff -u -r1.16 -r1.17 src/games/gomoku/makemove.c \
    src/games/gomoku/stoc.c
cvs rdiff -u -r1.33 -r1.34 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/bdinit.c
diff -u src/games/gomoku/bdinit.c:1.14 src/games/gomoku/bdinit.c:1.15
--- src/games/gomoku/bdinit.c:1.14	Wed May 18 21:45:40 2022
+++ src/games/gomoku/bdinit.c	Wed May 18 22:30:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdinit.c,v 1.14 2022/05/18 21:45:40 rillig Exp $	*/
+/*	$NetBSD: bdinit.c,v 1.15 2022/05/18 22:30:19 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "from: @(#)bdinit.c	8.2 (Berkeley) 5/3/95";
 #else
-__RCSID("$NetBSD: bdinit.c,v 1.14 2022/05/18 21:45:40 rillig Exp $");
+__RCSID("$NetBSD: bdinit.c,v 1.15 2022/05/18 22:30:19 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -49,7 +49,6 @@ static void init_overlap(void);
 void
 bdinit(struct spotstr *bp)
 {
-	int i, j, r;
 	struct spotstr *sp;
 	struct combostr *cbp;
 
@@ -57,7 +56,7 @@ bdinit(struct spotstr *bp)
 
 	/* mark the borders as such */
 	sp = bp;
-	for (i = 1 + BSZ + 1; --i >= 0; sp++) {
+	for (int i = 1 + BSZ + 1; --i >= 0; sp++) {
 		sp->s_occ = BORDER;			/* top border */
 		sp->s_flags = BFLAGALL;
 	}
@@ -65,8 +64,8 @@ bdinit(struct spotstr *bp)
 	/* fill entire board with EMPTY spots */
 	memset(frames, 0, sizeof(frames));
 	cbp = frames;
-	for (j = 0; ++j < BSZ + 1; sp++) {		/* for each row */
-		for (i = 0; ++i < BSZ + 1; sp++) {	/* for each column */
+	for (int j = 0; ++j < BSZ + 1; sp++) {		/* for each row */
+		for (int i = 0; ++i < BSZ + 1; sp++) {	/* for each column */
 			sp->s_occ = EMPTY;
 			sp->s_flags = 0;
 			sp->s_wval = 0;
@@ -129,7 +128,7 @@ bdinit(struct spotstr *bp)
 			/*
 			 * Allocate a frame structure for non blocked frames.
 			 */
-			for (r = 4; --r >= 0; ) {
+			for (int r = 4; --r >= 0; ) {
 				if ((sp->s_flags & (BFLAG << r)) != 0)
 					continue;
 				cbp->c_combo.s = sp->s_fval[BLACK][r].s;
@@ -145,7 +144,7 @@ bdinit(struct spotstr *bp)
 	}
 
 	/* mark the borders as such */
-	for (i = BSZ + 1; --i >= 0; sp++) {
+	for (int i = BSZ + 1; --i >= 0; sp++) {
 		sp->s_occ = BORDER;			/* bottom border */
 		sp->s_flags = BFLAGALL;
 	}
@@ -177,8 +176,7 @@ init_overlap(void)
 {
 	struct spotstr *sp1, *sp2;
 	struct combostr *cbp;
-	unsigned frameix;
-	int i, f, r, n, d1, d2;
+	int n, d1, d2;
 	int mask, bmask, vertex, s;
 	u_char *op;
 	short *ip;
@@ -187,28 +185,28 @@ init_overlap(void)
 	memset(intersect, 0, sizeof(intersect));
 	op = &overlap[FAREA * FAREA];
 	ip = &intersect[FAREA * FAREA];
-	for (frameix = FAREA; frameix-- > 0; ) {	/* each frame */
-	    cbp = &frames[frameix];
+	for (unsigned fi = FAREA; fi-- > 0; ) {	/* each frame */
+	    cbp = &frames[fi];
 	    op -= FAREA;
 	    ip -= FAREA;
 	    sp1 = &board[vertex = cbp->c_vertex];
-	    d1 = dd[r = cbp->c_dir];
+	    d1 = dd[cbp->c_dir];
 	    /*
 	     * s = 5 if closed, 6 if open.
 	     * At this point black & white are the same.
 	     */
-	    s = 5 + sp1->s_fval[BLACK][r].c.b;
+	    s = 5 + sp1->s_fval[BLACK][cbp->c_dir].c.b;
 	    /* for each spot in frame A */
-	    for (i = 0; i < s; i++, sp1 += d1, vertex += d1) {
+	    for (int i = 0; i < s; i++, sp1 += d1, vertex += d1) {
 		/* the sixth spot in frame A only overlaps if it is open */
 		mask = (i == 5) ? 0xC : 0xF;
 		/* for each direction */
-		for (r = 4; --r >= 0; ) {
+		for (int r = 4; --r >= 0; ) {
 		    bmask = BFLAG << r;
 		    sp2 = sp1;
 		    d2 = dd[r];
 		    /* for each frame that intersects at spot sp1 */
-		    for (f = 0; f < 6; f++, sp2 -= d2) {
+		    for (int f = 0; f < 6; f++, sp2 -= d2) {
 			if (sp2->s_occ == BORDER)
 			    break;
 			if ((sp2->s_flags & bmask) != 0)

Index: src/games/gomoku/bdisp.c
diff -u src/games/gomoku/bdisp.c:1.27 src/games/gomoku/bdisp.c:1.28
--- src/games/gomoku/bdisp.c:1.27	Mon May 16 22:03:16 2022
+++ src/games/gomoku/bdisp.c	Wed May 18 22:30:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdisp.c,v 1.27 2022/05/16 22:03:16 rillig Exp $	*/
+/*	$NetBSD: bdisp.c,v 1.28 2022/05/18 22:30:19 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.27 2022/05/16 22:03:16 rillig Exp $");
+__RCSID("$NetBSD: bdisp.c,v 1.28 2022/05/18 22:30:19 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -98,22 +98,21 @@ cursfini(void)
 void
 bdisp_init(void)
 {
-	int i, j;
 
 	/* top border */
-	for (i = 1; i < BSZ + 1; i++) {
+	for (int i = 1; i < BSZ + 1; i++) {
 		move(0, 2 * i + 1);
 		addch(letters[i]);
 	}
 	/* left and right edges */
-	for (j = BSZ + 1; --j > 0; ) {
+	for (int j = BSZ + 1; --j > 0; ) {
 		move(20 - j, 0);
 		printw("%2d ", j);
 		move(20 - j, 2 * (BSZ + 1) + 1);
 		printw("%d ", j);
 	}
 	/* bottom border */
-	for (i = 1; i < BSZ + 1; i++) {
+	for (int i = 1; i < BSZ + 1; i++) {
 		move(20, 2 * i + 1);
 		addch(letters[i]);
 	}
@@ -162,11 +161,11 @@ bdwho(bool update)
 void
 bdisp(void)
 {
-	int i, j, c;
+	int c;
 	struct spotstr *sp;
 
-	for (j = BSZ + 1; --j > 0; ) {
-		for (i = 1; i < BSZ + 1; i++) {
+	for (int j = BSZ + 1; --j > 0; ) {
+		for (int i = 1; i < BSZ + 1; i++) {
 			move(BSZ + 1 - j, 2 * i + 1);
 			sp = &board[i + j * (BSZ + 1)];
 			if (debug > 1 && sp->s_occ == EMPTY) {
@@ -196,16 +195,16 @@ bdisp(void)
 void
 bdump(FILE *fp)
 {
-	int i, j, c;
+	int c;
 	struct spotstr *sp;
 
 	/* top border */
 	fprintf(fp, "   A B C D E F G H J K L M N O P Q R S T\n");
 
-	for (j = BSZ + 1; --j > 0; ) {
+	for (int j = BSZ + 1; --j > 0; ) {
 		/* left edge */
 		fprintf(fp, "%2d ", j);
-		for (i = 1; i < BSZ + 1; i++) {
+		for (int i = 1; i < BSZ + 1; i++) {
 			sp = &board[i + j * (BSZ + 1)];
 			if (debug > 1 && sp->s_occ == EMPTY) {
 				if ((sp->s_flags & IFLAGALL) != 0)

Index: src/games/gomoku/makemove.c
diff -u src/games/gomoku/makemove.c:1.16 src/games/gomoku/makemove.c:1.17
--- src/games/gomoku/makemove.c:1.16	Mon May 16 21:48:45 2022
+++ src/games/gomoku/makemove.c	Wed May 18 22:30:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: makemove.c,v 1.16 2022/05/16 21:48:45 rillig Exp $	*/
+/*	$NetBSD: makemove.c,v 1.17 2022/05/18 22:30:19 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)makemove.c	8.2 (Berkeley) 5/3/95";
 #else
-__RCSID("$NetBSD: makemove.c,v 1.16 2022/05/16 21:48:45 rillig Exp $");
+__RCSID("$NetBSD: makemove.c,v 1.17 2022/05/18 22:30:19 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -68,7 +68,7 @@ makemove(int us, int mv)
 	struct spotstr *osp;
 	struct combostr *cbp, *cbp1;
 	union comboval *cp1;
-	int i, f, r, d, n;
+	int d, n;
 	int val, bmask;
 	bool space;
 
@@ -90,11 +90,11 @@ makemove(int us, int mv)
 	/* compute new frame values */
 	sp->s_wval = 0;
 	osp = sp;
-	for (r = 4; --r >= 0; ) {			/* for each direction */
+	for (int r = 4; --r >= 0; ) {		/* for each direction */
 	    d = dd[r];
 	    fsp = osp;
 	    bmask = BFLAG << r;
-	    for (f = 5; --f >= 0; fsp -= d) {		/* for each frame */
+	    for (int f = 5; --f >= 0; fsp -= d) {	/* for each frame */
 		if (fsp->s_occ == BORDER)
 		    goto nextr;
 		if ((fsp->s_flags & bmask) != 0)
@@ -125,7 +125,7 @@ makemove(int us, int mv)
 		sp = fsp;
 		space = sp->s_occ == EMPTY;
 		n = 0;
-		for (i = 5; --i >= 0; sp += d) {	/* for each spot */
+		for (int i = 5; --i >= 0; sp += d) {	/* for each spot */
 		    if (sp->s_occ == us)
 			n++;
 		    else if (sp->s_occ == EMPTY)
@@ -161,7 +161,7 @@ makemove(int us, int mv)
 		}
 		val = weight[n];
 		sp = fsp;
-		for (i = 5; --i >= 0; sp += d)		/* for each spot */
+		for (int i = 5; --i >= 0; sp += d)	/* for each spot */
 		    if (sp->s_occ == EMPTY)
 			sp->s_wval += val;
 
@@ -222,17 +222,17 @@ static void
 update_overlap(struct spotstr *osp)
 {
 	struct spotstr *sp, *sp1, *sp2;
-	int i, f, r, r1, d, d1, n;
+	int d, d1, n;
 	int a, b, bmask, bmask1;
 	struct spotstr *esp;
 	u_char *str;
 
 	esp = NULL;
-	for (r = 4; --r >= 0; ) {			/* for each direction */
+	for (int r = 4; --r >= 0; ) {		/* for each direction */
 	    d = dd[r];
 	    sp1 = osp;
 	    bmask = BFLAG << r;
-	    for (f = 0; f < 6; f++, sp1 -= d) {		/* for each frame */
+	    for (int f = 0; f < 6; f++, sp1 -= d) {	/* for each frame */
 		if (sp1->s_occ == BORDER)
 		    break;
 		if ((sp1->s_flags & bmask) != 0)
@@ -246,7 +246,7 @@ update_overlap(struct spotstr *osp)
 		 */
 		str = &overlap[(a = (int)(sp1->s_frame[r] - frames)) * FAREA];
 		sp2 = sp1 - d;
-		for (i = f + 1; i < 6; i++, sp2 -= d) {
+		for (int i = f + 1; i < 6; i++, sp2 -= d) {
 		    if (sp2->s_occ == BORDER)
 			break;
 		    if ((sp2->s_flags & bmask) != 0)
@@ -289,11 +289,11 @@ update_overlap(struct spotstr *osp)
 		}
 
 		/* the other directions can only intersect at spot osp */
-		for (r1 = r; --r1 >= 0; ) {
+		for (int r1 = r; --r1 >= 0; ) {
 		    d1 = dd[r1];
 		    bmask1 = BFLAG << r1;
 		    sp = osp;
-		    for (i = 6; --i >= 0; sp -= d1) {	/* for each spot */
+		    for (int i = 6; --i >= 0; sp -= d1) { /* for each spot */
 			if (sp->s_occ == BORDER)
 			    break;
 			if ((sp->s_flags & bmask1) != 0)
Index: src/games/gomoku/stoc.c
diff -u src/games/gomoku/stoc.c:1.16 src/games/gomoku/stoc.c:1.17
--- src/games/gomoku/stoc.c:1.16	Sun May 15 22:56:20 2022
+++ src/games/gomoku/stoc.c	Wed May 18 22:30:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: stoc.c,v 1.16 2022/05/15 22:56:20 rillig Exp $	*/
+/*	$NetBSD: stoc.c,v 1.17 2022/05/18 22:30:19 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)stoc.c	8.1 (Berkeley) 7/24/94";
 #else
-__RCSID("$NetBSD: stoc.c,v 1.16 2022/05/15 22:56:20 rillig Exp $");
+__RCSID("$NetBSD: stoc.c,v 1.17 2022/05/18 22:30:19 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -69,9 +69,8 @@ const char *
 stoc(int s)
 {
 	static char buf[32];
-	int i;
 
-	for (i = 0; mv[i].m_code >= 0; i++)
+	for (int i = 0; mv[i].m_code >= 0; i++)
 		if (s == mv[i].m_code)
 			return mv[i].m_text;
 	snprintf(buf, sizeof(buf), "%c%d",
@@ -85,14 +84,13 @@ stoc(int s)
 int
 ctos(const char *mp)
 {
-	int i;
 
-	for (i = 0; mv[i].m_code >= 0; i++)
+	for (int i = 0; mv[i].m_code >= 0; i++)
 		if (strcmp(mp, mv[i].m_text) == 0)
 			return mv[i].m_code;
 	if (!isalpha((unsigned char)mp[0]))
 		return ILLEGAL;
-	i = atoi(&mp[1]);
+	int i = atoi(&mp[1]);
 	if (i < 1 || i > 19)
 		return ILLEGAL;
 	return PT(lton((unsigned char)mp[0]), i);

Index: src/games/gomoku/pickmove.c
diff -u src/games/gomoku/pickmove.c:1.33 src/games/gomoku/pickmove.c:1.34
--- src/games/gomoku/pickmove.c:1.33	Mon May 16 21:48:45 2022
+++ src/games/gomoku/pickmove.c	Wed May 18 22:30:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pickmove.c,v 1.33 2022/05/16 21:48:45 rillig Exp $	*/
+/*	$NetBSD: pickmove.c,v 1.34 2022/05/18 22:30:19 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.33 2022/05/16 21:48:45 rillig Exp $");
+__RCSID("$NetBSD: pickmove.c,v 1.34 2022/05/18 22:30:19 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -94,7 +94,6 @@ pickmove(int us)
 {
 	struct spotstr *sp, *sp1, *sp2;
 	union comboval *Ocp, *Tcp;
-	unsigned pos;
 	int m;
 
 	/* first move is easy */
@@ -102,7 +101,7 @@ pickmove(int us)
 		return PT((BSZ + 1) / 2, (BSZ + 1) / 2);
 
 	/* initialize all the board values */
-	for (pos = PT(BSZ, BSZ + 1); pos-- > PT(1, 1); ) {
+	for (unsigned pos = PT(BSZ, BSZ + 1); pos-- > PT(1, 1); ) {
 		sp = &board[pos];
 		sp->s_combo[BLACK].s = MAXCOMBO + 1;
 		sp->s_combo[WHITE].s = MAXCOMBO + 1;
@@ -121,7 +120,7 @@ pickmove(int us)
 	scanframes(WHITE);
 
 	/* find the spot with the highest value */
-	pos = PT(BSZ, BSZ);
+	unsigned pos = PT(BSZ, BSZ);
 	sp1 = sp2 = &board[pos];
 	for ( ; pos-- > PT(1, 1); ) {
 		sp = &board[pos];
@@ -237,10 +236,9 @@ scanframes(int color)
 	struct combostr *cbp, *ecbp;
 	struct spotstr *sp;
 	union comboval *cp;
-	struct elist *ep, *nep;
+	struct elist *nep;
 	int i, r, d, n;
 	union comboval cb;
-	unsigned pos;
 
 	curcolor = color;
 
@@ -350,9 +348,9 @@ scanframes(int color)
 	}
 
 	/* scan for combos at empty spots */
-	for (pos = PT(BSZ, BSZ + 1); pos-- > PT(1, 1); ) {
+	for (unsigned pos = PT(BSZ, BSZ + 1); pos-- > PT(1, 1); ) {
 		sp = &board[pos];
-		for (ep = sp->s_empty; ep != NULL; ep = nep) {
+		for (struct elist *ep = sp->s_empty; ep != NULL; ep = nep) {
 			cbp = ep->e_combo;
 			if (cbp->c_combo.s <= sp->s_combo[color].s) {
 				if (cbp->c_combo.s != sp->s_combo[color].s) {
@@ -366,7 +364,7 @@ scanframes(int color)
 			elistcnt--;
 		}
 		sp->s_empty = (struct elist *)0;
-		for (ep = sp->s_nempty; ep != NULL; ep = nep) {
+		for (struct elist *ep = sp->s_nempty; ep != NULL; ep = nep) {
 			cbp = ep->e_combo;
 			if (cbp->c_combo.s <= sp->s_combo[color].s) {
 				if (cbp->c_combo.s != sp->s_combo[color].s) {
@@ -420,7 +418,7 @@ makecombo2(struct combostr *ocbp, struct
 {
 	struct spotstr *fsp;
 	struct combostr *ncbp;
-	int f, r, d, c;
+	int d, c;
 	int baseB, fcnt, emask, bmask, n;
 	union comboval ocb, fcb;
 	struct combostr **scbpp, *fcbp;
@@ -431,7 +429,7 @@ makecombo2(struct combostr *ocbp, struct
 	baseB = ocb.c.a + ocb.c.b - 1;
 	fcnt = ocb.c.a - 2;
 	emask = fcnt != 0 ? ((ocb.c.b != 0 ? 0x1E : 0x1F) & ~(1 << off)) : 0;
-	for (r = 4; --r >= 0; ) {			/* for each direction */
+	for (int r = 4; --r >= 0; ) {		/* for each direction */
 	    /* don't include frames that overlap in the same direction */
 	    if (r == ocbp->c_dir)
 		continue;
@@ -444,7 +442,7 @@ makecombo2(struct combostr *ocbp, struct
 	     */
 	    bmask = (BFLAG | FFLAG | MFLAG) << r;
 	    fsp = osp;
-	    for (f = 0; f < 5; f++, fsp -= d) {		/* for each frame */
+	    for (int f = 0; f < 5; f++, fsp -= d) {	/* for each frame */
 		if (fsp->s_occ == BORDER)
 		    break;
 		if ((fsp->s_flags & bmask) != 0)
@@ -550,19 +548,18 @@ addframes(int level)
 {
 	struct combostr *cbp, *ecbp;
 	struct spotstr *sp, *fsp;
-	struct elist *ep, *nep;
+	struct elist *nep;
 	int i, r, d;
 	struct combostr **cbpp, *pcbp;
 	union comboval fcb, cb;
-	unsigned pos;
 
 	curlevel = level;
 
 	/* scan for combos at empty spots */
 	i = curcolor;
-	for (pos = PT(BSZ, BSZ + 1); pos-- > PT(1, 1); ) {
+	for (unsigned pos = PT(BSZ, BSZ + 1); pos-- > PT(1, 1); ) {
 		sp = &board[pos];
-		for (ep = sp->s_empty; ep != NULL; ep = nep) {
+		for (struct elist *ep = sp->s_empty; ep != NULL; ep = nep) {
 			cbp = ep->e_combo;
 			if (cbp->c_combo.s <= sp->s_combo[i].s) {
 				if (cbp->c_combo.s != sp->s_combo[i].s) {
@@ -652,9 +649,7 @@ makecombo(struct combostr *ocbp, struct 
 {
 	struct combostr *cbp, *ncbp;
 	struct spotstr *sp;
-	struct elist *ep;
 	int n, c;
-	struct elist *nep;
 	struct combostr **scbpp;
 	int baseB, fcnt, emask, verts;
 	union comboval ocb;
@@ -674,7 +669,7 @@ makecombo(struct combostr *ocbp, struct 
 	baseB = ocb.c.a + ocb.c.b - 1;
 	fcnt = ocb.c.a - 2;
 	emask = fcnt != 0 ? ((ocb.c.b != 0 ? 0x1E : 0x1F) & ~(1 << off)) : 0;
-	for (ep = osp->s_empty; ep != NULL; ep = ep->e_next) {
+	for (struct elist *ep = osp->s_empty; ep != NULL; ep = ep->e_next) {
 	    /* check for various kinds of overlap */
 	    cbp = ep->e_combo;
 	    verts = checkframes(cbp, ocbp, osp, s, vertices);
@@ -697,7 +692,8 @@ makecombo(struct combostr *ocbp, struct 
 		 * of the completion spots of the combostr
 		 * we are trying to attach the frame to.
 		 */
-		for (nep = sp->s_empty; nep != NULL; nep = nep->e_next) {
+		for (struct elist *nep = sp->s_empty;
+			nep != NULL; nep = nep->e_next) {
 		    if (nep->e_combo == cbp)
 			goto fnd;
 		    if (nep->e_combo->c_nframes < cbp->c_nframes)
@@ -963,7 +959,7 @@ updatecombo(struct combostr *cbp, int co
 {
 	struct spotstr *sp;
 	struct combostr *tcbp;
-	int i, d;
+	int d;
 	int nframes, flags, s;
 	union comboval cb;
 
@@ -993,7 +989,7 @@ updatecombo(struct combostr *cbp, int co
 			/* update the board values for each spot in frame */
 			sp = &board[s = tcbp->c_vertex];
 			d = dd[tcbp->c_dir];
-			i = (flags & C_OPEN_1) != 0 ? 6 : 5;
+			int i = (flags & C_OPEN_1) != 0 ? 6 : 5;
 			for (; --i >= 0; sp += d, s += d) {
 				if (sp->s_occ != EMPTY)
 					continue;
@@ -1017,7 +1013,7 @@ updatecombo(struct combostr *cbp, int co
 		/* update the board values for each spot in frame */
 		sp = &board[s = cbp->c_vertex];
 		d = dd[cbp->c_dir];
-		i = (flags & C_OPEN_0) != 0 ? 6 : 5;
+		int i = (flags & C_OPEN_0) != 0 ? 6 : 5;
 		for (; --i >= 0; sp += d, s += d) {
 			if (sp->s_occ != EMPTY)
 				continue;

Reply via email to