[binutils-gdb] Return void from ada-valprint.c:print_optional_low_bound

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=c832fe711cde8413f2205e6c878d1cb8dc65aac7

commit c832fe711cde8413f2205e6c878d1cb8dc65aac7
Author: Tom Tromey <[email protected]>
Date:   Tue Mar 10 08:49:28 2026 -0600

    Return void from ada-valprint.c:print_optional_low_bound
    
    This changes ada-valprint.c:print_optional_low_bound to return void.
    At first I was going to have it return bool, but then I noticed the
    return value is never used.
    
    Approved-By: Simon Marchi <[email protected]>

Diff:
---
 gdb/ada-valprint.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index b2560ce3af6..4055d276f3a 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -39,10 +39,9 @@ static int print_field_values (struct value *, struct value *,
 
 /* Assuming TYPE is a simple array type, prints its lower bound on STREAM,
    if non-standard (i.e., other than 1 for numbers, other than lower bound
-   of index type for enumerated type).  Returns 1 if something printed,
-   otherwise 0.  */
+   of index type for enumerated type).  */
 
-static int
+static void
 print_optional_low_bound (struct ui_file *stream, struct type *type,
 			  const struct value_print_options *options)
 {
@@ -51,16 +50,16 @@ print_optional_low_bound (struct ui_file *stream, struct type *type,
   LONGEST high_bound;
 
   if (options->print_array_indexes)
-    return 0;
+    return;
 
   if (!get_array_bounds (type, &low_bound, &high_bound))
-    return 0;
+    return;
 
   /* If this is an empty array, then don't print the lower bound.
      That would be confusing, because we would print the lower bound,
      followed by... nothing!  */
   if (low_bound > high_bound)
-    return 0;
+    return;
 
   index_type = type->index_type ();
 
@@ -80,11 +79,11 @@ print_optional_low_bound (struct ui_file *stream, struct type *type,
     case TYPE_CODE_BOOL:
     case TYPE_CODE_CHAR:
       if (low_bound == 0)
-	return 0;
+	return;
       break;
     case TYPE_CODE_ENUM:
       if (low_bound == 0)
-	return 0;
+	return;
       low_bound = index_type->field (low_bound).loc_enumval ();
       break;
     case TYPE_CODE_UNDEF:
@@ -92,13 +91,12 @@ print_optional_low_bound (struct ui_file *stream, struct type *type,
       [[fallthrough]];
     default:
       if (low_bound == 1)
-	return 0;
+	return;
       break;
     }
 
   ada_print_scalar (index_type, low_bound, stream);
   gdb_printf (stream, " => ");
-  return 1;
 }
 
 /*  Version of val_print_array_elements for GNAT-style packed arrays.
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.