Mercurial > octave
diff liboctave/util/lo-array-errwarn.h @ 28004:403df0b32204
update out_of_range error messages
* sub2ind.cc (Fsub2ind): Don't redimension dim_vector object so that
the sub2ind function may report original dimensions in error messages.
* Range.h (Range::dims): New function.
* lo-array-errwarn.h, lo-array-errwarn.cc
(out_of_range::set_size, out_of_range::set_extent): Delete.
(out_of_range::out_of_range): Accept size and extent arguments.
(out_of_range::details): Simplify. Always report extent and dimensions.
(err_index_out_of_range): Deprecate overload that does not accept
dim_vector argument. Change all uses to call the one that does.
Simplify by passing extent and dims to out_of_range_object constructor.
* test/index.tst: Update error messages in tests.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 25 Jan 2020 16:56:27 -0500 |
parents | e90e3155cd01 |
children | 9a965fec21c1 |
line wrap: on
line diff
--- a/liboctave/util/lo-array-errwarn.h Sat Jan 25 12:43:31 2020 -0500 +++ b/liboctave/util/lo-array-errwarn.h Sat Jan 25 16:56:27 2020 -0500 @@ -130,11 +130,12 @@ const dim_vector& op1_dims, const dim_vector& op2_dims); OCTAVE_NORETURN OCTAVE_API extern void - err_index_out_of_range (int nd, int dim, octave_idx_type iext, - octave_idx_type ext, const dim_vector& d); + err_index_out_of_range (int ndims, int dim, octave_idx_type idx, + octave_idx_type ext, const dim_vector& dv); + OCTAVE_DEPRECATED (6, "use err_index_out_of_range (int, int, octave_idx_type, octave_idx_type, const dim_vector&) instead") OCTAVE_NORETURN OCTAVE_API extern void - err_index_out_of_range (int nd, int dim, octave_idx_type iext, + err_index_out_of_range (int ndims, int dim, octave_idx_type idx, octave_idx_type ext); OCTAVE_NORETURN OCTAVE_API extern void