]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Return bool from ada_is_constrained_packed_array_type
authorTom Tromey <tromey@adacore.com>
Thu, 19 Feb 2026 20:28:34 +0000 (13:28 -0700)
committerTom Tromey <tromey@adacore.com>
Tue, 3 Mar 2026 17:28:39 +0000 (10:28 -0700)
Change ada_is_constrained_packed_array_type to return bool, and fix a
few small related issues along the way.

gdb/ada-lang.c
gdb/ada-lang.h

index c9b477b97c122a71820033682da956db16ef9736..5b512f7acf3d11b243db12abcfc85bf7f8969547 100644 (file)
@@ -2311,14 +2311,13 @@ ada_is_gnat_encoded_packed_array_type  (struct type *type)
     && strstr (ada_type_name (type), "___XP") != NULL;
 }
 
-/* Non-zero iff TYPE represents a standard GNAT constrained
-   packed-array type.  */
+/* See ada-lang.h.  */
 
-int
+bool
 ada_is_constrained_packed_array_type (struct type *type)
 {
-  return ada_is_gnat_encoded_packed_array_type (type)
-    && !ada_is_array_descriptor_type (type);
+  return (ada_is_gnat_encoded_packed_array_type (type)
+         && !ada_is_array_descriptor_type (type));
 }
 
 /* True iff TYPE represents an array descriptor for a unconstrained
@@ -8284,7 +8283,7 @@ to_fixed_array_type (struct type *type0, struct value *dval,
 {
   struct type *index_type_desc;
   struct type *result;
-  int constrained_packed_array_p;
+  bool constrained_packed_array_p;
   static const char *xa_suffix = "___XA";
 
   type0 = ada_check_typedef (type0);
index 60e192bc7f7eff3b3a246abd7e3b51284663b40e..42dc4f53c4d8358714d0dafb2d1c43b295406b1e 100644 (file)
@@ -241,7 +241,9 @@ extern struct type *ada_parent_type (struct type *);
 
 extern int ada_is_ignored_field (struct type *, int);
 
-extern int ada_is_constrained_packed_array_type (struct type *);
+/* True iff TYPE represents a standard GNAT constrained
+   packed-array type.  */
+extern bool ada_is_constrained_packed_array_type (struct type *type);
 
 extern struct value *ada_value_primitive_packed_val (struct value *,
                                                     const gdb_byte *,