@@ -571,7 +571,7 @@ ada_get_field_index (const struct type *type, const char *field_name,
571
571
int fieldno ;
572
572
struct type * struct_type = check_typedef ((struct type * ) type );
573
573
574
- for (fieldno = 0 ; fieldno < TYPE_NFIELDS ( struct_type ); fieldno ++ )
574
+ for (fieldno = 0 ; fieldno < struct_type -> num_fields ( ); fieldno ++ )
575
575
if (field_name_match (TYPE_FIELD_NAME (struct_type , fieldno ), field_name ))
576
576
return fieldno ;
577
577
@@ -755,7 +755,7 @@ ada_discrete_type_high_bound (struct type *type)
755
755
case TYPE_CODE_RANGE :
756
756
return TYPE_HIGH_BOUND (type );
757
757
case TYPE_CODE_ENUM :
758
- return TYPE_FIELD_ENUMVAL (type , TYPE_NFIELDS ( type ) - 1 );
758
+ return TYPE_FIELD_ENUMVAL (type , type -> num_fields ( ) - 1 );
759
759
case TYPE_CODE_BOOL :
760
760
return 1 ;
761
761
case TYPE_CODE_CHAR :
@@ -1461,7 +1461,7 @@ ada_fixup_array_indexes_type (struct type *index_desc_type)
1461
1461
1462
1462
if (index_desc_type == NULL )
1463
1463
return ;
1464
- gdb_assert (TYPE_NFIELDS ( index_desc_type ) > 0 );
1464
+ gdb_assert (index_desc_type -> num_fields ( ) > 0 );
1465
1465
1466
1466
/* Check if INDEX_DESC_TYPE follows the older encoding (it is sufficient
1467
1467
to check one field only, no need to check them all). If not, return
@@ -1476,7 +1476,7 @@ ada_fixup_array_indexes_type (struct type *index_desc_type)
1476
1476
return ;
1477
1477
1478
1478
/* Fixup each field of INDEX_DESC_TYPE. */
1479
- for (i = 0 ; i < TYPE_NFIELDS ( index_desc_type ); i ++ )
1479
+ for (i = 0 ; i < index_desc_type -> num_fields ( ); i ++ )
1480
1480
{
1481
1481
const char * name = TYPE_FIELD_NAME (index_desc_type , i );
1482
1482
struct type * raw_type = ada_check_typedef (ada_find_any_type (name ));
@@ -1807,7 +1807,7 @@ desc_arity (struct type *type)
1807
1807
type = desc_base_type (type );
1808
1808
1809
1809
if (type != NULL )
1810
- return TYPE_NFIELDS ( type ) / 2 ;
1810
+ return type -> num_fields ( ) / 2 ;
1811
1811
return 0 ;
1812
1812
}
1813
1813
@@ -3206,12 +3206,12 @@ ada_print_symbol_signature (struct ui_file *stream, struct symbol *sym,
3206
3206
|| type -> code () != TYPE_CODE_FUNC )
3207
3207
return ;
3208
3208
3209
- if (TYPE_NFIELDS ( type ) > 0 )
3209
+ if (type -> num_fields ( ) > 0 )
3210
3210
{
3211
3211
int i ;
3212
3212
3213
3213
fprintf_filtered (stream , " (" );
3214
- for (i = 0 ; i < TYPE_NFIELDS ( type ); ++ i )
3214
+ for (i = 0 ; i < type -> num_fields ( ); ++ i )
3215
3215
{
3216
3216
if (i > 0 )
3217
3217
fprintf_filtered (stream , "; " );
@@ -3897,7 +3897,7 @@ ada_args_match (struct symbol *func, struct value **actuals, int n_actuals)
3897
3897
else if (func_type == NULL || func_type -> code () != TYPE_CODE_FUNC )
3898
3898
return 0 ;
3899
3899
3900
- if (TYPE_NFIELDS ( func_type ) != n_actuals )
3900
+ if (func_type -> num_fields ( ) != n_actuals )
3901
3901
return 0 ;
3902
3902
3903
3903
for (i = 0 ; i < n_actuals ; i += 1 )
@@ -4958,7 +4958,7 @@ is_nondebugging_type (struct type *type)
4958
4958
4959
4959
This function assumes that TYPE1 and TYPE2 are both TYPE_CODE_ENUM
4960
4960
types and that their number of enumerals is identical (in other
4961
- words, TYPE_NFIELDS (type1 ) == TYPE_NFIELDS (type2 )). */
4961
+ words, type1->num_fields ( ) == type2->num_fields ( )). */
4962
4962
4963
4963
static int
4964
4964
ada_identical_enum_types_p (struct type * type1 , struct type * type2 )
@@ -4971,13 +4971,13 @@ ada_identical_enum_types_p (struct type *type1, struct type *type2)
4971
4971
underlying value and name. */
4972
4972
4973
4973
/* All enums in the type should have an identical underlying value. */
4974
- for (i = 0 ; i < TYPE_NFIELDS ( type1 ); i ++ )
4974
+ for (i = 0 ; i < type1 -> num_fields ( ); i ++ )
4975
4975
if (TYPE_FIELD_ENUMVAL (type1 , i ) != TYPE_FIELD_ENUMVAL (type2 , i ))
4976
4976
return 0 ;
4977
4977
4978
4978
/* All enumerals should also have the same name (modulo any numerical
4979
4979
suffix). */
4980
- for (i = 0 ; i < TYPE_NFIELDS ( type1 ); i ++ )
4980
+ for (i = 0 ; i < type1 -> num_fields ( ); i ++ )
4981
4981
{
4982
4982
const char * name_1 = TYPE_FIELD_NAME (type1 , i );
4983
4983
const char * name_2 = TYPE_FIELD_NAME (type2 , i );
@@ -5040,8 +5040,8 @@ symbols_are_identical_enums (const std::vector<struct block_symbol> &syms)
5040
5040
5041
5041
/* Quick check: They should all have the same number of enumerals. */
5042
5042
for (i = 1 ; i < syms .size (); i ++ )
5043
- if (TYPE_NFIELDS ( SYMBOL_TYPE (syms [i ].symbol ))
5044
- != TYPE_NFIELDS ( SYMBOL_TYPE (syms [0 ].symbol )))
5043
+ if (SYMBOL_TYPE (syms [i ].symbol )-> num_fields ( )
5044
+ != SYMBOL_TYPE (syms [0 ].symbol )-> num_fields ( ))
5045
5045
return 0 ;
5046
5046
5047
5047
/* All the sanity checks passed, so we might have a set of
@@ -6527,7 +6527,7 @@ ada_is_interface_tag (struct type *type)
6527
6527
int
6528
6528
ada_is_ignored_field (struct type * type , int field_num )
6529
6529
{
6530
- if (field_num < 0 || field_num > TYPE_NFIELDS ( type ))
6530
+ if (field_num < 0 || field_num > type -> num_fields ( ))
6531
6531
return 1 ;
6532
6532
6533
6533
/* Check the name of that field. */
@@ -6863,7 +6863,7 @@ ada_parent_type (struct type *type)
6863
6863
if (type == NULL || type -> code () != TYPE_CODE_STRUCT )
6864
6864
return NULL ;
6865
6865
6866
- for (i = 0 ; i < TYPE_NFIELDS ( type ); i += 1 )
6866
+ for (i = 0 ; i < type -> num_fields ( ); i += 1 )
6867
6867
if (ada_is_parent_field (type , i ))
6868
6868
{
6869
6869
struct type * parent_type = TYPE_FIELD_TYPE (type , i );
@@ -7226,7 +7226,7 @@ find_struct_field (const char *name, struct type *type, int offset,
7226
7226
if (bit_size_p != NULL )
7227
7227
* bit_size_p = 0 ;
7228
7228
7229
- for (i = 0 ; i < TYPE_NFIELDS ( type ); i += 1 )
7229
+ for (i = 0 ; i < type -> num_fields ( ); i += 1 )
7230
7230
{
7231
7231
int bit_pos = TYPE_FIELD_BITPOS (type , i );
7232
7232
int fld_offset = offset + bit_pos / 8 ;
@@ -7278,7 +7278,7 @@ find_struct_field (const char *name, struct type *type, int offset,
7278
7278
struct type * field_type
7279
7279
= ada_check_typedef (TYPE_FIELD_TYPE (type , i ));
7280
7280
7281
- for (j = 0 ; j < TYPE_NFIELDS ( field_type ); j += 1 )
7281
+ for (j = 0 ; j < field_type -> num_fields ( ); j += 1 )
7282
7282
{
7283
7283
if (find_struct_field (name , TYPE_FIELD_TYPE (field_type , j ),
7284
7284
fld_offset
@@ -7338,7 +7338,7 @@ ada_search_struct_field (const char *name, struct value *arg, int offset,
7338
7338
int parent_offset = -1 ;
7339
7339
7340
7340
type = ada_check_typedef (type );
7341
- for (i = 0 ; i < TYPE_NFIELDS ( type ); i += 1 )
7341
+ for (i = 0 ; i < type -> num_fields ( ); i += 1 )
7342
7342
{
7343
7343
const char * t_field_name = TYPE_FIELD_NAME (type , i );
7344
7344
@@ -7381,7 +7381,7 @@ ada_search_struct_field (const char *name, struct value *arg, int offset,
7381
7381
i ));
7382
7382
int var_offset = offset + TYPE_FIELD_BITPOS (type , i ) / 8 ;
7383
7383
7384
- for (j = 0 ; j < TYPE_NFIELDS ( field_type ); j += 1 )
7384
+ for (j = 0 ; j < field_type -> num_fields ( ); j += 1 )
7385
7385
{
7386
7386
struct value * v = ada_search_struct_field /* Force line
7387
7387
break. */
@@ -7439,7 +7439,7 @@ ada_index_struct_field_1 (int *index_p, struct value *arg, int offset,
7439
7439
int i ;
7440
7440
type = ada_check_typedef (type );
7441
7441
7442
- for (i = 0 ; i < TYPE_NFIELDS ( type ); i += 1 )
7442
+ for (i = 0 ; i < type -> num_fields ( ); i += 1 )
7443
7443
{
7444
7444
if (TYPE_FIELD_NAME (type , i ) == NULL )
7445
7445
continue ;
@@ -7532,7 +7532,7 @@ ada_lookup_struct_elt_type (struct type *type, const char *name, int refok,
7532
7532
7533
7533
type = to_static_fixed_type (type );
7534
7534
7535
- for (i = 0 ; i < TYPE_NFIELDS ( type ); i += 1 )
7535
+ for (i = 0 ; i < type -> num_fields ( ); i += 1 )
7536
7536
{
7537
7537
const char * t_field_name = TYPE_FIELD_NAME (type , i );
7538
7538
struct type * t ;
@@ -7571,7 +7571,7 @@ ada_lookup_struct_elt_type (struct type *type, const char *name, int refok,
7571
7571
struct type * field_type = ada_check_typedef (TYPE_FIELD_TYPE (type ,
7572
7572
i ));
7573
7573
7574
- for (j = TYPE_NFIELDS ( field_type ) - 1 ; j >= 0 ; j -= 1 )
7574
+ for (j = field_type -> num_fields ( ) - 1 ; j >= 0 ; j -= 1 )
7575
7575
{
7576
7576
/* FIXME pnh 2008/01/26: We check for a field that is
7577
7577
NOT wrapped in a struct, since the compiler sometimes
@@ -7655,7 +7655,7 @@ ada_which_variant_applies (struct type *var_type, struct value *outer)
7655
7655
discrim_val = value_as_long (discrim );
7656
7656
7657
7657
others_clause = -1 ;
7658
- for (i = 0 ; i < TYPE_NFIELDS ( var_type ); i += 1 )
7658
+ for (i = 0 ; i < var_type -> num_fields ( ); i += 1 )
7659
7659
{
7660
7660
if (ada_is_others_clause (var_type , i ))
7661
7661
others_clause = i ;
@@ -8005,7 +8005,7 @@ variant_field_index (struct type *type)
8005
8005
if (type == NULL || type -> code () != TYPE_CODE_STRUCT )
8006
8006
return -1 ;
8007
8007
8008
- for (f = 0 ; f < TYPE_NFIELDS ( type ); f += 1 )
8008
+ for (f = 0 ; f < type -> num_fields ( ); f += 1 )
8009
8009
{
8010
8010
if (ada_is_variant_part (type , f ))
8011
8011
return f ;
@@ -8064,11 +8064,11 @@ ada_template_to_fixed_record_type_1 (struct type *type,
8064
8064
to be processed: unless keep_dynamic_fields, this includes only
8065
8065
fields whose position and length are static will be processed. */
8066
8066
if (keep_dynamic_fields )
8067
- nfields = TYPE_NFIELDS ( type );
8067
+ nfields = type -> num_fields ( );
8068
8068
else
8069
8069
{
8070
8070
nfields = 0 ;
8071
- while (nfields < TYPE_NFIELDS ( type )
8071
+ while (nfields < type -> num_fields ( )
8072
8072
&& !ada_is_variant_part (type , nfields )
8073
8073
&& !is_dynamic_field (type , nfields ))
8074
8074
nfields ++ ;
@@ -8243,7 +8243,7 @@ ada_template_to_fixed_record_type_1 (struct type *type,
8243
8243
cond_offset_target (address , off / TARGET_CHAR_BIT ), dval );
8244
8244
if (branch_type == NULL )
8245
8245
{
8246
- for (f = variant_field + 1 ; f < TYPE_NFIELDS ( rtype ); f += 1 )
8246
+ for (f = variant_field + 1 ; f < rtype -> num_fields ( ); f += 1 )
8247
8247
TYPE_FIELDS (rtype )[f - 1 ] = TYPE_FIELDS (rtype )[f ];
8248
8248
rtype -> set_num_fields (rtype -> num_fields () - 1 );
8249
8249
}
@@ -8325,7 +8325,7 @@ template_to_static_fixed_type (struct type *type0)
8325
8325
8326
8326
/* Don't clone TYPE0 until we are sure we are going to need a copy. */
8327
8327
type = type0 ;
8328
- nfields = TYPE_NFIELDS ( type0 );
8328
+ nfields = type0 -> num_fields ( );
8329
8329
8330
8330
/* Whether or not we cloned TYPE0, cache the result so that we don't do
8331
8331
recompute all over next time. */
@@ -8384,7 +8384,7 @@ to_record_with_fixed_variant_part (struct type *type, const gdb_byte *valaddr,
8384
8384
struct value * dval ;
8385
8385
struct type * rtype ;
8386
8386
struct type * branch_type ;
8387
- int nfields = TYPE_NFIELDS ( type );
8387
+ int nfields = type -> num_fields ( );
8388
8388
int variant_field = variant_field_index (type );
8389
8389
8390
8390
if (variant_field == -1 )
@@ -8590,7 +8590,7 @@ ada_is_redundant_index_type_desc (struct type *array_type,
8590
8590
struct type * this_layer = check_typedef (array_type );
8591
8591
int i ;
8592
8592
8593
- for (i = 0 ; i < TYPE_NFIELDS ( desc_type ); i ++ )
8593
+ for (i = 0 ; i < desc_type -> num_fields ( ); i ++ )
8594
8594
{
8595
8595
if (!ada_is_redundant_range_encoding (TYPE_INDEX_TYPE (this_layer ),
8596
8596
TYPE_FIELD_TYPE (desc_type , i )))
@@ -8694,7 +8694,7 @@ to_fixed_array_type (struct type *type0, struct value *dval,
8694
8694
struct type * elt_type0 ;
8695
8695
8696
8696
elt_type0 = type0 ;
8697
- for (i = TYPE_NFIELDS ( index_type_desc ); i > 0 ; i -= 1 )
8697
+ for (i = index_type_desc -> num_fields ( ); i > 0 ; i -= 1 )
8698
8698
elt_type0 = TYPE_TARGET_TYPE (elt_type0 );
8699
8699
8700
8700
/* NOTE: result---the fixed version of elt_type0---should never
@@ -8712,7 +8712,7 @@ to_fixed_array_type (struct type *type0, struct value *dval,
8712
8712
ada_to_fixed_type (ada_check_typedef (elt_type0 ), 0 , 0 , dval , 1 );
8713
8713
8714
8714
elt_type0 = type0 ;
8715
- for (i = TYPE_NFIELDS ( index_type_desc ) - 1 ; i >= 0 ; i -= 1 )
8715
+ for (i = index_type_desc -> num_fields ( ) - 1 ; i >= 0 ; i -= 1 )
8716
8716
{
8717
8717
struct type * range_type =
8718
8718
to_fixed_range_type (TYPE_FIELD_TYPE (index_type_desc , i ), dval );
@@ -9148,7 +9148,7 @@ value_val_atr (struct type *type, struct value *arg)
9148
9148
{
9149
9149
long pos = value_as_long (arg );
9150
9150
9151
- if (pos < 0 || pos >= TYPE_NFIELDS ( type ))
9151
+ if (pos < 0 || pos >= type -> num_fields ( ))
9152
9152
error (_ ("argument to 'VAL out of range" ));
9153
9153
return value_from_longest (type , TYPE_FIELD_ENUMVAL (type , pos ));
9154
9154
}
@@ -9229,7 +9229,7 @@ ada_is_aligner_type (struct type *type)
9229
9229
return 0 ;
9230
9230
9231
9231
return (type -> code () == TYPE_CODE_STRUCT
9232
- && TYPE_NFIELDS ( type ) == 1
9232
+ && type -> num_fields ( ) == 1
9233
9233
&& strcmp (TYPE_FIELD_NAME (type , 0 ), "F" ) == 0 );
9234
9234
}
9235
9235
@@ -9263,7 +9263,7 @@ ada_get_base_type (struct type *raw_type)
9263
9263
real_type_namer = ada_find_parallel_type (raw_type , "___XVS" );
9264
9264
if (real_type_namer == NULL
9265
9265
|| real_type_namer -> code () != TYPE_CODE_STRUCT
9266
- || TYPE_NFIELDS ( real_type_namer ) != 1 )
9266
+ || real_type_namer -> num_fields ( ) != 1 )
9267
9267
return raw_type ;
9268
9268
9269
9269
if (TYPE_FIELD_TYPE (real_type_namer , 0 )-> code () != TYPE_CODE_REF )
0 commit comments