[Freeciv-Dev] Re: [PATCH] bug in vnotify_conn_ex() (PR#1185)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Raimar Falke wrote:
On Sat, Jan 05, 2002 at 11:47:45PM -0500, Ross W. Wetmore wrote:
There is no reason not to include (-1,-1) in a normal set because as you
keeping saying, it is arbitrary how you define "normal", unlike real
which does have a hard meaning.
I think that we agreed that for normal position (x,y) "0<=x<map.xsize
and 0<=y<map.ysize" is always true. If we also assume that the
function vnotify_... takes normal position OR this special case it is
possible to distinguish between the special case, normal positions and
misuses of the function (any other case).
There is no _fundamental_ reason why !is_normal_map_pos(-1, -1), it's
just much more convenient to not have it so. Having code depend on this
is a bad idea, so I added the assertion to be safe.
> Jason Short wrote:
>>On the other, we have to call is_real_tile/is_normal_map_pos anyway,so
>>we might as well call normalize_map_pos and make things a trifle safer
>>(when compiled with NDEBUG).
>
> Is someone compiles with NDEBUG he says that he goes for raw speed. He
> can't expect a graceful landing if an error occurs.
I don't think that's true. NDEBUG means an end-user code, which means
both speed and safety. So it won't get the CHECK_MAP_POS assertions,
but it might be wise to have CHECK_MAP_POS instead perform the
normalization itself (depending on how confident we are of the code).
In this particular case, I'm not worried about speed but code
complexity. Having the parameter checks separate from the body of the
function simplifies things, but for the rest it shouldn't matter.
jason
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] Re: [PATCH] bug in vnotify_conn_ex() (PR#1185),
jdorje <=
|
|