- struct type_class_float *float_class =
- container_of(type_class, struct type_class_float, p);
- float_type_free(float_class);
+ struct declaration_float *float_declaration;
+ struct declaration *declaration;
+
+ float_declaration = g_new(struct declaration_float, 1);
+ declaration = &float_declaration->p;
+ declaration->id = CTF_TYPE_FLOAT;
+ declaration->name = g_quark_from_string(name);
+ declaration->alignment = alignment;
+ declaration->copy = float_copy;
+ declaration->declaration_free = _float_declaration_free;
+ declaration->definition_new = _float_definition_new;
+ declaration->definition_free = _float_definition_free;
+ declaration->ref = 1;
+ float_declaration->byte_order = byte_order;
+
+ float_declaration->sign = integer_declaration_new(NULL, 1,
+ byte_order, false, 1);
+ float_declaration->mantissa = integer_declaration_new(NULL, mantissa_len - 1,
+ byte_order, false, 1);
+ float_declaration->exp = integer_declaration_new(NULL, exp_len,
+ byte_order, true, 1);
+ return float_declaration;