Mercurial > hg > octave-lojdl
changeset 5885:bd3041e30d97
[project @ 2006-07-14 20:29:35 by jwe]
author | jwe |
---|---|
date | Fri, 14 Jul 2006 20:29:35 +0000 |
parents | 9a5a0d5ef82a |
children | b9676944b7a2 |
files | src/ChangeLog src/ov-base-mat.cc src/ov-base-mat.h src/ov-base-sparse.cc src/ov-base-sparse.h src/ov-base.cc src/ov-base.h src/ov-bool.cc src/ov-bool.h src/ov-complex.cc src/ov-complex.h src/ov-intx.h src/ov-list.cc src/ov-list.h src/ov-range.cc src/ov-range.h src/ov-scalar.cc src/ov-scalar.h src/ov-str-mat.cc src/ov-str-mat.h src/ov.h |
diffstat | 21 files changed, 40 insertions(+), 43 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,13 @@ 2006-07-14 John W. Eaton <jwe@octave.org> + * ov-base-mat.cc, ov-base-mat.h, ov-base-sparse.cc, + ov-base-sparse.h, ov-base.cc, ov-base.h, ov-bool.cc, + ov-bool.h, ov-complex.cc, ov-complex.h, ov-intx.h, ov-list.cc, + ov-list.h, ov-range.cc, ov-range.h, ov-scalar.cc, ov-scalar.h, + ov-str-mat.cc, ov-str-mat.h, ov.h (do_index_op): + Declare resize_ok arg as bool, not int. + Provide default value for resize_ok. + * c-file-ptr-stream.h (c_file_ptr_stream::c_file_ptr_stream): Qualify init.
--- a/src/ov-base-mat.cc +++ b/src/ov-base-mat.cc @@ -128,7 +128,7 @@ template <class MT> octave_value octave_base_matrix<MT>::do_index_op (const octave_value_list& idx, - int resize_ok) + bool resize_ok) { octave_value retval;
--- a/src/ov-base-mat.h +++ b/src/ov-base-mat.h @@ -94,10 +94,8 @@ const std::list<octave_value_list>& idx, const octave_value& rhs); - octave_value do_index_op (const octave_value_list& idx, int resize_ok); - - octave_value do_index_op (const octave_value_list& idx) - { return do_index_op (idx, 0); } + octave_value do_index_op (const octave_value_list& idx, + bool resize_ok = false); void assign (const octave_value_list& idx, const MT& rhs);
--- a/src/ov-base-sparse.cc +++ b/src/ov-base-sparse.cc @@ -45,7 +45,7 @@ template <class T> octave_value octave_base_sparse<T>::do_index_op (const octave_value_list& idx, - int resize_ok) + bool resize_ok) { octave_value retval;
--- a/src/ov-base-sparse.h +++ b/src/ov-base-sparse.h @@ -101,10 +101,8 @@ dim_vector dims (void) const { return matrix.dims (); } - octave_value do_index_op (const octave_value_list& idx, int resize_ok); - - octave_value do_index_op (const octave_value_list& idx) - { return do_index_op (idx, 0); } + octave_value do_index_op (const octave_value_list& idx, + bool resize_ok = false); octave_value reshape (const dim_vector& new_dims) const { return T (matrix.reshape (new_dims)); }
--- a/src/ov-base.cc +++ b/src/ov-base.cc @@ -92,19 +92,13 @@ } octave_value -octave_base_value::do_index_op (const octave_value_list&, int) +octave_base_value::do_index_op (const octave_value_list&, bool) { std::string nm = type_name (); error ("can't perform indexing operations for %s type", nm.c_str ()); return octave_value (); } -octave_value -octave_base_value::do_index_op (const octave_value_list& idx) -{ - return do_index_op (idx, 0); -} - octave_value_list octave_base_value::do_multi_index_op (int, const octave_value_list&) {
--- a/src/ov-base.h +++ b/src/ov-base.h @@ -135,10 +135,7 @@ int nargout); virtual octave_value - do_index_op (const octave_value_list& idx, int resize_ok); - - virtual octave_value - do_index_op (const octave_value_list& idx); + do_index_op (const octave_value_list& idx, bool resize_ok = false); virtual octave_value_list do_multi_index_op (int nargout, const octave_value_list& idx);
--- a/src/ov-bool.cc +++ b/src/ov-bool.cc @@ -77,7 +77,7 @@ } octave_value -octave_bool::do_index_op (const octave_value_list& idx, int resize_ok) +octave_bool::do_index_op (const octave_value_list& idx, bool resize_ok) { octave_value retval;
--- a/src/ov-bool.h +++ b/src/ov-bool.h @@ -67,7 +67,8 @@ type_conv_fcn numeric_conversion_function (void) const; - octave_value do_index_op (const octave_value_list& idx, int resize_ok); + octave_value do_index_op (const octave_value_list& idx, + bool resize_ok = false); idx_vector index_vector (void) const { return idx_vector (scalar); }
--- a/src/ov-complex.cc +++ b/src/ov-complex.cc @@ -65,7 +65,7 @@ } octave_value -octave_complex::do_index_op (const octave_value_list& idx, int resize_ok) +octave_complex::do_index_op (const octave_value_list& idx, bool resize_ok) { octave_value retval;
--- a/src/ov-complex.h +++ b/src/ov-complex.h @@ -75,7 +75,8 @@ octave_base_value *try_narrowing_conversion (void); - octave_value do_index_op (const octave_value_list& idx, int resize_ok); + octave_value do_index_op (const octave_value_list& idx, + bool resize_ok = false); octave_value any (int = 0) const {
--- a/src/ov-intx.h +++ b/src/ov-intx.h @@ -174,7 +174,8 @@ octave_base_value *empty_clone (void) const { return new OCTAVE_VALUE_INT_SCALAR_T (); } - octave_value do_index_op (const octave_value_list& idx, int resize_ok) + octave_value do_index_op (const octave_value_list& idx, + bool resize_ok = false) { octave_value retval;
--- a/src/ov-list.cc +++ b/src/ov-list.cc @@ -125,7 +125,7 @@ } octave_value -octave_list::do_index_op (const octave_value_list& idx, int resize_ok) +octave_list::do_index_op (const octave_value_list& idx, bool resize_ok) { octave_value retval;
--- a/src/ov-list.h +++ b/src/ov-list.h @@ -74,7 +74,8 @@ const std::list<octave_value_list>& idx, int nargout); - octave_value do_index_op (const octave_value_list& idx, int resize_ok); + octave_value do_index_op (const octave_value_list& idx, + bool resize_ok = false); octave_value subsasgn (const std::string& type, const std::list<octave_value_list>& idx,
--- a/src/ov-range.cc +++ b/src/ov-range.cc @@ -110,7 +110,7 @@ } octave_value -octave_range::do_index_op (const octave_value_list& idx, int resize_ok) +octave_range::do_index_op (const octave_value_list& idx, bool resize_ok) { // FIXME -- this doesn't solve the problem of //
--- a/src/ov-range.h +++ b/src/ov-range.h @@ -93,10 +93,8 @@ return octave_value_list (); } - octave_value do_index_op (const octave_value_list& idx, int resize_ok); - - octave_value do_index_op (const octave_value_list& idx) - { return do_index_op (idx, 0); } + octave_value do_index_op (const octave_value_list& idx, + bool resize_ok = false); idx_vector index_vector (void) const { return idx_vector (range); }
--- a/src/ov-scalar.cc +++ b/src/ov-scalar.cc @@ -54,7 +54,7 @@ DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_scalar, "scalar", "double"); octave_value -octave_scalar::do_index_op (const octave_value_list& idx, int resize_ok) +octave_scalar::do_index_op (const octave_value_list& idx, bool resize_ok) { octave_value retval;
--- a/src/ov-scalar.h +++ b/src/ov-scalar.h @@ -71,7 +71,8 @@ // undefined), A will be empty instead of a 1x1 object. octave_base_value *empty_clone (void) const { return new octave_matrix (); } - octave_value do_index_op (const octave_value_list& idx, int resize_ok); + octave_value do_index_op (const octave_value_list& idx, + bool resize_ok = false); idx_vector index_vector (void) const { return idx_vector (scalar); }
--- a/src/ov-str-mat.cc +++ b/src/ov-str-mat.cc @@ -83,7 +83,7 @@ octave_value octave_char_matrix_str::do_index_op_internal (const octave_value_list& idx, - int resize_ok, char type) + bool resize_ok, char type) { octave_value retval;
--- a/src/ov-str-mat.h +++ b/src/ov-str-mat.h @@ -85,7 +85,8 @@ type_conv_fcn numeric_conversion_function (void) const; - octave_value do_index_op (const octave_value_list& idx, int resize_ok) + octave_value do_index_op (const octave_value_list& idx, + bool resize_ok = false) { return do_index_op_internal (idx, resize_ok); } void assign (const octave_value_list& idx, const charMatrix& rhs); @@ -152,7 +153,7 @@ protected: octave_value do_index_op_internal (const octave_value_list& idx, - int resize_ok, char type = '"'); + bool resize_ok, char type = '"'); private: @@ -215,7 +216,8 @@ bool is_sq_string (void) const { return true; } - octave_value do_index_op (const octave_value_list& idx, int resize_ok) + octave_value do_index_op (const octave_value_list& idx, + bool resize_ok = false) { return do_index_op_internal (idx, resize_ok, '\''); } private:
--- a/src/ov.h +++ b/src/ov.h @@ -299,12 +299,9 @@ size_t skip = 1); octave_value do_index_op (const octave_value_list& idx, - int resize_ok) + bool resize_ok = false) { return rep->do_index_op (idx, resize_ok); } - octave_value do_index_op (const octave_value_list& idx) - { return do_index_op (idx, 0); } - octave_value_list do_multi_index_op (int nargout, const octave_value_list& idx);