[Freeciv-Dev] Re: == NULL && != NULL
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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?
My opinions:
Changing "0" to "NULL" makes things more readible.
Changing "if (ptr)" to "if (ptr != NULL)" doesn't do anything for the
code, and makes it longer as well.
Changing "0" to "FALSE" and "1" to "TRUE" makes things more readible.
Changing "int" (or whatever) to "bool[ean]" makes things much more readible.
jason
|
|