avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] C coding question


From: Royce Pereira
Subject: Re: [avr-gcc-list] C coding question
Date: Fri, 06 Oct 2006 18:58:33 +0530
User-agent: Opera Mail/9.02 (Win32)

Hi,
On Fri, 06 Oct 2006 13:39:36 +0530, Nigel Winterbottom <address@hidden> wrote:

>> -----Original Message-----
>> From: larry barello
>
>> Specifically I was looking for an efficient way to encode
>>
>> (bSomeBool ^ (SomeBitMask & SomeVariable))
>>
>> to get a true/false output.
> ---------------------------------
> Does it have to be an expression ?
>
> If not, what's wrong with:
>
> if (SomeBitMask & SomeVariable)
>     bSomeBool = !bSomeBool;
----------------------------------
How about:
if (SomeBitMask & SomeVariable)
        bSomeBool ^= 1;

--Royce.

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/




reply via email to

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