qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/5] musicpal: qdevify musicpal-misc


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 2/5] musicpal: qdevify musicpal-misc
Date: Fri, 15 Feb 2013 16:14:49 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

Il 15/02/2013 14:48, Peter Maydell ha scritto:
>>> >> If you prefer we could standardize on
>>> >>   typedef struct {
>>> >>       ParentClass parent;
>>> >>   } FooClass;
>>> >>
>>> >> rather than typedef ParentClass FooClass;
>> > It may need rework either way. Because aliasing via typedef gives
>> > FooClass fields it will loose once it is turned into a real QOM class.
>> > We had such an issue with i440fx in my PHB series, that's why I'm
>> > sensitive to it. ;)
> OK, so that seems like an argument for always defining the
> empty-except-for-the-parentclass class struct, or does that
> run into problems too?

I like the empty-except-for-parentclass.  OTOH, if you have no fields
you will not use FOO_CLASS.  You will only use PARENT_CLASS, and those
uses will be fine even after you start having a FooClass.

So, having no typedef and no _CLASS macros at all is simple and should
be acceptable.

But if you have a typedef, you should a) make it a struct, b) add the
_CLASS macros.

Paolo



reply via email to

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