Better watch your bools in C code. In C99, the bool type of the argument to

send_bit() causes a type conversion from the value handed in to 0 or 1. This
clashed with the usage in send_byte(), that hands over a shifted byte. The
argument was converted to true when it had any value other than 0, whereas
before (where a bool simply was an int) it would have just handed over the value
directly. Therefore the logic in send_bit() that simply masked off the lowest
bit of the value would now not work anymore.
This fixes EDID failing on GCC4 and therefore fixes #2275, the last issue of
#4084 and may also affect #2780.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32593 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2009-08-22 01:03:10 +00:00
parent c3350a57ff
commit b5172954bb
+1 -1
View File
@@ -163,7 +163,7 @@ send_stop_condition(const i2c_bus *bus)
//! Send one bit
static status_t
send_bit(const i2c_bus *bus, bool bit, int timeout)
send_bit(const i2c_bus *bus, uint8 bit, int timeout)
{
status_t status;