Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: == NULL && != NULL
Home

[Freeciv-Dev] Re: == NULL && != NULL

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: == NULL && != NULL
From: Vasco Alexandre Da Silva Costa <vasc@xxxxxxxxxxxxxx>
Date: Sun, 10 Feb 2002 16:53:04 +0000 (WET)

On Sun, 10 Feb 2002, Raimar Falke wrote:

> On Sun, Feb 10, 2002 at 01:15:40AM +0000, Vasco Alexandre Da Silva Costa 
> wrote:
> > 
> > Why the extra cruft?
> 
> For the same reason as the previous s/0/NULL/ change: to make it explicit.
> 
> > Is it to make the new lint happy?
> 
> Yes. And to allow other changes like the introduction of bool types.
> 
> > It isn't necessary according to the ANSI C spec.
> 
> Correct.
> 
> > Wasn't there any switch to disable it?
> 
> Yes there is one.
> 
> > I can live with it, but its annoying.
> 
> About bool types: I will commit today or tomorrow a patch which
> changes 0 to FALSE and 1 to TRUE. But this will only be the first
> step. The next step is the introduction of an type bool. Comments?

I have no problems whatsoever with switching 0 --> FALSE, 1 --> TRUE, 0
--> NULL. I usually do that anyway.

What i dislike is the extra comparisons in the branch tests. It clutters
them up for no valid reason IMHO. Will it also be required to change: "if
(a > b)" to "if ((a > b) == TRUE)" ???

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa





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