public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Boolify ada_type_match
@ 2023-12-15 21:05 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2023-12-15 21:05 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1414fbf941140746862b920c6a1034099c4ff3d1

commit 1414fbf941140746862b920c6a1034099c4ff3d1
Author: Tom Tromey <tromey@adacore.com>
Date:   Thu Nov 30 10:31:12 2023 -0700

    Boolify ada_type_match
    
    This changes ada_type_match to return bool.

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

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index edd68cd2c32..bbb876127bd 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -3934,7 +3934,7 @@ ada_resolve_variable (struct symbol *sym, const struct block *block,
 /* The term "match" here is rather loose.  The match is heuristic and
    liberal.  */
 
-static int
+static bool
 ada_type_match (struct type *ftype, struct type *atype)
 {
   ftype = ada_check_typedef (ftype);
@@ -3951,11 +3951,11 @@ ada_type_match (struct type *ftype, struct type *atype)
       return ftype->code () == atype->code ();
     case TYPE_CODE_PTR:
       if (atype->code () != TYPE_CODE_PTR)
-	return 0;
+	return false;
       atype = atype->target_type ();
       /* This can only happen if the actual argument is 'null'.  */
       if (atype->code () == TYPE_CODE_INT && atype->length () == 0)
-	return 1;
+	return true;
       return ada_type_match (ftype->target_type (), atype);
     case TYPE_CODE_INT:
     case TYPE_CODE_ENUM:
@@ -3965,9 +3965,9 @@ ada_type_match (struct type *ftype, struct type *atype)
 	case TYPE_CODE_INT:
 	case TYPE_CODE_ENUM:
 	case TYPE_CODE_RANGE:
-	  return 1;
+	  return true;
 	default:
-	  return 0;
+	  return false;
 	}
 
     case TYPE_CODE_ARRAY:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-15 21:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-15 21:05 [binutils-gdb] Boolify ada_type_match Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).