[Freeciv-Dev] Re: Map coordinate cleanups.
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Thu, 16 Aug 2001, Gaute B Strokkenes wrote:
> >
> > Maybe it is time to decide which rule freeciv should follow. I would
> > vote for the extra {}s.
>
> I vote against, obviously. But I don't feel very strongly about it.
> I suspect that there is already a rule for this: the style guide
> mandates K&R style, so someone who cares can go and look it up and
> then tell the rest of us what it is.
Back when we came up with the style guidlines, the main idea was to be
consistant with that was written already. Lots of code doesn't use the extra
braces, so that should be considered ok.
> They don't. get_tile_type() takes a terrain identifies and returns a
> struct describing that terrain, without any error checking. An array
> look-up is a perfectly acceptable, commonplace idiom to go from a FOO
> identifier to FOO_TYPE descriptor struct. Moreover, if you use the
The thing is, that might no always be the case. What if something is changed
from an array to a linked-list or a hash table? Then an array lookup won't
work. It's better to plan ahead than to do something you know is going to
need to be fixed in the future.
> dislike about Freeciv is the way that there seems to be no rhyme or
> reason to which of the map_get_* and associated functions check and/or
> repair their arguements.)
There isn't supposed to be any checing or repair. The functions that do have
it are because it was a kludge fix to code that wasn't checking when it called
them.
>
> in a clean source tree. Direct access to tile_types outnumber
> get_tile_type() calls by two to one.
That's because get_tile_type was created later. All the existing code should
have been changed to use it, but that didn't happen.
- [Freeciv-Dev] Re: Map coordinate cleanups., (continued)
- [Freeciv-Dev] Re: Map coordinate cleanups., Marco Colombo, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Marco Colombo, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Kevin Brown, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Marco Colombo, 2001/08/16
[Freeciv-Dev] Re: Map coordinate cleanups., Gaute B Strokkenes, 2001/08/16
[Freeciv-Dev] Re: Map coordinate cleanups., Kevin Brown, 2001/08/16
[Freeciv-Dev] Re: Map coordinate cleanups.,
Trent Piepho <=
[Freeciv-Dev] Re: Map coordinate cleanups., Gregory Berkolaiko, 2001/08/16
Message not available
|
|