[binutils-gdb] Return bool from ada-lang.c:is_dynamic_field

Tom Tromey tromey@sourceware.org
Wed Mar 11 14:29:22 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1e25aa907b16b26767b01673fcdf98cd1ac7da49

commit 1e25aa907b16b26767b01673fcdf98cd1ac7da49
Author: Tom Tromey <tromey@adacore.com>
Date:   Tue Mar 10 08:04:37 2026 -0600

    Return bool from ada-lang.c:is_dynamic_field
    
    This changes ada-lang.c:is_dynamic_field to return bool.
    
    Approved-By: Simon Marchi <simon.marchi@efficios.com>

Diff:
---
 gdb/ada-lang.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 0e885a4d1f3..1e199d899be 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -122,7 +122,7 @@ static struct type *ada_lookup_struct_elt_type (struct type *, const char *,
 static struct type *ada_find_parallel_type_with_name (struct type *,
 						      const char *);
 
-static int is_dynamic_field (struct type *, int);
+static bool is_dynamic_field (struct type *, int);
 
 static struct type *to_fixed_variant_branch_type (struct type *,
 						  const gdb_byte *,
@@ -7660,16 +7660,16 @@ dynamic_template_type (struct type *type)
 }
 
 /* Assuming that TEMPL_TYPE is a union or struct type, returns
-   non-zero iff field FIELD_NUM of TEMPL_TYPE has dynamic size.  */
+   true iff field FIELD_NUM of TEMPL_TYPE has dynamic size.  */
 
-static int
+static bool
 is_dynamic_field (struct type *templ_type, int field_num)
 {
   const char *name = templ_type->field (field_num).name ();
 
-  return name != NULL
-    && templ_type->field (field_num).type ()->code () == TYPE_CODE_PTR
-    && strstr (name, "___XVL") != NULL;
+  return (name != nullptr
+	  && templ_type->field (field_num).type ()->code () == TYPE_CODE_PTR
+	  && strstr (name, "___XVL") != nullptr);
 }
 
 /* The index of the variant field of TYPE, or -1 if TYPE does not


More information about the Gdb-cvs mailing list