[Freeciv-Dev] Re: [Patch] MAPSTEP
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sat, Sep 22, 2001 at 03:26:19PM -0400, Ross W. Wetmore wrote:
> It looks good. Nice work.
>
> Minor change, you should pass (int *) as the first two arguments, and
> not ints. This does two things:
>
> 1) it alerts people to the fact that these are LValues to be returned,
>
> 2) more importantly, it makes the macro and functional form equivalent,
> so if you ever move to a more complex system, all you need to do is
> remove the macro definition.
>
> In anticipation of such a change, it might not be bad to make the names
> look more like functions when you change the two arguments, i.e.
> _mapstep(px, py, dir)
> mapstep(px, py, x0, y0, dir)
> Note this makes it much more equivalent in form to normalize_map_pos()
> which is not bad, since this is really a normalize adjacent position.
You may not believe it but I have considered this for the same
reasons. I think that the MAPSTEP code is used a lot of times. To
dodge a discussion about performance I just made it a macro. After
patching there are only 5 uses of _MAPSTEP and 15 uses of MAPSTEP
left. So it is easy work to transform the remaining in a more pleasant
form.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"Transported to a surreal landscape, a young girl kills the first woman
she meets and then teams up with three complete strangers to kill again."
-- TV listing for the Wizard of Oz in the Marin Independent Journal
- [Freeciv-Dev] Re: [Patch] MAPSTEP, (continued)
- [Freeciv-Dev] Re: [Patch] MAPSTEP, Ross W. Wetmore, 2001/09/24
- [Freeciv-Dev] Re: [Patch] MAPSTEP, Raimar Falke, 2001/09/24
- [Freeciv-Dev] Re: [Patch] MAPSTEP, Ross W. Wetmore, 2001/09/25
- [Freeciv-Dev] Re: [Patch] MAPSTEP, Gregory Berkolaiko, 2001/09/24
- [Freeciv-Dev] Re: [Patch] MAPSTEP, Raimar Falke, 2001/09/24
- [Freeciv-Dev] Re: [Patch] MAPSTEP, Ross W. Wetmore, 2001/09/25
[Freeciv-Dev] Re: [Patch] MAPSTEP, Ross W. Wetmore, 2001/09/22
- [Freeciv-Dev] Re: [Patch] MAPSTEP,
Raimar Falke <=
|
|