[Top][All Lists]
[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: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 2/3] hw/sd.c: add SD card save/load support |
Date: |
Tue, 27 Dec 2011 21:30:16 +0000 |
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.
Plus 'bool' gives me C++ flashbacks :-)
-- PMM
- Re: [Qemu-devel] [PATCH 1/3] vmstate: introduce calc_size VMStateField, (continued)
[Qemu-devel] [PATCH V2 1/3] vmstate: introduce get_bufsize entry in VMStateField, Mitsyanko Igor, 2011/12/27
[Qemu-devel] [PATCH 2/3] hw/sd.c: add SD card save/load support, Mitsyanko Igor, 2011/12/26
[Qemu-devel] [PATCH 3/3] hw/: Introduce spec. ver. 2.00 compliant SD host controller, Mitsyanko Igor, 2011/12/26
[Qemu-devel] [PATCH V2 0/3] Improve SD controllers emulation, Mitsyanko Igor, 2011/12/28
[Qemu-devel] [PATCH V2 3/3] hw: Introduce spec. ver. 2.00 compliant SD host controller, Mitsyanko Igor, 2011/12/28