# HG changeset patch # User Jaroslav Hajek # Date 1270535295 -7200 # Node ID d47802f0e55712f0aeaa3e0f51d3349a81953925 # Parent acf2b099532dcb32d98b786011c10c00b19a9f6d Back out changeset 4e64fbbd5c58 diff --git a/liboctave/Array-util.cc b/liboctave/Array-util.cc --- a/liboctave/Array-util.cc +++ b/liboctave/Array-util.cc @@ -708,16 +708,12 @@ } void -gripe_invalid_index (bool err) +gripe_invalid_index (void) { const char *err_id = error_id_invalid_index; - if (err) - (*current_liboctave_error_with_id_handler) - (err_id, "subscript indices must be either positive integers or logicals"); - else - (*current_liboctave_warning_with_id_handler) - (err_id, "non-integer subscripts in index expression"); + (*current_liboctave_error_with_id_handler) + (err_id, "subscript indices must be either positive integers or logicals."); } // FIXME -- the following is a common error message to resize, diff --git a/liboctave/Array-util.h b/liboctave/Array-util.h --- a/liboctave/Array-util.h +++ b/liboctave/Array-util.h @@ -114,7 +114,7 @@ extern void OCTAVE_API gripe_del_index_out_of_range (bool is1d, octave_idx_type iext, octave_idx_type ext); -extern void OCTAVE_API gripe_invalid_index (bool err = true); +extern void OCTAVE_API gripe_invalid_index (void); extern void OCTAVE_API gripe_invalid_resize (void); diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2010-04-06 Jaroslav Hajek + + * idx-vector.cc, Array-util.h, Array-util.cc: Reverse effects of + 4e64fbbd5c58. + 2010-04-02 John W. Eaton * Array-util.cc, idx-vector.cc, idx-vector.h: Style fixes. diff --git a/liboctave/idx-vector.cc b/liboctave/idx-vector.cc --- a/liboctave/idx-vector.cc +++ b/liboctave/idx-vector.cc @@ -789,23 +789,6 @@ rep = new idx_mask_rep (bnda, nnz); } -idx_vector::idx_vector (const Range& r) - : rep (0) -{ - if (r.nelem () > 0 && ! r.all_elements_are_ints ()) - { - gripe_invalid_index (false); - - Matrix m = r.matrix_value (); - - rep = new idx_vector_rep (m.map (xround)); - } - else - rep = new idx_range_rep (r); - - chkerr (); -} - bool idx_vector::maybe_reduce (octave_idx_type n, const idx_vector& j, octave_idx_type nj) diff --git a/liboctave/idx-vector.h b/liboctave/idx-vector.h --- a/liboctave/idx-vector.h +++ b/liboctave/idx-vector.h @@ -509,7 +509,9 @@ idx_vector (const Array& nda); - idx_vector (const Range& r); + idx_vector (const Range& r) + : rep (new idx_range_rep (r)) + { chkerr (); } idx_vector (const Sparse& nda) : rep (new idx_vector_rep (nda)) { chkerr (); }