Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] Re: (PR#12872) Client Factory Help-Text Crash
Home

[Freeciv-Dev] Re: (PR#12872) Client Factory Help-Text Crash

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: badamson@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#12872) Client Factory Help-Text Crash
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Sat, 23 Apr 2005 06:40:09 -0700
Reply-to: bugs@xxxxxxxxxxx

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

On Fri, 22 Apr 2005, Jason Short wrote:

>
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=12872 >
>
> This bug is a bit bizarre.  This patch fixes it and another problem with
> insert_allows.

I think this bug is just a manifestation of a deeper problem.

We should not be using REQ_NONE terminated limited size arrays for this,
i hate this kludge in the worklist and I hate this here. We should be using
requirement_vectors. They have a simpler end test, are resizeable, and
have a built-in iterator for free. We should switch to
requirement_vectors in the ruleset_cache as well, and make the code more
regular. If your problem with with the protocol glue code, perhaps we
should change the protocol IDL to support vectors as well as arrays.

We could even use the Sun RPC IDL convention. In Sun RPC you either had
static arrays defined with []s or dynamic arrays defined with <>s. i.e.

BOOL myarray[MAX_LEN];     /* bool array of MAX_LEN size */
BOOL myarray[MAX_LEN:len]; /* bool array of MAX_LEN size, len places used */

BOOL myvector<>            /* bool vector with no size limit */
BOOL myvector<MAX_LEN>     /* bool vector with hard size limit of MAX_LEN */

We could just support this at first:
BOOL myvector<>            /* bool vector with no size limit */

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa





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