[Freeciv-Dev] Re: PATCH change_specialist
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Mon, Dec 17, 2001 at 10:04:29PM +0100, Gregor Zeitlinger wrote:
> On Mon, 17 Dec 2001, 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?
> probably, but thats not a desirable way as it adds an extra unnecessary
> step and reduces readablity.
If you move C code to Java you have to make also other transformations
(like replacing strcpy, or the iterate macros). So this boolean
problem is your smallest problem.
> > > > > +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.
> ??? The C compiler treats it as an int, AFAIK.
Exactly. And this is the problem.
boolean a;
int b = a;
will not create an error (like java would). So the compiler can't use
the extra information.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
One nuclear bomb can ruin your whole day.
- [Freeciv-Dev] PATCH change_specialist, Gregor Zeitlinger, 2001/12/16
- [Freeciv-Dev] Re: PATCH change_specialist, Raimar Falke, 2001/12/17
- [Freeciv-Dev] Re: PATCH change_specialist, Gregor Zeitlinger, 2001/12/17
- [Freeciv-Dev] Re: PATCH change_specialist, Raimar Falke, 2001/12/17
- [Freeciv-Dev] Re: PATCH change_specialist, Gregor Zeitlinger, 2001/12/17
- [Freeciv-Dev] Re: PATCH change_specialist, Stewart Adcock, 2001/12/17
- [Freeciv-Dev] Re: PATCH change_specialist, Adam Olsen, 2001/12/17
- [Freeciv-Dev] Re: PATCH change_specialist, Gregor Zeitlinger, 2001/12/17
- [Freeciv-Dev] Re: PATCH change_specialist, Stewart Adcock, 2001/12/17
- [Freeciv-Dev] Re: PATCH change_specialist,
Raimar Falke <=
- [Freeciv-Dev] Re: PATCH change_specialist, Gregor Zeitlinger, 2001/12/18
- [Freeciv-Dev] Re: PATCH change_specialist, Raimar Falke, 2001/12/18
- [Freeciv-Dev] Re: PATCH change_specialist, Reinier Post, 2001/12/17
|
|