-/* $NetBSD: bdinit.c,v 1.8 2009/08/12 06:19:17 dholland Exp $ */
+/* $NetBSD: bdinit.c,v 1.9 2012/10/13 20:57:35 dholland Exp $ */
/*
* Copyright (c) 1994
#if 0
static char sccsid[] = "from: @(#)bdinit.c 8.2 (Berkeley) 5/3/95";
#else
-__RCSID("$NetBSD: bdinit.c,v 1.8 2009/08/12 06:19:17 dholland Exp $");
+__RCSID("$NetBSD: bdinit.c,v 1.9 2012/10/13 20:57:35 dholland Exp $");
#endif
#endif /* not lint */
{
struct spotstr *sp1, *sp2;
struct combostr *cbp;
+ unsigned frameix;
int i, f, r, n, d1, d2;
int mask, bmask, vertex, s;
u_char *str;
memset(intersect, 0, sizeof(intersect));
str = &overlap[FAREA * FAREA];
ip = &intersect[FAREA * FAREA];
- for (cbp = frames + FAREA; --cbp >= frames; ) { /* each frame */
+ for (frameix = FAREA; frameix-- > 0; ) { /* each frame */
+ cbp = &frames[frameix];
str -= FAREA;
ip -= FAREA;
sp1 = &board[vertex = cbp->c_vertex];
-/* $NetBSD: pickmove.c,v 1.20 2010/03/29 05:16:08 dholland Exp $ */
+/* $NetBSD: pickmove.c,v 1.21 2012/10/13 20:57:35 dholland Exp $ */
/*
* Copyright (c) 1994
#if 0
static char sccsid[] = "@(#)pickmove.c 8.2 (Berkeley) 5/3/95";
#else
-__RCSID("$NetBSD: pickmove.c,v 1.20 2010/03/29 05:16:08 dholland Exp $");
+__RCSID("$NetBSD: pickmove.c,v 1.21 2012/10/13 20:57:35 dholland Exp $");
#endif
#endif /* not lint */
{
struct spotstr *sp, *sp1, *sp2;
union comboval *Ocp, *Tcp;
+ unsigned pos;
int m;
/* first move is easy */
return (PT(K,10));
/* initialize all the board values */
- for (sp = &board[PT(T,20)]; --sp >= &board[PT(A,1)]; ) {
+ for (pos = PT(T,20); pos-- > PT(A,1); ) {
+ sp = &board[pos];
sp->s_combo[BLACK].s = MAXCOMBO + 1;
sp->s_combo[WHITE].s = MAXCOMBO + 1;
sp->s_level[BLACK] = 255;
scanframes(WHITE);
/* find the spot with the highest value */
- for (sp = sp1 = sp2 = &board[PT(T,19)]; --sp >= &board[PT(A,1)]; ) {
+ pos = PT(T,19);
+ sp1 = sp2 = &board[pos];
+ for ( ; pos-- > PT(A,1); ) {
+ sp = &board[pos];
if (sp->s_occ != EMPTY)
continue;
if (debug && (sp->s_combo[BLACK].c.a == 1 ||
struct elist *ep, *nep;
int i, r, d, n;
union comboval cb;
+ unsigned pos;
curcolor = color;
}
/* scan for combos at empty spots */
- for (sp = &board[PT(T,20)]; --sp >= &board[PT(A,1)]; ) {
+ for (pos = PT(T,20); pos-- > PT(A,1); ) {
+ sp = &board[pos];
for (ep = sp->s_empty; ep; ep = nep) {
cbp = ep->e_combo;
if (cbp->c_combo.s <= sp->s_combo[color].s) {
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 (sp = &board[PT(T,20)]; --sp >= &board[PT(A,1)]; ) {
+ for (pos = PT(T,20); pos-- > PT(A,1); ) {
+ sp = &board[pos];
for (ep = sp->s_empty; ep; ep = nep) {
cbp = ep->e_combo;
if (cbp->c_combo.s <= sp->s_combo[i].s) {