[Freeciv-Dev] Re: (PR#7418) memory usage for compiling
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=7418 >
Jason Short wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7418 >
>
>>[i-freeciv-lists@xxxxxxxxxxxxx - Fri Feb 13 10:31:07 2004]:
>
>
>>>The former should be quite possible; it requires changes to
>>
>>generate.py.
>>
>>> You'll have to take it up with Raimar.
>>
>>What idea(s) do you have?
>
> None. But based on the changes I see in each diff I'd say there is a
> lot of redundancy.
There are a switch statements that are unnecessary. With a single array
definition these switches can be replaced by a single array lookup. For
instance
void *get_packet_from_connection_helper(pc, type)
{
return (packet_data[type].helper)(pc, type);
}
void *get_packet_name(type)
{
return packet_data[type].name;
}
Then we have code like:
switch(pc->phs.variant[PACKET_CITY_NAME_SUGGESTION_INFO]) {
case 100: return send_packet_city_name_suggestion_info_100(pc,
packet);
default: die("unknown variant"); return -1;
}
do we really want to die here? Does this mean the client can kill the
server? Why is a switch even needed?
Question: why do packets have different variants? 100 versus 101? How
come they have to have entirely different functions to handle them?
jason
- [Freeciv-Dev] Re: (PR#7418) memory usage for compiling, Jason Short, 2004/02/12
- [Freeciv-Dev] Re: (PR#7418) memory usage for compiling, Raimar Falke, 2004/02/13
- [Freeciv-Dev] Re: (PR#7418) memory usage for compiling, ue80@xxxxxxxxxxxxxxxxxxxxx, 2004/02/13
- [Freeciv-Dev] Re: (PR#7418) memory usage for compiling, Raimar Falke, 2004/02/13
- [Freeciv-Dev] Re: (PR#7418) memory usage for compiling, ue80@xxxxxxxxxxxxxxxxxxxxx, 2004/02/13
- [Freeciv-Dev] Re: (PR#7418) memory usage for compiling, Raimar Falke, 2004/02/13
- [Freeciv-Dev] Re: (PR#7418) memory usage for compiling, ue80@xxxxxxxxxxxxxxxxxxxxx, 2004/02/13
- [Freeciv-Dev] (PR#7418) memory usage for compiling, Jason Short, 2004/02/15
- [Freeciv-Dev] Re: (PR#7418) memory usage for compiling,
Jason Short <=
- [Freeciv-Dev] Re: (PR#7418) memory usage for compiling, Raimar Falke, 2004/02/16
- [Freeciv-Dev] Re: (PR#7418) memory usage for compiling, Jason Short, 2004/02/16
- [Freeciv-Dev] Re: (PR#7418) memory usage for compiling, Raimar Falke, 2004/02/16
- [Freeciv-Dev] Re: (PR#7418) memory usage for compiling, Jason Short, 2004/02/16
- [Freeciv-Dev] Re: (PR#7418) memory usage for compiling, Raimar Falke, 2004/02/16
|
|