On Fri, Jul 24, 2015 at 01:55:30PM +0200, Lars-Peter Clausen wrote: > On 07/24/2015 01:48 PM, Lars Persson wrote: > >No this is a misunderstanding about the semantics of the bool type. > >When assigning to the bool any non-zero value becomes 1. > >When comparing an integer against the bool, the bool is promoted to an > >integer. > From the patch context alone it is not clear that oldbit is of type bool. I > think this is where the confusion came from. By just looking at the path > fragment itself you'd think that oldbit is a unsigned int given its usage > pattern. But it becomes obvious that the code wont work if you know oldbit > is a bool. ...and obviously the clear intention is that it should be an unsigned integer so the appropriate thing to do is to fix that.
Attachment:
signature.asc
Description: Digital signature