From: Tom Tromey Date: Tue, 10 Mar 2026 14:00:49 +0000 (-0600) Subject: Return bool from ada_scan_number X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c29609d2c44ddacee8d9a4f96fa93e63511bb54;p=thirdparty%2Fbinutils-gdb.git Return bool from ada_scan_number This changes ada_scan_number to return bool. Approved-By: Simon Marchi --- diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 2023989e49c..73c4b86fbd8 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -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), diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index dbd943cb5ee..e3412c82728 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -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,