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

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

index 2023989e49c4beb1d4f33d343f5868d79afef2ff..73c4b86fbd84647c0d93155591b88e4455eb7808 100644 (file)
@@ -6768,18 +6768,18 @@ ada_variant_discrim_name (struct type *type0)
 /* Scan STR for a subtype-encoded number, beginning at position K.
    Put the position of the character just past the number scanned in
    *NEW_K, if NEW_K!=NULL.  Put the scanned number in *R, if R!=NULL.
-   Return 1 if there was a valid number at the given position, and 0
+   Return true if there was a valid number at the given position, and false
    otherwise.  A "subtype-encoded" number consists of the absolute value
    in decimal, followed by the letter 'm' to indicate a negative number.
    Assumes 0m does not occur.  */
 
-int
+bool
 ada_scan_number (const char str[], int k, LONGEST * R, int *new_k)
 {
   ULONGEST RU;
 
   if (!c_isdigit (str[k]))
-    return 0;
+    return false;
 
   /* Do it the hard way so as not to make any assumption about
      the relationship of unsigned long (%lu scan format code) and
@@ -6808,7 +6808,7 @@ ada_scan_number (const char str[], int k, LONGEST * R, int *new_k)
 
   if (new_k != NULL)
     *new_k = k;
-  return 1;
+  return true;
 }
 
 /* Assuming that TYPE is a variant part wrapper type (a VARIANTS field),
index dbd943cb5ee9e0ae95944ae16beddec64f325773..e3412c82728917d3e8dc8b32ce4fc3817b5a9df9 100644 (file)
@@ -230,7 +230,7 @@ extern block_symbol ada_lookup_encoded_symbol
 
 extern bound_minimal_symbol ada_lookup_simple_minsym (const char *, objfile *);
 
-extern int ada_scan_number (const char *, int, LONGEST *, int *);
+extern bool ada_scan_number (const char *, int, LONGEST *, int *);
 
 extern struct value *ada_value_primitive_field (struct value *arg1,
                                                int offset,