int i;
type = arch_type (gdbarch, TYPE_CODE_ENUM, bit, name);
- TYPE_NFIELDS (type) = count;
- TYPE_FIELDS (type) = (struct field *)
- TYPE_ZALLOC (type, sizeof (struct field) * count);
+ type->set_num_fields (count);
+ type->set_fields
+ ((struct field *) TYPE_ZALLOC (type, sizeof (struct field) * count));
TYPE_UNSIGNED (type) = 1;
for (i = 0; i < count; i++)
{
TYPE_FIELD_NAME (type, i) = values[i].name;
- SET_FIELD_ENUMVAL (TYPE_FIELD (type, i), values[i].value);
+ SET_FIELD_ENUMVAL (type->field (i), values[i].value);
}
return type;