Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: [PATCH] is_normal_tile function
Home

[Freeciv-Dev] Re: [PATCH] is_normal_tile function

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] is_normal_tile function
From: Asher Densmore-Lynn <jesdynf@xxxxxx>
Date: Wed, 15 Aug 2001 14:22:13 -0700

At 09:58 PM 8/15/01 +0100, you wrote:

>> > > +int is_normal_tile(int x, int y)
>> > > +{
>> > > +  return 0 <= y && y < map.ysize && 0 <= x && x < map.xsize;
>> > > +}

>I don't like it either but since it's virtually everywhere in Ross' patch
>and I'm sure it's going to be accepted sooner or later, maybe things
>should be more uniform?

It took me a few seconds to get that function...

But really, all it needs is parentheses, right?

return (0 <= y) && (y < map.ysize) && (0 <= x) && (x < map.xsize);

That looks good to me... don't think we -really- need to cast everything as
well.

Though for preference, I'd rearrange it.

return (y > 0) && (y < map.ysize) && (x > 0) && (x < map.xsize);


--
Asher Densmore-Lynn <jesdynf@xxxxxx>


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