Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2005:
[Freeciv-Dev] (PR#13164) Illegal BV_SET() usage at diplomats.c
Home

[Freeciv-Dev] (PR#13164) Illegal BV_SET() usage at diplomats.c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: evyscr@xxxxxxxxx, marko.lindqvist@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#13164) Illegal BV_SET() usage at diplomats.c
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 24 May 2005 20:48:00 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13164 >

> [cazfi - Sun May 22 21:08:56 2005]:
> 
> 
>   Debug compilation for diplomats.c fails due to BV_SET() in 
> spy_get_sabotage_list()
> 
>   Second argument for BV_SET() is number of bit to set, not wheter bit 
> should be set or cleared as this code seems to expect.

Ahh, of course (though I don't see how this causes a compile warning).

-jason

Index: server/diplomats.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/diplomats.c,v
retrieving revision 1.77
diff -u -r1.77 diplomats.c
--- server/diplomats.c  22 May 2005 17:48:11 -0000      1.77
+++ server/diplomats.c  25 May 2005 03:47:26 -0000
@@ -212,7 +212,9 @@
   BV_CLR_ALL(packet.improvements);
 
   impr_type_iterate(i) {
-    BV_SET(packet.improvements, city_got_building(pcity, i));
+    if (city_got_building(pcity, i)) {
+      BV_SET(packet.improvements, i);
+    }
   } impr_type_iterate_end;
 
   packet.diplomat_id = pdiplomat->id;

[Prev in Thread] Current Thread [Next in Thread]