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

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

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8591) win32: client crashes on middle click
From: "James Canete" <use_less@xxxxxxxxxxx>
Date: Mon, 26 Apr 2004 00:37:30 -0700
Reply-to: rt@xxxxxxxxxxx

<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?

-James Canete



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