Am 11.04.2012 23:30, schrieb Paolo Bonzini:
> Right now the base Object class has a special NULL type.  Change this so
> that we will be able to add class_init and class_base_init callbacks.
> To do this, remove some special casing of ObjectClass that is not really
> necessary.
> 
> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
> ---
>  include/qemu/object.h |    2 +-
>  qom/object.c          |   59 
> +++++++++++++++++++++++++------------------------
>  2 files changed, 31 insertions(+), 30 deletions(-)
[...]
> diff --git a/qom/object.c b/qom/object.c
> index 6ff1c19..585619d 100644
> --- a/qom/object.c
> +++ b/qom/object.c
[...]
> @@ -1233,3 +1214,23 @@ void object_property_add_str(Object *obj, const char 
> *name,
>                          property_release_str,
>                          prop, errp);
>  }
> +
> +static void register_types(void)
> +{
> +    static TypeInfo interface_info = {
> +        .name = TYPE_INTERFACE,
> +        .instance_size = sizeof(Interface),
> +        .abstract = true,
> +    };
> +
> +    static TypeInfo object_info = {
> +        .name = TYPE_OBJECT,
> +        .instance_size = sizeof(Object),
> +        .abstract = true,
> +    };
> +
> +    type_interface = type_register_static(&interface_info);
> +    type_register_static(&object_info);
> +}
> +
> +type_init(register_types)

I think I had suggested static const and moving them to before the
register_types() function?

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

Reply via email to