[Freeciv-Dev] Re: Core code cleanups
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
I agree with your sentiments, and it is out in play.
void_ tile has a use, but I agree it is also easily abused and
could lead to difficult problems when tracking down bad code.
The main addition is to copy the default "bad" movecosts via
memcopy from it into real tiles as initializations.
I don't think the use you mentionned below is an appropriate
one. I don't mind the pointer issue, but one shouldn't do
operations on off-map tiles. Whether one uses sophisticated
iteration loops to avoid off-map or checks the returned value
from a tile fetch for validity instead is immaterial. void_tile
can make the latter easier.
It would be nice if it could be made readonly or asserts used
extensively to trap it in development code and so make it help
to catch wayward operations like those that naughtily try to
change it.
It is now more widely visible because its use in map_get_tile
can now be seen as a macro, rather than being hidden in the
function call. Stomping out map_get_tile use would solve a lot
of your concerns, but I presume this has been rejected in favour
of tracking down the problems instead or it would be done.
Cheers,
RossW
=====
At 08:06 PM 01/08/02 -0700, David Pfitzner wrote:
>"Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx> wrote:
>
>> Yes, I exported the void_tile object and filled it in with the defaults
>> which are memcopyed in in various places before the loop. There were one
>> or two routines with their own definitions for the defaults that are now
>> using the same initialized values.
>
>void_tile has caused some tricky bugs in the past, and there have
>been hopes of eliminating it completely, so I hope your changes
>do not encourage its use.
>
>(void_tile is/was used in some cases to have a valid pointer to
>a tile struct for (x,y) positions off the real map, used in such
>a way that operations on void_tile give appropriate results
>without having to special-case the code to handle off-map
>coordinates. The problem is that it can be tricky to ensure
>that everything really does come out the right way when possibly
>operating on void_tile.)
>
>-- David
>__________________________________________________
>Do You Yahoo!?
>Make international calls for as low as $.04/minute with Yahoo! Messenger
>http://phonecard.yahoo.com/
[Freeciv-Dev] Re: Core code cleanups, Ross W. Wetmore, 2001/08/01
Message not available[Freeciv-Dev] Re: Isometric maps, Lino Mastrodomenico, 2001/08/04
|
|