]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Return bool from ada_is_ignored_field
authorTom Tromey <tromey@adacore.com>
Tue, 10 Mar 2026 13:52:06 +0000 (07:52 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 11 Mar 2026 14:26:44 +0000 (08:26 -0600)
This changes ada_is_ignored_field to return bool.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/ada-lang.c
gdb/ada-lang.h

index 3c7add72f929c714b4bc6ae9c68ad1708ed2af36..c35b2c3250483a891ae7978c63617163f2fb71a0 100644 (file)
@@ -6230,11 +6230,11 @@ ada_is_interface_tag (struct type *type)
 /* True if field number FIELD_NUM in struct or union type TYPE is supposed
    to be invisible to users.  */
 
-int
+bool
 ada_is_ignored_field (struct type *type, int field_num)
 {
   if (field_num < 0 || field_num > type->num_fields ())
-    return 1;
+    return true;
 
   /* Check the name of that field.  */
   {
@@ -6242,11 +6242,11 @@ ada_is_ignored_field (struct type *type, int field_num)
 
     /* Anonymous field names should not be printed.  */
     if (name == nullptr || name[0] == '\0')
-      return 1;
+      return true;
 
     /* Skip artificial fields.  */
     if (type->field (field_num).is_artificial ())
-      return 1;
+      return true;
 
     /* Normally, fields whose name start with an underscore ("_")
        are fields that have been internally generated by the compiler,
@@ -6256,7 +6256,7 @@ ada_is_ignored_field (struct type *type, int field_num)
        the parent type.  This field should not be printed as is, but
        should not be ignored either.  */
     if (name[0] == '_' && !startswith (name, "_parent"))
-      return 1;
+      return true;
 
     /* The compiler doesn't document this, but sometimes it emits
        a field whose name starts with a capital letter, like 'V148s'.
@@ -6268,7 +6268,7 @@ ada_is_ignored_field (struct type *type, int field_num)
        /* Wrapper field.  */
       }
     else if (c_isupper (name[0]))
-      return 1;
+      return true;
   }
 
   /* If this is the dispatch table of a tagged type or an interface tag,
@@ -6276,10 +6276,10 @@ ada_is_ignored_field (struct type *type, int field_num)
   if (ada_is_tagged_type (type, 1)
       && (ada_is_dispatch_table_ptr_type (type->field (field_num).type ())
          || ada_is_interface_tag (type->field (field_num).type ())))
-    return 1;
+    return true;
 
   /* Not a special field, so it should not be ignored.  */
-  return 0;
+  return false;
 }
 
 /* True iff TYPE has a tag field.  If REFOK, then TYPE may also be a
index 0b04d0a2e86151e842b204653372c7e868f771b5..53bd21b5fb78bb4f86aedc5197322002288ddf5e 100644 (file)
@@ -239,7 +239,7 @@ extern struct value *ada_value_primitive_field (struct value *arg1,
 
 extern struct type *ada_parent_type (struct type *);
 
-extern int ada_is_ignored_field (struct type *, int);
+extern bool ada_is_ignored_field (struct type *, int);
 
 /* True iff TYPE represents a standard GNAT constrained
    packed-array type.  */