aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-09-16 14:25:16 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-09-18 14:12:32 -0400
commitc734cd40a10943753a4d015c9d0a6c08c8f0159e (patch)
treef3a0e5e0152e85da0f0d0bc4bb48eef2198867c4 /ui
parent4a15e5bef8ec4322d4192dc4ab0b6149d415b990 (diff)
qom: Remove ParentClassType argument from OBJECT_DECLARE_SIMPLE_TYPE
The requirement to specify the parent class type makes the macro harder to use and easy to misuse (silent bugs can be introduced if the wrong struct type is specified). Simplify the macro by just not declaring any class struct, allowing us to remove the class_size field from the TypeInfo variables for those types. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200916182519.415636-3-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/input-barrier.c3
-rw-r--r--ui/input-linux.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/ui/input-barrier.c b/ui/input-barrier.c
index 87543a3399..b76697be93 100644
--- a/ui/input-barrier.c
+++ b/ui/input-barrier.c
@@ -21,7 +21,7 @@
#define TYPE_INPUT_BARRIER "input-barrier"
OBJECT_DECLARE_SIMPLE_TYPE(InputBarrier, input_barrier,
- INPUT_BARRIER, ObjectClass)
+ INPUT_BARRIER)
#define MAX_HELLO_LENGTH 1024
@@ -723,7 +723,6 @@ static void input_barrier_class_init(ObjectClass *oc, void *data)
static const TypeInfo input_barrier_info = {
.name = TYPE_INPUT_BARRIER,
.parent = TYPE_OBJECT,
- .class_size = sizeof(InputBarrierClass),
.class_init = input_barrier_class_init,
.instance_size = sizeof(InputBarrier),
.instance_init = input_barrier_instance_init,
diff --git a/ui/input-linux.c b/ui/input-linux.c
index 5d501c8360..f02557b012 100644
--- a/ui/input-linux.c
+++ b/ui/input-linux.c
@@ -32,7 +32,7 @@ static bool linux_is_button(unsigned int lnx)
#define TYPE_INPUT_LINUX "input-linux"
OBJECT_DECLARE_SIMPLE_TYPE(InputLinux, input_linux,
- INPUT_LINUX, ObjectClass)
+ INPUT_LINUX)
struct InputLinux {
@@ -514,7 +514,6 @@ static void input_linux_class_init(ObjectClass *oc, void *data)
static const TypeInfo input_linux_info = {
.name = TYPE_INPUT_LINUX,
.parent = TYPE_OBJECT,
- .class_size = sizeof(InputLinuxClass),
.class_init = input_linux_class_init,
.instance_size = sizeof(InputLinux),
.instance_init = input_linux_instance_init,