Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] Re: (PR#8591) win32: client crashes on middle click
Home

[Freeciv-Dev] Re: (PR#8591) win32: client crashes on middle click

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: use_less@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#8591) win32: client crashes on middle click
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 26 Apr 2004 00:43:10 -0700
Reply-to: rt@xxxxxxxxxxx

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

James Canete wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8591 >
> 
>>[jdorje - Mon Apr 26 00:29:19 2004]:
>>
>>Casts like this are dangerous.  Are you sure the function type matches? 
>>  Can you change the function type that list_impr_or_unit_select takes?
>>
>>+      list_impr_or_unit_select(hLst,num,(TestCityFunc
> 
> *)city_got_building);
> 
> 
> The function is:
> bool city_got_building(struct city *pcity,  Impr_Type_id id)
> 
> and TestCityFunc is:
> typedef bool (*TestCityFunc)(struct city *, gint)
> 
> There's an identical cast on line 474 of gui-win32/cityrep.c, and
> similar ones on line 1625 and 1629 of gui-gtk-2.0/cityrep.c.
> 
> Perhaps a wrapper function should be made?

Perhaps.  But I don't think gui-win32 needs one.

gui-win32/cityrep.c:typedef bool TestCityFunc(struct city *, int);

So just change the int to an Impr_Type_id?

jason




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