Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: PATCH change_specialist
Home

[Freeciv-Dev] Re: PATCH change_specialist

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: PATCH change_specialist
From: Reinier Post <rp@xxxxxxxxxx>
Date: Tue, 18 Dec 2001 00:03:43 +0100

On Mon, Dec 17, 2001 at 05:17:03PM +0100, Raimar Falke wrote:
> On Mon, Dec 17, 2001 at 03:13:48PM +0100, Gregor Zeitlinger wrote:
> > > Whats wrong with TRUE and FALSE?
> > I just thought, if some parts of the code will be taken to Java, it makes
> > it easier, since Java has no preprocessor.
> 
> Can sed be used for this?
> 
> > > > +typedef int boolean;
> > > A "can" or "is" in the function name is enough to indicate a boolean
> > > return type.
> > it's more clear that way. It follows the approach to make code more
> > readable. Thus, boolean indicates that only true and false are allowed and
> > any assignment statement to a boolean variable should be that way.
> 
> However in C the compiler doesn't check it. So it IMHO equivalent to
> write "return boolean" in a comment.
> 
>       Raimar

Well you can always make it a struct { int the_boolean } in DEBUG mode
and catch errors that way.  (The same can be done to catch typing
errors with the three kinds of map positions.)

-- 
Reinier


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