[Freeciv-Dev] Re: Map coordinate cleanups.
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Thu, Aug 16, 2001 at 01:47:28PM +0200, Marco Colombo wrote:
> On Thu, 16 Aug 2001, Raimar Falke wrote:
>
> > > > Maybe it is time to decide which rule freeciv should follow. I would
> > > > vote for the extra {}s.
>
> Me too, for what it counts.
> <noflames>
> But I'm on the http://www.linuxhq.com/kernel/v2.4/doc/CodingStyle.html
> side, so I disagree with most of the "Mini Style Guide" section in
> freeciv_hackers_guide.txt.
> Well, only -i2 is real horror, to tell the truth.
> </noflames>
Indeed doesn't the "Mini Style Guide" cover the brace issue.
> > > > Could this be rewritten to use ffs(3). There is no loop needed.
> > > ffs is not portable. It does not exist on mingw targets and on amigaos.
> > > (without using ixemul.library (unix emulation like cygwin.dll on
> > > windows))
> > >
> > > Or should we put a my_ffs into common/support.c?
> >
> > Yes it looks like a reasonable approach.
>
> Does it sound reasonable just to call it ffs() as in:
>
> #if !defined(HAVE_FFS)
> int
> ffs(int i)
> {
> ...
> }
> #endif
>
> My man page says ffs() is BSDish.
> Maybe a __USE_BSD is required with glibc.
At least in my string.h ffs() is surrounded by "#if defined
__USE_BSD". However it looks like this symbol is already defined. So
no problem here.
> I guess the the glibc ffs is optimized on some archs where ASM instructions
> are available to perform the task. But do we really care?
I don't care about performance. I do care about abstraction. So I'm
also happy with a "int log2(int)" method.
> Anyway, I'm not sure one should have my_* functions everytime something
> useful isn't really portable... just my 0.02.
Freeciv prefixes such cases with "my_" or "my" and I have also seen
such prefixes in other code.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"#!/usr/bin/perl -w
if ( `date +%w` != 1 ) {
die "This script only works on Mondays." ;
}"
-- from chkars.pl by Cornelius Krasel in de.comp.os.linux.misc
- [Freeciv-Dev] Re: Map coordinate cleanups., (continued)
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/20
- [Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Trent Piepho, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Gaute B Strokkenes, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Trent Piepho, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Gaute B Strokkenes, 2001/08/17
[Freeciv-Dev] Re: Map coordinate cleanups., Raimar Falke, 2001/08/16
- [Freeciv-Dev] Re: Map coordinate cleanups., Andreas Kemnade, 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 <=
- [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, 2001/08/16
[Freeciv-Dev] Re: Map coordinate cleanups., Gregory Berkolaiko, 2001/08/16
|
|