gdb: make get_array_bounds return bool

Obvious change from int to bool.  I took the opportunity to move the doc
to the header file.

gdb/ChangeLog:

	* gdbtypes.h (get_array_bounds): Return bool, adjust some
	callers.  Move doc here.
	* gdbtypes.c (get_array_bounds): Return bool

Change-Id: I8ed20298cb0927963c1f09b345966533d5ed06e2
This commit is contained in:
Simon Marchi
2020-11-17 17:53:27 -05:00
parent 3d955acb36
commit 584903d3f5
5 changed files with 22 additions and 14 deletions

View File

@@ -2435,8 +2435,15 @@ extern int get_vptr_fieldno (struct type *, struct type **);
extern int get_discrete_bounds (struct type *, LONGEST *, LONGEST *);
extern int get_array_bounds (struct type *type, LONGEST *low_bound,
LONGEST *high_bound);
/* Assuming TYPE is a simple, non-empty array type, compute its upper
and lower bound. Save the low bound into LOW_BOUND if not NULL.
Save the high bound into HIGH_BOUND if not NULL.
Return true if the operation was successful. Return false otherwise,
in which case the values of LOW_BOUND and HIGH_BOUNDS are unmodified. */
extern bool get_array_bounds (struct type *type, LONGEST *low_bound,
LONGEST *high_bound);
extern int discrete_position (struct type *type, LONGEST val, LONGEST *pos);