qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 44/58] qom: provide convenient macros for declaring and de


From: Laurent Vivier
Subject: Re: [PATCH v2 44/58] qom: provide convenient macros for declaring and defining types
Date: Thu, 20 Aug 2020 20:40:48 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Le 20/08/2020 à 19:45, Eduardo Habkost a écrit :
> (CCing Eric Blake, who reviewed the original patch.  Sorry for
> not CCing you previously, Eric)
> 
> On Wed, Aug 19, 2020 at 08:12:22PM -0400, Eduardo Habkost wrote:
> [...]
>> +/**
>> + * OBJECT_DECLARE_TYPE:
>> + * @ModuleObjName: the object name with initial capitalization
>> + * @module_obj_name: the object name in lowercase with underscore separators
>> + * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
> 
> We need to decide what to do with TYPE_SWIM:
> 
>   #define TYPE_SWIM "swim"
>   typedef struct SWIM SWIM;
>   #define SWIM(obj) OBJECT_CHECK(SWIM, (obj), TYPE_SWIM)
> 
> Both the typedef and type checking macros are called "SWIM".
> This makes usage of OBJECT_DECLARE_TYPE impossible (because the
> type checking function can't have the same as the typedef).  What
> should be the recommended style here?  Rename the struct to
> "Swim"?

"Swim" looks good to me.

Thanks,
Laurent



reply via email to

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