From 17578658cec5a8d8890c07036be4e0b55e50941c Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sun, 23 Nov 2003 09:47:34 +0000 Subject: [PATCH] build fix (trunk only) DEC C warned about a problem and that caused make to quit. | idx = (++idx % 2); |........^ |%CC-W-UNDEFVARMOD, In this statement, the expression "idx=(++idx%2)" |modifies the variable "idx" more than once without an intervening |sequence point. This behavior is undefined. --- src/botl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/botl.c b/src/botl.c index b20180de4..e2f625d05 100644 --- a/src/botl.c +++ b/src/botl.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)botl.c 3.4 1996/07/15 */ +/* SCCS Id: @(#)botl.c 3.4 2003/11/22 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -447,8 +447,8 @@ bot() anything curr, prev; boolean valset[MAXBLSTATS]; - idx = (++idx % 2); - idx_p = ((idx+1) % 2); + idx_p = idx; + idx = 1 - idx; /* 0 -> 1, 1 -> 0 */ /* clear the "value set" indicators */ (void) memset((genericptr_t)valset, 0, MAXBLSTATS * sizeof(boolean)); -- 2.40.0