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/c-lang.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/c-lang.c') diff --git a/gdb/c-lang.c b/gdb/c-lang.c index 2a17e00..c2db47e 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -698,8 +698,8 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, LONGEST low_bound, high_bound; int element_size = TYPE_LENGTH (type); - if (get_discrete_bounds (expect_type->index_type (), - &low_bound, &high_bound) < 0) + if (!get_discrete_bounds (expect_type->index_type (), + &low_bound, &high_bound)) { low_bound = 0; high_bound = (TYPE_LENGTH (expect_type) / element_size) - 1; -- cgit v1.1