- int_class = g_new(struct type_class_integer, 1);
- int_class->p.name = g_quark_from_string(name);
- int_class->p.alignment = alignment;
- int_class->p.copy = integer_copy;
- int_class->len = len;
- int_class->byte_order = byte_order;
- int_class->signedness = signedness;
- if (int_class->p.name) {
- ret = ctf_register_type(&int_class.p);
- if (ret) {
- g_free(int_class);
- return NULL;
- }
- }
- return int_class;
+ integer = g_new(struct definition_integer, 1);
+ declaration_ref(&integer_declaration->p);
+ integer->p.declaration = declaration;
+ integer->declaration = integer_declaration;
+ integer->p.ref = 1;
+ /*
+ * Use INT_MAX order to ensure that all fields of the parent
+ * scope are seen as being prior to this scope.
+ */
+ integer->p.index = root_name ? INT_MAX : index;
+ integer->p.name = field_name;
+ integer->p.path = new_definition_path(parent_scope, field_name,
+ root_name);
+ integer->p.scope = NULL;
+ integer->value._unsigned = 0;
+ ret = register_field_definition(field_name, &integer->p,
+ parent_scope);
+ assert(!ret);
+ return &integer->p;