qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RFC 4/5] include: Move typedef qemu_irq to qemu/


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH RFC 4/5] include: Move typedef qemu_irq to qemu/typedefs.h
Date: Fri, 24 Jun 2016 14:32:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Peter Maydell <address@hidden> writes:

> On 24 June 2016 at 09:17, Paolo Bonzini <address@hidden> wrote:
>>
>>
>> On 24/06/2016 10:15, Peter Maydell wrote:
>>>>>> >>> @@ -31,6 +31,7 @@ typedef struct FWCfgState FWCfgState;
>>>>>> >>>  typedef struct HCIInfo HCIInfo;
>>>>>> >>>  typedef struct I2CBus I2CBus;
>>>>>> >>>  typedef struct I2SCodec I2SCodec;
>>>>>> >>> +typedef struct IRQState *qemu_irq;
>>>>>> >>>  typedef struct ISABus ISABus;
>>>>>> >>>  typedef struct ISADevice ISADevice;
>>>>>> >>>  typedef struct IsaDma IsaDma;
>>>>> >>
>>>>> >> Everything else in typedefs.h is a "typedef struct Thing Thing",
>>>>> >> but qemu_irq is different...
>>>> >
>>>> > We want to keep our readers on their toes!
>>> It would mean you now have to decide whether the file is orderd
>>> by the types being defined or by the underlying implementation
>>> type (previously both orders were the same)...
>>
>> Indeed, and renaming the struct is trivial because it's used in a
>> handful of places only.
>
> It would still be different by being a pointer-to-Foo, not a Foo.

Hiding pointer-ness behind a typedef is a bad idea more often than not.

What do you want me to do, if anything?



reply via email to

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