- v = fsrc->int_read(src, int_class->len, int_class->byte_order);
- return fdest->int_write(dest, int_class->len, int_class->byte_order, v);
- }
+ 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;