From b5172954bb782ff46a757793c6ae330fff01e3c8 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sat, 22 Aug 2009 01:03:10 +0000 Subject: [PATCH] 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 --- src/add-ons/accelerants/common/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/add-ons/accelerants/common/i2c.c b/src/add-ons/accelerants/common/i2c.c index 0ade11e5ca..ad70391d2e 100644 --- a/src/add-ons/accelerants/common/i2c.c +++ b/src/add-ons/accelerants/common/i2c.c @@ -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;