Module Name: src Committed By: rillig Date: Sat May 28 21:48:21 UTC 2022
Modified Files: src/games/gomoku: pickmove.c Log Message: gomoku: use unsigned arithmetic for bitboard No functional change. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 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/pickmove.c diff -u src/games/gomoku/pickmove.c:1.47 src/games/gomoku/pickmove.c:1.48 --- src/games/gomoku/pickmove.c:1.47 Sat May 28 08:19:18 2022 +++ src/games/gomoku/pickmove.c Sat May 28 21:48:21 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: pickmove.c,v 1.47 2022/05/28 08:19:18 rillig Exp $ */ +/* $NetBSD: pickmove.c,v 1.48 2022/05/28 21:48:21 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.47 2022/05/28 08:19:18 rillig Exp $"); +__RCSID("$NetBSD: pickmove.c,v 1.48 2022/05/28 21:48:21 rillig Exp $"); #include <stdlib.h> #include <string.h> @@ -46,9 +46,8 @@ __RCSID("$NetBSD: pickmove.c,v 1.47 2022 #define BITS_PER_INT (sizeof(int) * CHAR_BIT) #define MAPSZ (BAREA / BITS_PER_INT) -#define BIT_SET(a, b) ((a)[(b)/BITS_PER_INT] |= (1 << ((b) % BITS_PER_INT))) -#define BIT_CLR(a, b) ((a)[(b)/BITS_PER_INT] &= ~(1 << ((b) % BITS_PER_INT))) -#define BIT_TEST(a, b) (((a)[(b)/BITS_PER_INT] & (1 << ((b) % BITS_PER_INT))) != 0) +#define BIT_SET(a, b) ((a)[(unsigned int)(b)/BITS_PER_INT] |= (1 << ((unsigned int)(b) % BITS_PER_INT))) +#define BIT_TEST(a, b) (((a)[(unsigned int)(b)/BITS_PER_INT] & (1 << ((unsigned int)(b) % BITS_PER_INT))) != 0) /* * This structure is used to store overlap information between frames.