Mercurial > octave
comparison 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 |
comparison
equal
deleted
inserted
replaced
28003:60d8d6e5594d | 28004:403df0b32204 |
---|---|
128 OCTAVE_NORETURN OCTAVE_API extern void | 128 OCTAVE_NORETURN OCTAVE_API extern void |
129 err_nonconformant (const char *op, | 129 err_nonconformant (const char *op, |
130 const dim_vector& op1_dims, const dim_vector& op2_dims); | 130 const dim_vector& op1_dims, const dim_vector& op2_dims); |
131 | 131 |
132 OCTAVE_NORETURN OCTAVE_API extern void | 132 OCTAVE_NORETURN OCTAVE_API extern void |
133 err_index_out_of_range (int nd, int dim, octave_idx_type iext, | 133 err_index_out_of_range (int ndims, int dim, octave_idx_type idx, |
134 octave_idx_type ext, const dim_vector& d); | 134 octave_idx_type ext, const dim_vector& dv); |
135 | 135 |
136 OCTAVE_DEPRECATED (6, "use err_index_out_of_range (int, int, octave_idx_type, octave_idx_type, const dim_vector&) instead") | |
136 OCTAVE_NORETURN OCTAVE_API extern void | 137 OCTAVE_NORETURN OCTAVE_API extern void |
137 err_index_out_of_range (int nd, int dim, octave_idx_type iext, | 138 err_index_out_of_range (int ndims, int dim, octave_idx_type idx, |
138 octave_idx_type ext); | 139 octave_idx_type ext); |
139 | 140 |
140 OCTAVE_NORETURN OCTAVE_API extern void | 141 OCTAVE_NORETURN OCTAVE_API extern void |
141 err_del_index_out_of_range (bool is1d, octave_idx_type iext, | 142 err_del_index_out_of_range (bool is1d, octave_idx_type iext, |
142 octave_idx_type ext); | 143 octave_idx_type ext); |