[sdiy] Quick C query

Steff steff at steff.name
Sun Nov 21 19:05:40 CET 2010


On 21 November 2010 17:45, cheater cheater <cheater00 at gmail.com> wrote:
>
>> if(flags == (BLARP | BAR)) { /* do stuff here */ }
>
> I think you mean:
>
> if(flags & (A | B) == (A | B)) {
>  ...
> }

You're quite right about later expansion, though I'm not sure about
the optimisation point. The former should compile to a simple
comparison and the latter to a logic op and a comparison, I think.
Been a while since I did much of this, though.

S



More information about the Synth-diy mailing list