From 1f8d2881175920d389078852bb1ff0799d744599 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 9 Dec 2020 13:51:57 -0500 Subject: 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 --- gdb/valarith.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/valarith.c') diff --git a/gdb/valarith.c b/gdb/valarith.c index 5b2bf18..077bcb4 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; -- cgit v1.1