- variant_class = g_new(struct type_class_variant, 1);
- type_class = &variant_class->p;
- variant_class->fields_by_tag = g_hash_table_new(g_direct_hash,
- g_direct_equal);
- variant_class->fields = g_array_sized_new(FALSE, TRUE,
- sizeof(struct type_class_field),
- DEFAULT_NR_STRUCT_FIELDS);
- type_class->name = g_quark_from_string(name);
- type_class->alignment = 1;
- type_class->copy = variant_copy;
- type_class->class_free = _variant_type_class_free;
- type_class->type_new = _variant_type_new;
- type_class->type_free = _variant_type_free;
- type_class->ref = 1;
-
- if (type_class->name) {
- ret = register_type(type_class);
+ variant_type = g_new(struct type_variant, 1);
+ type = &variant_type->p;
+ variant_type->fields_by_tag = g_hash_table_new(g_direct_hash,
+ g_direct_equal);
+ variant_type->fields = g_array_sized_new(FALSE, TRUE,
+ sizeof(struct type_field),
+ DEFAULT_NR_STRUCT_FIELDS);
+ type->name = g_quark_from_string(name);
+ type->alignment = 1;
+ type->copy = variant_copy;
+ type->type_free = _variant_type_free;
+ type->declaration_new = _variant_declaration_new;
+ type->declaration_free = _variant_declaration_free;
+ type->ref = 1;
+
+ if (type->name) {
+ ret = register_type(type);