[binutils-gdb] Return bool from ada-lang.c:is_suffix

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=036a6ee79166e2621fb5d49a268ab8c7a8597f79

commit 036a6ee79166e2621fb5d49a268ab8c7a8597f79
Author: Tom Tromey <[email protected]>
Date:   Tue Mar 3 10:36:14 2026 -0700

    Return bool from ada-lang.c:is_suffix
    
    Change ada-lang.c:is_suffix to return bool.
    
    Approved-By: Simon Marchi <[email protected]>

Diff:
---
 gdb/ada-lang.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index eb4cd6d2f60..1627edc03e9 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -515,19 +515,19 @@ ada_name_prefix_len (const char *name)
     }
 }
 
-/* Return non-zero if SUFFIX is a suffix of STR.
-   Return zero if STR is null.  */
+/* Return true if SUFFIX is a suffix of STR.
+   Return false if STR is null.  */
 
-static int
+static bool
 is_suffix (const char *str, const char *suffix)
 {
   int len1, len2;
 
-  if (str == NULL)
-    return 0;
+  if (str == nullptr)
+    return false;
   len1 = strlen (str);
   len2 = strlen (suffix);
-  return (len1 >= len2 && strcmp (str + len1 - len2, suffix) == 0);
+  return len1 >= len2 && strcmp (str + len1 - len2, suffix) == 0;
 }
 
 /* The contents of value VAL, treated as a value of type TYPE.  The
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.