[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/17] qapi: merge QInt and QFloat in QNum
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 04/17] qapi: merge QInt and QFloat in QNum |
Date: |
Tue, 30 May 2017 09:19:51 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 |
On 05/30/2017 02:32 AM, Marc-André Lureau wrote:
> Hi
>
> On Thu, May 11, 2017 at 6:30 PM Markus Armbruster <address@hidden> wrote:
>
>> Marc-André Lureau <address@hidden> writes:
>>
>>
>>> + *
>>> + * This work is licensed under the terms of the GNU LGPL, version 2.1
>> or later.
>>> + * See the COPYING.LIB file in the top-level directory.
>>> + */
>>> +
>>> +#ifndef QNUM_H
>>> +#define QNUM_H
>>> +
>>> +#include "qapi/qmp/qobject.h"
>>> +
>>> +typedef enum {
>>> + QNUM_I64,
>>> + QNUM_DOUBLE
>>> +} QNumType;
>>
>> Not bool because you're going to add to it. Good.
>>
>>
> Hmm? There is no plan to add bool there so far, I am not sure that makes
> sense.
I think the intent was more along these lines:
"Using a two-element enum instead of a bool because a later patch will
add to the enum" (with the implication that an enum is better for
representing tri-state than a pair of bools).
At any rate, the only change I'd make is to add the trailing comma to
QNUM_DOUBLE (C99 permits trailing commas, and consistently using them
makes for less churn down the road when extending an enum).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
Re: [Qemu-devel] [PATCH 04/17] qapi: merge QInt and QFloat in QNum, Markus Armbruster, 2017/05/12
Re: [Qemu-devel] [PATCH 04/17] qapi: merge QInt and QFloat in QNum, Markus Armbruster, 2017/05/12
[Qemu-devel] [PATCH 05/17] qapi: remove promote_int, Marc-André Lureau, 2017/05/09