[freeciv-ai] (PR#9610) autosettler "territory" and danger maps
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=9610 >
You can't cast an int as a void* and treat it as a pointer. This won't work on
64-bit systems
where sizeof(int) != sizeof(void*). (Or so I'm told; I've never actually
compiled on a 64-bit
system.)
There are two choices (unless you want to redesign the movemap to hold unit
pointers
directly and work properly with deletions). Probably the better one is to
malloc(sizeof(int))
and keep the unit ID in a malloced pointer. Naturally you then have to free
the pointer
afterwards. The other is to develop our own version of G_POINTER_TO_INT/
G_INT_TO_POINTER that could probably just be copied verbatim from the glib
sources.
Naturally then we have to make sure this macro works on any new systems that
turn up in
the future.
-jason
|
|