[binutils-gdb] Return bool from lookup_cached_symbol

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=20c0213b9983233db616e336e92c6efe14d5e4af

commit 20c0213b9983233db616e336e92c6efe14d5e4af
Author: Tom Tromey <[email protected]>
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 <[email protected]>

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
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.