aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-04-10 23:07:10 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-04-29 22:01:06 +0100
commitfc913e53c353218ba1a9efa423c08767691a682a (patch)
tree98da1f67aefa01f76b101e8b3e79c932e0073e5a /gdb/ada-lang.c
parent[gdb/testsuite] Fix regexp in skip_opencl_tests (diff)
downloadbinutils-gdb-fc913e53c353218ba1a9efa423c08767691a682a.tar.gz
binutils-gdb-fc913e53c353218ba1a9efa423c08767691a682a.tar.bz2
binutils-gdb-fc913e53c353218ba1a9efa423c08767691a682a.zip
gdb/ada: Update some predicate functions to return bool
A later commit would like to make use of a pointer to the function ada_is_string_type, however, this will require the function to return a bool (so the signature matches). As the ada_is_string_type is a predicate function, and its return value is only ever used as either true or false, then this commit updates the function to return a bool. As a consequence ada_is_character_type needs to change too. There should be no user visible changes after this commit. gdb/ChangeLog: * ada-lang.c (ada_is_character_type): Change return type to bool. (ada_is_string_type): Likewise. * ada-lang.h (ada_is_character_type): Update declaration (ada_is_string_type): Likewise.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 250ce438b1a..36678173a8d 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -9405,7 +9405,7 @@ value_val_atr (struct type *type, struct value *arg)
[At the moment, this is true only for Character and Wide_Character;
It is a heuristic test that could stand improvement]. */
-int
+bool
ada_is_character_type (struct type *type)
{
const char *name;
@@ -9413,7 +9413,7 @@ ada_is_character_type (struct type *type)
/* If the type code says it's a character, then assume it really is,
and don't check any further. */
if (TYPE_CODE (type) == TYPE_CODE_CHAR)
- return 1;
+ return true;
/* Otherwise, assume it's a character type iff it is a discrete type
with a known character type name. */
@@ -9429,7 +9429,7 @@ ada_is_character_type (struct type *type)
/* True if TYPE appears to be an Ada string type. */
-int
+bool
ada_is_string_type (struct type *type)
{
type = ada_check_typedef (type);
@@ -9444,7 +9444,7 @@ ada_is_string_type (struct type *type)
return ada_is_character_type (elttype);
}
else
- return 0;
+ return false;
}
/* The compiler sometimes provides a parallel XVS type for a given