On 27 December 2011 14:13, Avi Kivity <a...@redhat.com> wrote: > On 12/26/2011 04:58 PM, Peter Maydell wrote: >> > void sd_enable(SDState *sd, int enable) >> > { >> > - sd->enable = enable; >> > + sd->enable = enable ? true : false; >> >> This kind of thing is why I don't like bool :-) > > /me leaps to bool's defence: > > sd->enable = enable should work just fine.
This is true, but the code snippet also illustrates that it sits oddly to have the internal state variable be bool when the external facing function's API is clearly using the traditional C style of int-for-booleans. Plus 'bool' gives me C++ flashbacks :-) -- PMM