[binutils-gdb] Return bool from ada_is_ignored_field

Tom Tromey via Gdb-cvs <[email protected]>
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5e78daa4977494ef035dffe8547dc5b56f3c7182

commit 5e78daa4977494ef035dffe8547dc5b56f3c7182
Author: Tom Tromey <[email protected]>
Date:   Tue Mar 10 07:52:06 2026 -0600

    Return bool from ada_is_ignored_field
    
    This changes ada_is_ignored_field to return bool.
    
    Approved-By: Simon Marchi <[email protected]>

Diff:
---
 gdb/ada-lang.c | 16 ++++++++--------
 gdb/ada-lang.h |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 3c7add72f92..c35b2c32504 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -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
diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
index 0b04d0a2e86..53bd21b5fb7 100644
--- a/gdb/ada-lang.h
+++ b/gdb/ada-lang.h
@@ -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.  */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.