Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2004:
[Freeciv-Dev] Re: (PR#7418) memory usage for compiling
Home

[Freeciv-Dev] Re: (PR#7418) memory usage for compiling

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ue80@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7418) memory usage for compiling
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 16 Feb 2004 11:43:02 -0800
Reply-to: rt@xxxxxxxxxxx

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

Raimar Falke wrote:

> It would be possible to merge these variants in one function but you
> would end up with code like:
> 
>   if (BV_ISSET(fields, variant==100?4:5)) {
>     variant==100?dio_get_uint8(&din, (int *) &real_packet->veteran):
>       dio_get_bool8(&din, (int *) &real_packet->veteran);
>   }
> 
> but this is harder to generate and harder to read.

if (variant == 101) {
   if (BF_ISSET(fields, field)) {
     dio_get_uint8(&din, (int *) &real_packet->veteran);
   }
   field++;
}

Though I don't know that this would actually make compilation simpler.

Capabilities are done on a per-packet basis, right?  What happens if you 
have 2 capabilities in one packet?  Do you get 4 functions, or 3?

jason




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