[Top][All Lists]

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

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

From: Paulo Marques
Subject: Re: [avr-gcc-list] C coding question
Date: Mon, 09 Oct 2006 11:38:39 +0100
User-agent: Thunderbird (X11/20060909)

larry barello wrote:
So I said:

(bSomeBool?1:0) ^ ((SomeBitMask & SomeVariable)?1:0))

Since no one else made this comment, I just wanted to point out that you can write that as:

(bSomeBool ^ (!!(SomeBitMask & SomeVariable)))

"!!" is often used to convert an integer value into a logical (0/1) value. Maybe it is easier to the compiler than "?1:0".

Paulo Marques
Software Development Department - Grupo PIE, S.A.
Phone: +351 252 290600, Fax: +351 252 290601
Web: www.grupopie.com

"The face of a child can say it all, especially the
mouth part of the face."

reply via email to

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