Module Name:    src
Committed By:   rillig
Date:           Mon May 16 21:02:18 UTC 2022

Modified Files:
        src/games/gomoku: Makefile gomoku.h main.c pickmove.c

Log Message:
gomoku: allow combination of WARNS=6 and -DDEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/games/gomoku/Makefile
cvs rdiff -u -r1.26 -r1.27 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.33 -r1.34 src/games/gomoku/main.c
cvs rdiff -u -r1.30 -r1.31 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/Makefile
diff -u src/games/gomoku/Makefile:1.7 src/games/gomoku/Makefile:1.8
--- src/games/gomoku/Makefile:1.7	Mon May 16 20:57:01 2022
+++ src/games/gomoku/Makefile	Mon May 16 21:02:18 2022
@@ -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 @@ MAN=	gomoku.6
 DPADD=	${LIBCURSES} ${LIBTERMINFO}
 LDADD=	-lcurses -lterminfo
 HIDEGAME=hidegame
+CPPFLAGS+=	${DEBUG:D-DDEBUG}
 
 LINTFLAGS+=	-w	# treat warnings as errors
 #LINTFLAGS+=	-T	# strict bool mode

Index: src/games/gomoku/gomoku.h
diff -u src/games/gomoku/gomoku.h:1.26 src/games/gomoku/gomoku.h:1.27
--- src/games/gomoku/gomoku.h:1.26	Mon May 16 20:57:01 2022
+++ src/games/gomoku/gomoku.h	Mon May 16 21:02:18 2022
@@ -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 @@ int	list_eq(struct combostr **, struct c
 void	clearcombo(struct combostr *, int);
 void	markcombo(struct combostr *);
 int	pickmove(int);
+#if defined(DEBUG)
+void	printcombo(struct combostr *, char *, size_t);
+#endif

Index: src/games/gomoku/main.c
diff -u src/games/gomoku/main.c:1.33 src/games/gomoku/main.c:1.34
--- src/games/gomoku/main.c:1.33	Mon May 16 20:57:01 2022
+++ src/games/gomoku/main.c	Mon May 16 21:02:18 2022
@@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1994\
 #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 @@ const char	*plyr[2];		/* who's who */
 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)

Index: src/games/gomoku/pickmove.c
diff -u src/games/gomoku/pickmove.c:1.30 src/games/gomoku/pickmove.c:1.31
--- src/games/gomoku/pickmove.c:1.30	Mon May 16 20:57:01 2022
+++ src/games/gomoku/pickmove.c	Mon May 16 21:02:18 2022
@@ -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 void makeempty(struct combostr *)
 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 @@ inserted:
 /*
  * 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;

Reply via email to