Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] (PR#9788) RfP: G_MAGIC is evil
Home

[Freeciv-Dev] (PR#9788) RfP: G_MAGIC is evil

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#9788) RfP: G_MAGIC is evil
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 24 Aug 2004 11:45:52 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9788 >

> [marko.lindqvist@xxxxxxxxxxx - Tue Aug 24 14:14:04 2004]:
> 
> Jason Short wrote:
> 
> > <URL: http://rt.freeciv.org/Ticket/Display.html?id=9788 >
> > 
> > government.h has a #define G_MAGIC 127.  This value should be
changed to 
> > MAX_NUM_GOVERNMENTS.  The value isn't magic at all, it's just a
limit on 
> > the number of governments.
> 
>   Max size of city too (why is this defined this way???):
> #define G_CITY_SIZE_FREE          G_MAGIC
> 
>   IIRC revolution code also needed two special flag values, so G_MAGIC 
> had to have different value from G_LAST to distinguish between the two. 
> This has been since cleaned, I hope.

The "magic" here is in the 127, which I assume is intended to fit inside
a sint8 value.  But I don't know if any parts of the code actually try
to do that.

IMO the special flags (T_UNKNOWN, A_UNSET) should be negative.  So they
shouldn't have an affect on the *_LAST or MAX_NUM_* values.

jason



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