Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2000:
[Freeciv-Dev] Re: [PATCH] Re: Short stupid question (PR#569)
Home

[Freeciv-Dev] Re: [PATCH] Re: Short stupid question (PR#569)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Erik Sigra <freeciv@xxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] Re: Short stupid question (PR#569)
From: Gaute B Strokkenes <gs234@xxxxxxxxx>
Date: 24 Sep 2000 14:59:39 +0200

Erik Sigra <freeciv@xxxxxxx> writes:

> Gaute B Strokkenes wrote:
> > 
> > Erik Sigra <freeciv@xxxxxxx> writes:
> > 
> > > In server/mapgen.c:
> > 
> > > Is the use of "*hmap(x, y)" equivalent to the use of "full_map(x, y)"?
> > 
> > That's not at all a stupid question.  Answer: Yes (bet you're really
> > surprised now, eh? 8-) except that full_map() doesn't check if it
> > should normalise the x-coordinate, which I think is probably a bug
> > since there are lots of calls along the lines of full_map(x-1, y)
> > (well, not directly, but indirectly through e.g. make_dessert() etc.)
> > 
> > Here's a patch to clean up the mess:
> 
> Thanks. I read it and it looks cleaner with your patch. I was going to
> compile it as well but there was an unrelated error in the way (see my
> previous post) that stopped me. I see no reason not to commit it if it
> works.
> 
> #define hmap(x,y) (height_map[(y) * map.xsize + map_adjust_x(x)])
>                   ^                                             ^
> Are thoose parentheses really neccessary?

Don't know.  I can't think of an operator with a higher priority than
[] that would case trouble, but I didn't bother to look it up in a
table.  They certainly don't hurt.

-- 
Big Gaute (not to be confused with LG)
Are you mentally here at Pizza Hut??



[Prev in Thread] Current Thread [Next in Thread]