Module Name:    src
Committed By:   rillig
Date:           Thu May 19 22:29:36 UTC 2022

Modified Files:
        src/games/gomoku: bdinit.c pickmove.c

Log Message:
gomoku: use NULL instead of more verbose null pointer

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/games/gomoku/bdinit.c
cvs rdiff -u -r1.36 -r1.37 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.18 src/games/gomoku/bdinit.c:1.19
--- src/games/gomoku/bdinit.c:1.18	Thu May 19 22:19:18 2022
+++ src/games/gomoku/bdinit.c	Thu May 19 22:29:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdinit.c,v 1.18 2022/05/19 22:19:18 rillig Exp $	*/
+/*	$NetBSD: bdinit.c,v 1.19 2022/05/19 22:29:36 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 /*	from: @(#)bdinit.c	8.2 (Berkeley) 5/3/95	*/
-__RCSID("$NetBSD: bdinit.c,v 1.18 2022/05/19 22:19:18 rillig Exp $");
+__RCSID("$NetBSD: bdinit.c,v 1.19 2022/05/19 22:29:36 rillig Exp $");
 
 #include <string.h>
 #include "gomoku.h"
@@ -144,8 +144,8 @@ bdinit(struct spotstr *bp)
 		sp->s_flags = BFLAGALL;
 	}
 
-	sortframes[BLACK] = (struct combostr *)0;
-	sortframes[WHITE] = (struct combostr *)0;
+	sortframes[BLACK] = NULL;
+	sortframes[WHITE] = NULL;
 	init_overlap();
 }
 

Index: src/games/gomoku/pickmove.c
diff -u src/games/gomoku/pickmove.c:1.36 src/games/gomoku/pickmove.c:1.37
--- src/games/gomoku/pickmove.c:1.36	Thu May 19 22:19:18 2022
+++ src/games/gomoku/pickmove.c	Thu May 19 22:29:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pickmove.c,v 1.36 2022/05/19 22:19:18 rillig Exp $	*/
+/*	$NetBSD: pickmove.c,v 1.37 2022/05/19 22:29:36 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 /*	@(#)pickmove.c	8.2 (Berkeley) 5/3/95	*/
-__RCSID("$NetBSD: pickmove.c,v 1.36 2022/05/19 22:19:18 rillig Exp $");
+__RCSID("$NetBSD: pickmove.c,v 1.37 2022/05/19 22:29:36 rillig Exp $");
 
 #include <stdlib.h>
 #include <string.h>
@@ -239,7 +239,7 @@ scanframes(int color)
 
 	/* check for empty list of frames */
 	cbp = sortframes[color];
-	if (cbp == (struct combostr *)0)
+	if (cbp == NULL)
 		return;
 
 	/* quick check for four in a row */
@@ -358,7 +358,7 @@ scanframes(int color)
 			free(ep);
 			elistcnt--;
 		}
-		sp->s_empty = (struct elist *)0;
+		sp->s_empty = NULL;
 		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) {
@@ -372,11 +372,11 @@ scanframes(int color)
 			free(ep);
 			elistcnt--;
 		}
-		sp->s_nempty = (struct elist *)0;
+		sp->s_nempty = NULL;
 	}
 
 	/* remove old combos */
-	if ((cbp = sortcombos) != (struct combostr *)0) {
+	if ((cbp = sortcombos) != NULL) {
 		struct combostr *ncbp;
 
 		/* scan the list */
@@ -386,7 +386,7 @@ scanframes(int color)
 			free(cbp);
 			combocnt--;
 		} while ((cbp = ncbp) != ecbp);
-		sortcombos = (struct combostr *)0;
+		sortcombos = NULL;
 	}
 	combolen = 0;
 
@@ -568,7 +568,7 @@ addframes(int level)
 			elistcnt--;
 		}
 		sp->s_empty = sp->s_nempty;
-		sp->s_nempty = (struct elist *)0;
+		sp->s_nempty = NULL;
 	}
 
 	/* try to add frames to the uncompleted combos at level curlevel */
@@ -618,11 +618,11 @@ addframes(int level)
 	cbpp = &hashcombos[FAREA];
 	do {
 		cbp = *--cbpp;
-		if (cbp == (struct combostr *)0)
+		if (cbp == NULL)
 			continue;
-		*cbpp = (struct combostr *)0;
+		*cbpp = NULL;
 		ecbp = sortcombos;
-		if (ecbp == (struct combostr *)0)
+		if (ecbp == NULL)
 			sortcombos = cbp;
 		else {
 			/* append to sort list */
@@ -1045,7 +1045,7 @@ appendcombo(struct combostr *cbp, int co
 
 	combolen++;
 	ncbp = sortcombos;
-	if (ncbp == (struct combostr *)0) {
+	if (ncbp == NULL) {
 		sortcombos = cbp;
 		cbp->c_next = cbp;
 		cbp->c_prev = cbp;
@@ -1246,7 +1246,7 @@ inserted:
 
 	/* now check to see if this list of frames has already been seen */
 	cbp = hashcombos[inx = (int)(*scbpp - frames)];
-	if (cbp == (struct combostr *)0) {
+	if (cbp == NULL) {
 		/*
 		 * Easy case, this list hasn't been seen.
 		 * Add it to the hash list.

Reply via email to