]> git.proxmox.com Git - mirror_qemu.git/commit
qom: make object_ref/unref use a void * instead of Object *.
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 31 Aug 2020 21:07:23 +0000 (17:07 -0400)
committerEduardo Habkost <ehabkost@redhat.com>
Tue, 8 Sep 2020 21:29:18 +0000 (17:29 -0400)
commitc5a61e5a3c68144a421117916aef04f2c0fab84b
tree62675fd224cea1cb0e44885fad2e26426c29b512
parentacbef3cc0cefae0af0263ad675445ebba5feb385
qom: make object_ref/unref use a void * instead of Object *.

The object_ref/unref methods are intended for use with any subclass of
the base Object. Using "Object *" in the signature is not adding any
meaningful level of type safety, since callers simply use "OBJECT(ptr)"
and this expands to an unchecked cast "(Object *)".

By using "void *" we enable the object_unref() method to be used to
provide support for g_autoptr() with any subclass.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200723181410.3145233-2-berrange@redhat.com>
Message-Id: <20200831210740.126168-2-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
include/qom/object.h
qom/object.c