summaryrefslogtreecommitdiff
path: root/gdb/valarith.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-12-09 13:51:57 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2020-12-09 13:51:57 -0500
commit1f8d2881175920d389078852bb1ff0799d744599 (patch)
tree983b6e53db1f95649e8f90c94fe01f7f15b4c443 /gdb/valarith.c
parent6244c1196a49a5732ac3667b4df0f157cf681d7b (diff)
downloadbinutils-gdb-1f8d2881175920d389078852bb1ff0799d744599.tar.gz
gdb: make get_discrete_bounds return bool
get_discrete_bounds currently has three possible return values (see its current doc for details). It appears that for all callers, it would be sufficient to have a boolean "worked" / "didn't work" return value. Change the return type of get_discrete_bounds to bool and adjust all callers. Doing so simplifies the following patch. gdb/ChangeLog: * gdbtypes.h (get_discrete_bounds): Return bool, adjust all callers. * gdbtypes.c (get_discrete_bounds): Return bool. Change-Id: Ie51feee23c75f0cd7939742604282d745db59172
Diffstat (limited to 'gdb/valarith.c')
-rw-r--r--gdb/valarith.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/valarith.c b/gdb/valarith.c
index 5b2bf1889ed..077bcb41dd8 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -1949,7 +1949,7 @@ value_bit_index (struct type *type, const gdb_byte *valaddr, int index)
unsigned rel_index;
struct type *range = type->index_type ();
- if (get_discrete_bounds (range, &low_bound, &high_bound) < 0)
+ if (!get_discrete_bounds (range, &low_bound, &high_bound))
return -2;
if (index < low_bound || index > high_bound)
return -1;