[1/2] Boolify ada_type_match

Message ID 20231205-ada-overload-v1-1-9d97ac80a60e@adacore.com
State New
Headers
Series Improve Ada overload handling |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Tom Tromey Dec. 5, 2023, 3:37 p.m. UTC
  This changes ada_type_match to return bool.
---
 gdb/ada-lang.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Patch

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 1a591567cda..9d5c8d5534b 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: