Re: [PATCH] df: new option: --total (-c) to produce grand total (in the
From:
Jim Meyering
Subject:
Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du)
Date:
Tue, 02 Sep 2008 13:06:33 +0200
Andreas Schwab <address@hidden> wrote:
> Jim Meyering <address@hidden> writes:
>> Kamil Dudka <address@hidden> wrote:
>>> +#define LOG_EQ(a,b) (((a)&&(b))||(!(a)&&!(b)))
>>
>> This can be written more simply as !((a) ^ (b))
>
> Only if the operands are already boolean, and then you can just use a == b.
Oh. Right. To be general, it'd have to be like this,
but this is probably too obtuse unless you're comfortable
with the "!!" pseudo operator idiom:
#define LOG_EQ(a, b) !((!!(a)) ^ (!!(b)))