Source-Changes-HG archive

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

[src/trunk]: src/games/gomoku gomoku: allow combination of WARNS=6 and -DDEBUG



details:   https://anonhg.NetBSD.org/src/rev/e5e324a5622d
branches:  trunk
changeset: 366163:e5e324a5622d
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon May 16 21:02:18 2022 +0000

description:
gomoku: allow combination of WARNS=6 and -DDEBUG

diffstat:

 games/gomoku/Makefile   |   3 ++-
 games/gomoku/gomoku.h   |   5 ++++-
 games/gomoku/main.c     |   6 +++---
 games/gomoku/pickmove.c |  11 ++++++++---
 4 files changed, 17 insertions(+), 8 deletions(-)

diffs (100 lines):

diff -r be3eb412c94d -r e5e324a5622d games/gomoku/Makefile
--- a/games/gomoku/Makefile     Mon May 16 20:57:01 2022 +0000
+++ b/games/gomoku/Makefile     Mon May 16 21:02:18 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.7 2022/05/16 20:57:01 rillig Exp $
+#      $NetBSD: Makefile,v 1.8 2022/05/16 21:02:18 rillig Exp $
 #      @(#)Makefile    8.1 (Berkeley) 7/24/94
 
 PROG=  gomoku
@@ -7,6 +7,7 @@
 DPADD= ${LIBCURSES} ${LIBTERMINFO}
 LDADD= -lcurses -lterminfo
 HIDEGAME=hidegame
+CPPFLAGS+=     ${DEBUG:D-DDEBUG}
 
 LINTFLAGS+=    -w      # treat warnings as errors
 #LINTFLAGS+=   -T      # strict bool mode
diff -r be3eb412c94d -r e5e324a5622d games/gomoku/gomoku.h
--- a/games/gomoku/gomoku.h     Mon May 16 20:57:01 2022 +0000
+++ b/games/gomoku/gomoku.h     Mon May 16 21:02:18 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gomoku.h,v 1.26 2022/05/16 20:57:01 rillig Exp $       */
+/*     $NetBSD: gomoku.h,v 1.27 2022/05/16 21:02:18 rillig Exp $       */
 
 /*
  * Copyright (c) 1994
@@ -255,3 +255,6 @@
 void   clearcombo(struct combostr *, int);
 void   markcombo(struct combostr *);
 int    pickmove(int);
+#if defined(DEBUG)
+void   printcombo(struct combostr *, char *, size_t);
+#endif
diff -r be3eb412c94d -r e5e324a5622d games/gomoku/main.c
--- a/games/gomoku/main.c       Mon May 16 20:57:01 2022 +0000
+++ b/games/gomoku/main.c       Mon May 16 21:02:18 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.33 2022/05/16 20:57:01 rillig Exp $ */
+/*     $NetBSD: main.c,v 1.34 2022/05/16 21:02:18 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.33 2022/05/16 20:57:01 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.34 2022/05/16 21:02:18 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -84,7 +84,7 @@
 static int readinput(FILE *);
 static void misclog(const char *, ...) __printflike(1, 2);
 static void quit(void) __dead;
-static void quitsig(int) __dead;
+static void quitsig(int) __dead __unused;
 
 int
 main(int argc, char **argv)
diff -r be3eb412c94d -r e5e324a5622d games/gomoku/pickmove.c
--- a/games/gomoku/pickmove.c   Mon May 16 20:57:01 2022 +0000
+++ b/games/gomoku/pickmove.c   Mon May 16 21:02:18 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pickmove.c,v 1.30 2022/05/16 20:57:01 rillig Exp $     */
+/*     $NetBSD: pickmove.c,v 1.31 2022/05/16 21:02:18 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.30 2022/05/16 20:57:01 rillig Exp $");
+__RCSID("$NetBSD: pickmove.c,v 1.31 2022/05/16 21:02:18 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -85,7 +85,9 @@
 static int checkframes(struct combostr *, struct combostr *, struct spotstr *,
                    int, struct overlap_info *);
 static bool sortcombo(struct combostr **, struct combostr **, struct combostr *);
+#if !defined(DEBUG)
 static void printcombo(struct combostr *, char *, size_t);
+#endif
 
 int
 pickmove(int us)
@@ -1321,7 +1323,10 @@
 /*
  * Print the combo into string buffer 'buf'.
  */
-static void
+#if !defined(DEBUG)
+static
+#endif
+void
 printcombo(struct combostr *cbp, char *buf, size_t max)
 {
        struct combostr *tcbp;



Home | Main Index | Thread Index | Old Index