[binutils-gdb] Return bool from lookup_cached_symbol
Tom Tromey
tromey@sourceware.org
Tue Mar 10 13:23:15 GMT 2026
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=20c0213b9983233db616e336e92c6efe14d5e4af
commit 20c0213b9983233db616e336e92c6efe14d5e4af
Author: Tom Tromey <tromey@adacore.com>
Date: Tue Mar 3 10:46:15 2026 -0700
Return bool from lookup_cached_symbol
This changes ada-lang.c:lookup_cached_symbol to return bool.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diff:
---
gdb/ada-lang.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index cebbeea5ac8..a0a005be55e 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -4739,12 +4739,12 @@ ada_clear_symbol_cache (program_space *pspace)
}
/* Search the symbol cache for an entry matching NAME and DOMAIN.
- Return 1 if found, 0 otherwise.
+ Return true if found, false otherwise.
If an entry was found and SYM is not NULL, set *SYM to the entry's
SYM. Same principle for BLOCK if not NULL. */
-static int
+static bool
lookup_cached_symbol (const char *name, domain_search_flags domain,
struct symbol **sym, const struct block **block)
{
@@ -4755,12 +4755,12 @@ lookup_cached_symbol (const char *name, domain_search_flags domain,
auto iter = htab.find (search);
if (iter == htab.end ())
- return 0;
+ return false;
if (sym != nullptr)
*sym = iter->sym;
if (block != nullptr)
*block = iter->block;
- return 1;
+ return true;
}
/* Assuming that (SYM, BLOCK) is the result of the lookup of NAME
More information about the Gdb-cvs
mailing list