qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/4] checkpatch: adapt some tests to QEMU


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 3/4] checkpatch: adapt some tests to QEMU
Date: Fri, 18 Sep 2015 08:53:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eric Blake <address@hidden> writes:

> On 09/17/2015 10:32 AM, Paolo Bonzini wrote:
>
>>>>> Can we revert this one, please? Checkpatch now warns about constructs
>>>>> like
>>>>>   typedef struct MyDevice {
>>>>>       DeviceState parent;
>>>>>
>>>>>       int reg0, reg1, reg2;
>>>>>   } MyDevice;
>>>>
>>>> It's interesting that qom/object.h documents this and start like:
>>>>
>>>> typedef struct ObjectClass ObjectClass;
>
>> I think it varies depending on the maintainer.  PPC, USB, SCSI, ACPI all
>> use a separate typedef.  I'll prepare a revert.
>
> And qapi is about to switch from inline to separate:
>
> https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg04291.html

For a technical reason: DRY in the generator source code.

For some types, we need the typedef name declared in one place, and the
struct defined in another.  Instead of having two variants, one for
separate typedef / struct and one for combined, plus the logic to decide
which one to use, we simply generate separate always.



reply via email to

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