Source-Changes-HG archive

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

[src/trunk]: src/games/gomoku gomoku: fix remaining lint warnings in -DDEBUG ...



details:   https://anonhg.NetBSD.org/src/rev/d40a27df909e
branches:  trunk
changeset: 366166:d40a27df909e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon May 16 21:38:46 2022 +0000

description:
gomoku: fix remaining lint warnings in -DDEBUG mode

The generated code changes since the calculations are now performed with
int precision.  No functional change since no overflow occurs.

diffstat:

 games/gomoku/main.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 31c02a929e44 -r d40a27df909e games/gomoku/main.c
--- a/games/gomoku/main.c       Mon May 16 21:35:39 2022 +0000
+++ b/games/gomoku/main.c       Mon May 16 21:38:46 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.35 2022/05/16 21:35:39 rillig Exp $ */
+/*     $NetBSD: main.c,v 1.36 2022/05/16 21:38:46 rillig Exp $ */
 
 /*
  * Copyright (c) 1994
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.4 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: main.c,v 1.35 2022/05/16 21:35:39 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.36 2022/05/16 21:38:46 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -449,7 +449,7 @@
                                                break;
                                str[-1] = '\0';
                                sp = &board[s1 = ctos(input + 1)];
-                               n = (int)((sp->s_frame[d1] - frames) * FAREA);
+                               n = (int)(sp->s_frame[d1] - frames) * FAREA;
                                *str++ = '\0';
                                break;
                        }
@@ -459,7 +459,7 @@
                for (d2 = 0; d2 < 4; d2++)
                        if (str[-1] == pdir[d2])
                                break;
-               n += sp->s_frame[d2] - frames;
+               n += (int)(sp->s_frame[d2] - frames);
                debuglog("overlap %s%c,%s%c = %x", stoc(s1), pdir[d1],
                    stoc(s2), pdir[d2], overlap[n]);
                goto top;



Home | Main Index | Thread Index | Old Index