[Openchrome-devel] [PATCH v2] Properly use bitwise operators in viaProbePinStrapping
Mario J. Rugiero
mrugiero at gmail.com
Tue Jun 21 06:30:07 UTC 2016
El 21/06/16 a las 03:04, Kevin Brace escribió:
> Hi Mario,
> By the way, the swtich statement thing was already fixed.
> For an if statement, it is the expectation that logical operators are going to be used since an if statement is ultimately looking for a true or false.
> I used the language correctly in this case, and I do not like wasting time on small issues like this.
> OpenChrome still has too many problems in the code.
> Kevin Brace
> P.S. Mario, I prefer if you do not keep sending HTML e-mails to OpenChrome mailing lists since the mailing list does not like HTML e-mails.
>> Your link isn't really valid in this context. The logical equivalence applies to singular bits, not to a multibit value.0x10 & 0x01 evaluates to 0x00 (== false), while 0x10 && 0x01 evaluates to 0x01 (a true value).Those switch statements will always end up in cases 0 or 1.
>> Further, logical operators && and || are lazy, while bitwise operators & and | are not.
Errata: read the nibbles as bytes. Should say 5th and 6th bits.
More information about the Openchrome-devel