On 02/24/2012 01:58, Carlos R. Mafra wrote:
> On Fri, 24 Feb 2012 at 1:21:58 -0800, Doug Barton wrote:
>>
>> Use logical negation instead of comparison to 0 for a value that can
>> be numeric, but is null by default.
>
> This doesn't seem to be right.
>
> 'restarting' is not a pointer, it is a 'int'. If checking a int
> against zero is not allowed than you'd have many more things to
> worry about, no?
Right, but that's not what I'm seeing. I should take a step back and
combine the 2 areas that I've responded to on this thread so far.
First, when I ran the first patch I sent to print out the values of
.restarting and .norestore I was getting "(null)" for both. That is, it
looks like those values are not being properly initialized. I looked
through main.c and I found where they would be set if the relevant
options were engaged, but I didn't find any places where they were
initialized. So, the confusion about what's going on is almost certainly
my fault, since I'm *really really* short on time, and haven't had a
chance to dig deeply enough into the code.
Second, the patch that changes == 0 to logical negation "works," because
it doesn't rely on .restarting being initialized, but as this thread
points out this probably isn't the correct, or the complete solution.
Sorry if I led anyone astray.
I finally have clang built so I'll try compiling the code and see if it
has any useful insights.
Doug
--
It's always a long day; 86400 doesn't fit into a short.
Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price. :) http://SupersetSolutions.com/
--
To unsubscribe, send mail to [email protected].