- struct type_class_float *float_class;
- struct type_class *type_class;
- int ret;
-
- float_class = g_new(struct type_class_float, 1);
- type_class = &float_class->p;
- type_class->name = g_quark_from_string(name);
- type_class->alignment = alignment;
- type_class->copy = float_copy;
- type_class->class_free = _float_type_class_free;
- type_class->type_new = _float_type_new;
- type_class->type_free = _float_type_free;
- type_class->ref = 1;
- float_class->byte_order = byte_order;
-
- float_class->sign = integer_type_new(NULL, 1,
- byte_order, false, 1);
- if (!float_class->mantissa)
- goto error_sign;
- float_class->mantissa = integer_type_new(NULL, mantissa_len - 1,
- byte_order, false, 1);
- if (!float_class->mantissa)
- goto error_mantissa;
- float_class->exp = integer_type_new(NULL, exp_len,
- byte_order, true, 1);
- if (!float_class->exp)
- goto error_exp;
-
- if (float_class->p.name) {
- ret = register_type(&float_class->p);
- if (ret)
- goto error_register;
- }
- return float_class;
-
-error_register:
- type_class_unref(&float_class->exp->p);
-error_exp:
- type_class_unref(&float_class->mantissa->p);
-error_mantissa:
- type_class_unref(&float_class->sign->p);
-error_sign:
- g_free(float_class);
- return NULL;
+ struct type_float *float_type;
+ struct type *type;
+
+ float_type = g_new(struct type_float, 1);
+ type = &float_type->p;
+ type->name = g_quark_from_string(name);
+ type->alignment = alignment;
+ type->copy = float_copy;
+ type->type_free = _float_type_free;
+ type->declaration_new = _float_declaration_new;
+ type->declaration_free = _float_declaration_free;
+ type->ref = 1;
+ float_type->byte_order = byte_order;
+
+ float_type->sign = integer_type_new(NULL, 1,
+ byte_order, false, 1);
+ float_type->mantissa = integer_type_new(NULL, mantissa_len - 1,
+ byte_order, false, 1);
+ float_type->exp = integer_type_new(NULL, exp_len,
+ byte_order, true, 1);
+ return float_type;