mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros
One of the goals of having less boilerplate on QOM declarations is to avoid human error. Requiring an extra argument that is never used is an opportunity for mistakes. Remove the unused argument from OBJECT_DECLARE_TYPE and OBJECT_DECLARE_SIMPLE_TYPE. Coccinelle patch used to convert all users of the macros: @@ declarer name OBJECT_DECLARE_TYPE; identifier InstanceType, ClassType, lowercase, UPPERCASE; @@ OBJECT_DECLARE_TYPE(InstanceType, ClassType, - lowercase, UPPERCASE); @@ declarer name OBJECT_DECLARE_SIMPLE_TYPE; identifier InstanceType, lowercase, UPPERCASE; @@ OBJECT_DECLARE_SIMPLE_TYPE(InstanceType, - lowercase, UPPERCASE); Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Acked-by: Cornelia Huck <cohuck@redhat.com> Acked-by: Igor Mammedov <imammedo@redhat.com> Acked-by: Paul Durrant <paul@xen.org> Acked-by: Thomas Huth <thuth@redhat.com> Message-Id: <20200916182519.415636-4-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
c734cd40a1
commit
30b5707c26
74 changed files with 75 additions and 77 deletions
|
@ -614,7 +614,6 @@ struct Object
|
|||
* OBJECT_DECLARE_TYPE:
|
||||
* @InstanceType: instance struct name
|
||||
* @ClassType: class struct name
|
||||
* @module_obj_name: the object name in lowercase with underscore separators
|
||||
* @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
|
||||
*
|
||||
* This macro is typically used in a header file, and will:
|
||||
|
@ -625,7 +624,7 @@ struct Object
|
|||
*
|
||||
* The object struct and class struct need to be declared manually.
|
||||
*/
|
||||
#define OBJECT_DECLARE_TYPE(InstanceType, ClassType, module_obj_name, MODULE_OBJ_NAME) \
|
||||
#define OBJECT_DECLARE_TYPE(InstanceType, ClassType, MODULE_OBJ_NAME) \
|
||||
typedef struct InstanceType InstanceType; \
|
||||
typedef struct ClassType ClassType; \
|
||||
\
|
||||
|
@ -637,7 +636,6 @@ struct Object
|
|||
/**
|
||||
* OBJECT_DECLARE_SIMPLE_TYPE:
|
||||
* @InstanceType: instance struct name
|
||||
* @module_obj_name: the object name in lowercase with underscore separators
|
||||
* @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
|
||||
*
|
||||
* This does the same as OBJECT_DECLARE_TYPE(), but with no class struct
|
||||
|
@ -646,7 +644,7 @@ struct Object
|
|||
* This macro should be used unless the class struct needs to have
|
||||
* virtual methods declared.
|
||||
*/
|
||||
#define OBJECT_DECLARE_SIMPLE_TYPE(InstanceType, module_obj_name, MODULE_OBJ_NAME) \
|
||||
#define OBJECT_DECLARE_SIMPLE_TYPE(InstanceType, MODULE_OBJ_NAME) \
|
||||
typedef struct InstanceType InstanceType; \
|
||||
\
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(InstanceType, object_unref) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue