diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2019-07-10 21:49:32 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2019-07-10 21:49:32 -0400 |
commit | 00db9531969db8b6ab984da996d0411fad938589 (patch) | |
tree | ac820f7c702db640479041c599395c19c1bcb54a /gdb/valops.c | |
parent | f2478a7e8b145a55c343bc7a62c53b021062229e (diff) | |
download | gdb-00db9531969db8b6ab984da996d0411fad938589.zip gdb-00db9531969db8b6ab984da996d0411fad938589.tar.gz gdb-00db9531969db8b6ab984da996d0411fad938589.tar.bz2 |
Make value_must_coerce_to_target return a bool
... and move comment to header file.
gdb/ChangeLog:
* valops.c (value_must_coerce_to_target): Change return type to
bool.
* value.h (value_must_coerce_to_target): Likewise.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r-- | gdb/valops.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/valops.c b/gdb/valops.c index 82b54561..0f6ff7b 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1343,10 +1343,9 @@ address_of_variable (struct symbol *var, const struct block *b) return val; } -/* Return one if VAL does not live in target memory, but should in order - to operate on it. Otherwise return zero. */ +/* See value.h. */ -int +bool value_must_coerce_to_target (struct value *val) { struct type *valtype; @@ -1355,7 +1354,7 @@ value_must_coerce_to_target (struct value *val) if (VALUE_LVAL (val) != not_lval && VALUE_LVAL (val) != lval_internalvar && VALUE_LVAL (val) != lval_xcallable) - return 0; + return false; valtype = check_typedef (value_type (val)); @@ -1364,9 +1363,9 @@ value_must_coerce_to_target (struct value *val) case TYPE_CODE_ARRAY: return TYPE_VECTOR (valtype) ? 0 : 1; case TYPE_CODE_STRING: - return 1; + return true; default: - return 0; + return false; } } |