TYPE_LENGTH (target) = TYPE_LENGTH (real_target);
target->set_num_fields (real_target->num_fields ());
- TYPE_FIELDS (target) = (struct field *) TYPE_ALLOC (target,
- field_size);
- memcpy (TYPE_FIELDS (target),
- TYPE_FIELDS (real_target),
- field_size);
+ field *fields = (struct field *) TYPE_ALLOC (target, field_size);
+ memcpy (fields, real_target->fields (), field_size);
+ target->set_fields (fields);
if (real_target->name ())
{
type->set_name (NULL);
INIT_CPLUS_SPECIFIC (type);
TYPE_LENGTH (type) = 0;
- TYPE_FIELDS (type) = 0;
+ type->set_fields (nullptr);
type->set_num_fields (0);
}
else
type->set_name (NULL);
INIT_CPLUS_SPECIFIC (type);
TYPE_LENGTH (type) = 0;
- TYPE_FIELDS (type) = 0;
+ type->set_fields (nullptr);
type->set_num_fields (0);
}
else
type->set_code (TYPE_CODE_ENUM);
type->set_name (NULL);
TYPE_LENGTH (type) = 0;
- TYPE_FIELDS (type) = 0;
+ type->set_fields (nullptr);
type->set_num_fields (0);
}
else
/* Now create the vector of fields, and record how big it is. */
type->set_num_fields (nfields);
- TYPE_FIELDS (type) = (struct field *)
- TYPE_ALLOC (type, sizeof (struct field) * nfields);
+ type->set_fields
+ ((struct field *) TYPE_ALLOC (type, sizeof (struct field) * nfields));
/* Copy the saved-up fields into the field vector. */
TYPE_LENGTH (type) = gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT;
type->set_code (TYPE_CODE_ENUM);
type->set_num_fields (nsyms);
- TYPE_FIELDS (type) = (struct field *)
- TYPE_ALLOC (type, sizeof (struct field) * nsyms);
+ type->set_fields
+ ((struct field *) TYPE_ALLOC (type, sizeof (struct field) * nsyms));
/* Find the symbols for the values and put them into the type.
The symbols can be found in the symlist that we put them on