qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/3] hw/sd.c: add SD card save/load support


From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH 2/3] hw/sd.c: add SD card save/load support
Date: Wed, 28 Dec 2011 11:50:43 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0

On 12/27/2011 11:30 PM, Peter Maydell wrote:
> On 27 December 2011 14:13, Avi Kivity <address@hidden> 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.

We should change those too.  bool is self-documenting.

> Plus 'bool' gives me C++ flashbacks :-)

And QOM doesn't?  How about
glue(glue(glue(cirrus_colorexpand_pattern_transp_, ROP_NAME), _),DEPTH)?

-- 
error compiling committee.c: too many arguments to function




reply via email to

[Prev in Thread] Current Thread [Next in Thread]