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/f-array-walker.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/f-array-walker.h') diff --git a/gdb/f-array-walker.h b/gdb/f-array-walker.h index 417f9f0..c202df6 100644 --- a/gdb/f-array-walker.h +++ b/gdb/f-array-walker.h @@ -42,7 +42,7 @@ public: /* Get the range, and extract the bounds. */ struct type *range_type = type->index_type (); - if (get_discrete_bounds (range_type, &m_lowerbound, &m_upperbound) < 0) + if (!get_discrete_bounds (range_type, &m_lowerbound, &m_upperbound)) error ("unable to read array bounds"); /* Figure out the stride for this array. */ @@ -198,7 +198,7 @@ private: /* Extract the range, and get lower and upper bounds. */ struct type *range_type = check_typedef (type)->index_type (); LONGEST lowerbound, upperbound; - if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0) + if (!get_discrete_bounds (range_type, &lowerbound, &upperbound)) error ("failed to get range bounds"); /* CALC is used to calculate the offsets for each element in this -- cgit v1.1