[Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#100
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Fri, Oct 12, 2001 at 07:08:30AM -0400, Jason Dorje Short wrote:
> Raimar Falke wrote:
> >
> > On Fri, Oct 12, 2001 at 05:40:13AM -0400, Jason Dorje Short wrote:
>
> <snip...>
>
> > > Upon further reflection, I really like the following change that unifies
> > > check_coords with CHECK_MAP_POS.
> > >
> > > Though we may want to rename the function check_map_pos(). It could
> > > also be made a macro, if desired.
>
> <snip...>
>
> > Rewrite it and change the name. However note that I'm still not sure
> > if this is the way to go. check_map_pos has a function call overhead
> > we don't want. So the first step in all cases is the introduction of
> > CHECK_MAP_POS. We can then argue how CHECK_MAP_POS should be
> > implemented and if it should segv or not.
>
> Unfortunately, the following macro
>
> #define CHECK_MAP_POS(x, y) \
> do { \
> if (!is_normal_map_pos(*x, *y)) { \
> assert(0); \
> if (!normalize_map_pos(x, y)) { \
> abort(); \
> } \
> } \
> } while(0)
>
> Does not seem like it will work inside map_inx:
>
> #define map_inx(x,y) \
> (CHECK_MAP_POS(&x, &y), (x)+(y)*map.xsize)
This isn't need IMHO since I think we should separately control the
check in map_inx. Something like:
#define map_inx(x,y) \
(is_normal_map_pos(x,y)? (x)+(y)*map.xsize): x/0)
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"These download files are in Microsoft Word 6.0 format. After
unzipping, these files can be viewed in any text editor, including
all versions of Microsoft Word, WordPad, and Microsoft Word Viewer."
-- http://www.microsoft.com/hwdev/pc99.htm
- [Freeciv-Dev] Remove map_adjust_[xy] invocations from server (PR#1003), jdorje, 2001/10/11
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#1003), Raimar Falke, 2001/10/12
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#1003), Thue, 2001/10/12
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations from server (PR#1003), Ross W. Wetmore, 2001/10/12
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations fromserver (PR#1003), Jason Dorje Short, 2001/10/12
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations fromserver (PR#1003), Ross W. Wetmore, 2001/10/15
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocationsfromserver (PR#1003), Jason Dorje Short, 2001/10/15
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations fromserver (PR#1003), Raimar Falke, 2001/10/15
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations fromserver (PR#1003), Ross W. Wetmore, 2001/10/15
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations fromserver (PR#1003), Raimar Falke, 2001/10/16
- [Freeciv-Dev] Re: Remove map_adjust_[xy] invocations fromserver (PR#1003), Ross W. Wetmore, 2001/10/17
|
|