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: Petr Baudis <pasky@xxxxxxxxxxx>
Cc: Vasco Alexandre Da Silva Costa <vasc@xxxxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: == NULL && != NULL
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 10 Feb 2002 20:33:33 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sun, Feb 10, 2002 at 08:14:42PM +0100, Petr Baudis wrote:
> Dear diary, on Sun, Feb 10, 2002 at 10:27:21AM CET, I got a letter,
> where Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> told me, that...
> > 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.
> 
> And what's the value of making this explicit? It's ok for integer values, but 
> I
> believe it has no great value for pointers. Some level of 'explicity' is good,
> but too much explicit stuff makes code exponentially less readable and longer
> and way too verbose.
> 
> At least I believe that such a relatively major change should be first
> discussed on the mailing list and general consensus should be reached.
> According to the reactions it looks more people are unhappy than happy (the
> unhappy people are usually more active and visible than the happy, though ;). 
> I
> would probably send more NULLs^Wworkers back home (and make elvises from 
> them).

Yes I see that the application of the patch was precipitate. If there
is a consensus reach it can be backed out.

> > > Is it to make the new lint happy?
> > 
> > Yes. And to allow other changes like the introduction of bool types.
> 
> In which way it will help booleans?

To reduce warnings on ifs that the expression isn't boolean. It may be
possible that it is possible that this can be disabled for pointer
comparison. I haven't tested it.

> > > 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'm ok with the boolean.

First step is applied. Next step will be smaller and be posted here.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  "brand memory are for windows users that think their stability
   problems come from the memory"
    -- bomek in #freeciv


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