[Freeciv-Dev] Re: [Patch] Add BOOL_VAL around ANDs
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Dear diary, on Tue, Feb 12, 2002 at 01:34:38PM CET, I got a letter,
where Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx> told me, that...
> --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > The attached patch adds BOOL_VAL() around expressions of the form "x &
> > S_*". This is required since the result is used as a boolean but isn't
> > one.
>
> I am confused about use of special field in tile.
> It is declared as enum tile_special_type, but used as an int:
> =========================
> 1207 void map_set_special(int x, int y, enum tile_special_type spe)
> 1208 {
> 1209 MAP_TILE(x, y)->special |= spe;
> 1210
> 1211 if (spe & (S_ROAD | S_RAILROAD))
> 1212 reset_move_costs(x, y);
> 1213 }
> =========================
> Doesn't your Spliff complain about it?
>
>
> As for the patch, you might as well make a function
> bool contains_special(int tspecials, enum tile_special_type special)
> or even
> bool tile_has_special(struct *tile ptile, enum tile_special_type special)
>
> But then who cares...
Hmm, I would like tile_has_special() much more that BOOL_VAL(..). It fixes the
boolean issue _and_ raises the level of encapsulation, which is good.
--
Petr "Pasky" Baudis
* UN*X programmer && admin * IPv6 guy (XS26 co-coordinator)
* elinks maintainer * FreeCiv AI hacker
* IRCnet operator
.
I love deadlines.
I love the whooshing sound they make as they fly by.
-- Douglas Adams.
.
Public PGP key && geekcode && homepage: http://pasky.ji.cz/~pasky/
- [Freeciv-Dev] [Patch] Add BOOL_VAL around ANDs, Raimar Falke, 2002/02/11
- [Freeciv-Dev] Re: [Patch] Add BOOL_VAL around ANDs, Gregory Berkolaiko, 2002/02/12
- [Freeciv-Dev] Re: [Patch] Add BOOL_VAL around ANDs,
Petr Baudis <=
- [Freeciv-Dev] Re: [Patch] Add BOOL_VAL around ANDs, Raimar Falke, 2002/02/12
- [Freeciv-Dev] Re: [Patch] Add BOOL_VAL around ANDs, Gregory Berkolaiko, 2002/02/12
- [Freeciv-Dev] Re: [Patch] Add BOOL_VAL around ANDs, Raimar Falke, 2002/02/12
- [Freeciv-Dev] Re: [Patch] Add BOOL_VAL around ANDs, Gregory Berkolaiko, 2002/02/12
- [Freeciv-Dev] Re: [Patch] Add BOOL_VAL around ANDs, Ross W. Wetmore, 2002/02/16
- [Freeciv-Dev] Re: [Patch] Add BOOL_VAL around ANDs, Petr Baudis, 2002/02/17
- [Freeciv-Dev] Re: [Patch] Add BOOL_VAL around ANDs, Gregory Berkolaiko, 2002/02/17
- [Freeciv-Dev] Re: [Patch] Add BOOL_VAL around ANDs, Vasco Alexandre Da Silva Costa, 2002/02/12
[Freeciv-Dev] Re: [Patch] Add BOOL_VAL around ANDs, Raimar Falke, 2002/02/12
|
|