# HG changeset patch # User John W. Eaton # Date 1630346567 14400 # Node ID b16e0d357437dd8d912d0c3ab2f567dae3870e3a # Parent 43622407af81d4b72722303228b2685c40865184 maint: use "m_" prefix for member variables in some octave-value classes. * ov-cs-list.h, ov-cs-list.cc, ov-dld-fcn.h, ov-dld-fcn.cc, ov-lazy-idx.h, ov-lazy-idx.cc, ov-oncleanup.h, ov-oncleanup.cc, ov-perm.h, ov-perm.cc, ov-struct.h, ov-struct.cc, ov-typeinfo.h, ov-typeinfo.cc: Use "m_" prefix for class member variables. diff -r 43622407af81 -r b16e0d357437 libinterp/octave-value/ov-cs-list.cc --- a/libinterp/octave-value/ov-cs-list.cc Mon Aug 30 10:52:39 2021 -0700 +++ b/libinterp/octave-value/ov-cs-list.cc Mon Aug 30 14:02:47 2021 -0400 @@ -39,7 +39,7 @@ DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_cs_list, "cs-list", "cs-list"); octave_cs_list::octave_cs_list (const Cell& c) - : octave_base_value (), lst (c) + : octave_base_value (), m_list (c) { } octave_value diff -r 43622407af81 -r b16e0d357437 libinterp/octave-value/ov-cs-list.h --- a/libinterp/octave-value/ov-cs-list.h Mon Aug 30 10:52:39 2021 -0700 +++ b/libinterp/octave-value/ov-cs-list.h Mon Aug 30 14:02:47 2021 -0400 @@ -49,22 +49,22 @@ public: octave_cs_list (void) - : octave_base_value (), lst () { } + : octave_base_value (), m_list () { } octave_cs_list (const octave_value_list& l) - : octave_base_value (), lst (l) { } + : octave_base_value (), m_list (l) { } octave_cs_list (const Cell& c); octave_cs_list (const octave_cs_list& l) - : octave_base_value (), lst (l.lst) { } + : octave_base_value (), m_list (l.m_list) { } ~octave_cs_list (void) = default; octave_base_value * clone (void) const { return new octave_cs_list (*this); } octave_base_value * empty_clone (void) const { return new octave_cs_list (); } - dim_vector dims (void) const { return dim_vector (1, lst.length ()); } + dim_vector dims (void) const { return dim_vector (1, m_list.length ()); } bool is_defined (void) const { return true; } @@ -72,7 +72,7 @@ bool is_cs_list (void) const { return true; } - octave_value_list list_value (void) const { return lst; } + octave_value_list list_value (void) const { return m_list; } // We don't need to override all three forms of subsref. The using // declaration will avoid warnings about partially-overloaded virtual @@ -89,7 +89,7 @@ private: // The list of Octave values. - octave_value_list lst; + octave_value_list m_list; DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA }; diff -r 43622407af81 -r b16e0d357437 libinterp/octave-value/ov-dld-fcn.cc --- a/libinterp/octave-value/ov-dld-fcn.cc Mon Aug 30 10:52:39 2021 -0700 +++ b/libinterp/octave-value/ov-dld-fcn.cc Mon Aug 30 14:02:47 2021 -0400 @@ -46,7 +46,7 @@ octave_dld_function::octave_dld_function (octave_builtin::fcn ff, const octave::dynamic_library& shl, const std::string& nm, const std::string& ds) - : octave_builtin (ff, nm, ds), sh_lib (shl) + : octave_builtin (ff, nm, ds), m_sh_lib (shl) { mark_fcn_file_up_to_date (time_parsed ()); @@ -58,7 +58,7 @@ = canonical_oct_file_dir.empty () ? octave::config::oct_file_dir () : canonical_oct_file_dir; - system_fcn_file + m_system_fcn_file = (! file_name.empty () && oct_file_dir == file_name.substr (0, oct_file_dir.length ())); } @@ -66,7 +66,7 @@ octave_dld_function::octave_dld_function (octave_builtin::meth mm, const octave::dynamic_library& shl, const std::string& nm, const std::string& ds) - : octave_builtin (mm, nm, ds), sh_lib (shl) + : octave_builtin (mm, nm, ds), m_sh_lib (shl) { mark_fcn_file_up_to_date (time_parsed ()); @@ -78,7 +78,7 @@ = canonical_oct_file_dir.empty () ? octave::config::oct_file_dir () : canonical_oct_file_dir; - system_fcn_file + m_system_fcn_file = (! file_name.empty () && oct_file_dir == file_name.substr (0, oct_file_dir.length ())); } @@ -88,19 +88,19 @@ octave::dynamic_loader& dyn_loader = octave::__get_dynamic_loader__ ("~octave_dld_function"); - dyn_loader.remove_oct (m_name, sh_lib); + dyn_loader.remove_oct (m_name, m_sh_lib); } std::string octave_dld_function::fcn_file_name (void) const { - return sh_lib.file_name (); + return m_sh_lib.file_name (); } octave::sys::time octave_dld_function::time_parsed (void) const { - return sh_lib.time_loaded (); + return m_sh_lib.time_loaded (); } // Note: this wrapper around the octave_dld_function constructor is diff -r 43622407af81 -r b16e0d357437 libinterp/octave-value/ov-dld-fcn.h --- a/libinterp/octave-value/ov-dld-fcn.h Mon Aug 30 10:52:39 2021 -0700 +++ b/libinterp/octave-value/ov-dld-fcn.h Mon Aug 30 14:02:47 2021 -0400 @@ -48,7 +48,7 @@ public: octave_dld_function (void) - : sh_lib (), t_checked (), system_fcn_file () + : m_sh_lib (), m_t_checked (), m_system_fcn_file () { } octave_dld_function (octave_builtin::fcn ff, @@ -69,15 +69,15 @@ ~octave_dld_function (void); - void mark_fcn_file_up_to_date (const octave::sys::time& t) { t_checked = t; } + void mark_fcn_file_up_to_date (const octave::sys::time& t) { m_t_checked = t; } std::string fcn_file_name (void) const; octave::sys::time time_parsed (void) const; - octave::sys::time time_checked (void) const { return t_checked; } + octave::sys::time time_checked (void) const { return m_t_checked; } - bool is_system_fcn_file (void) const { return system_fcn_file; } + bool is_system_fcn_file (void) const { return m_system_fcn_file; } bool is_builtin_function (void) const { return false; } @@ -94,20 +94,20 @@ const std::string& ds = ""); octave::dynamic_library get_shlib (void) const - { return sh_lib; } + { return m_sh_lib; } private: - octave::dynamic_library sh_lib; + octave::dynamic_library m_sh_lib; // The time the file was last checked to see if it needs to be // parsed again. - mutable octave::sys::time t_checked; + mutable octave::sys::time m_t_checked; // True if this function came from a file that is considered to be a // system function. This affects whether we check the time stamp // on the file to see if it has changed. - bool system_fcn_file; + bool m_system_fcn_file; DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA }; diff -r 43622407af81 -r b16e0d357437 libinterp/octave-value/ov-lazy-idx.cc --- a/libinterp/octave-value/ov-lazy-idx.cc Mon Aug 30 10:52:39 2021 -0700 +++ b/libinterp/octave-value/ov-lazy-idx.cc Mon Aug 30 14:02:47 2021 -0400 @@ -55,14 +55,14 @@ { octave_base_value *retval = nullptr; - switch (index.length (0)) + switch (m_index.length (0)) { case 1: - retval = new octave_scalar (static_cast (index(0) + 1)); + retval = new octave_scalar (static_cast (m_index(0) + 1)); break; case 0: - retval = new octave_matrix (NDArray (index.orig_dimensions ())); + retval = new octave_matrix (NDArray (m_index.orig_dimensions ())); break; default: @@ -75,67 +75,67 @@ octave_value octave_lazy_index::fast_elem_extract (octave_idx_type n) const { - return double (index.checkelem (n) + 1); + return double (m_index.checkelem (n) + 1); } octave_value octave_lazy_index::reshape (const dim_vector& new_dims) const { - return octave::idx_vector (index.as_array ().reshape (new_dims), - index.extent (0)); + return octave::idx_vector (m_index.as_array ().reshape (new_dims), + m_index.extent (0)); } octave_value octave_lazy_index::permute (const Array& vec, bool inv) const { // If the conversion has already been made, forward the operation. - if (value.is_defined ()) - return value.permute (vec, inv); + if (m_value.is_defined ()) + return m_value.permute (vec, inv); else - return octave::idx_vector (index.as_array ().permute (vec, inv), - index.extent (0)); + return octave::idx_vector (m_index.as_array ().permute (vec, inv), + m_index.extent (0)); } octave_value octave_lazy_index::squeeze (void) const { - return octave::idx_vector (index.as_array ().squeeze (), index.extent (0)); + return octave::idx_vector (m_index.as_array ().squeeze (), m_index.extent (0)); } octave_value octave_lazy_index::sort (octave_idx_type dim, sortmode mode) const { - const dim_vector odims = index.orig_dimensions (); + const dim_vector odims = m_index.orig_dimensions (); // index_vector can employ a more efficient sorting algorithm. if (mode == ASCENDING && odims.ndims () == 2 && (dim >= 0 && dim <= 1) && odims(1-dim) == 1) return index_vector ().sorted (); else - return octave::idx_vector (index.as_array ().sort (dim, mode), - index.extent (0)); + return octave::idx_vector (m_index.as_array ().sort (dim, mode), + m_index.extent (0)); } octave_value octave_lazy_index::sort (Array &sidx, octave_idx_type dim, sortmode mode) const { - const dim_vector odims = index.orig_dimensions (); + const dim_vector odims = m_index.orig_dimensions (); // index_vector can employ a more efficient sorting algorithm. if (mode == ASCENDING && odims.ndims () == 2 && (dim >= 0 && dim <= 1) && odims(1-dim) == 1) return index_vector ().sorted (sidx); else - return octave::idx_vector (index.as_array ().sort (sidx, dim, mode), - index.extent (0)); + return octave::idx_vector (m_index.as_array ().sort (sidx, dim, mode), + m_index.extent (0)); } sortmode octave_lazy_index::issorted (sortmode mode) const { - if (index.is_range ()) + if (m_index.is_range ()) { // Avoid the array conversion. - octave_idx_type inc = index.increment (); + octave_idx_type inc = m_index.increment (); if (inc == 0) return (mode == UNSORTED ? ASCENDING : mode); else if (inc > 0) @@ -144,19 +144,19 @@ return (mode == ASCENDING ? UNSORTED : DESCENDING); } else - return index.as_array ().issorted (mode); + return m_index.as_array ().issorted (mode); } Array octave_lazy_index::sort_rows_idx (sortmode mode) const { - return index.as_array ().sort_rows_idx (mode); + return m_index.as_array ().sort_rows_idx (mode); } sortmode octave_lazy_index::is_sorted_rows (sortmode mode) const { - return index.as_array ().is_sorted_rows (mode); + return m_index.as_array ().is_sorted_rows (mode); } octave_value @@ -230,11 +230,11 @@ { bool dummy; - std::string nm = read_text_data (is, "", dummy, value, 0); + std::string nm = read_text_data (is, "", dummy, m_value, 0); if (nm != value_save_tag) error ("lazy_index: corrupted data on load"); - index = value.index_vector (); + m_index = m_value.index_vector (); return true; } @@ -251,11 +251,11 @@ bool dummy; std::string doc; - std::string nm = read_binary_data (is, swap, fmt, "", dummy, value, doc); + std::string nm = read_binary_data (is, swap, fmt, "", dummy, m_value, doc); if (nm != value_save_tag) error ("lazy_index: corrupted data on load"); - index = value.index_vector (); + m_index = m_value.index_vector (); return true; } diff -r 43622407af81 -r b16e0d357437 libinterp/octave-value/ov-lazy-idx.h --- a/libinterp/octave-value/ov-lazy-idx.h Mon Aug 30 10:52:39 2021 -0700 +++ b/libinterp/octave-value/ov-lazy-idx.h Mon Aug 30 14:02:47 2021 -0400 @@ -40,13 +40,13 @@ public: octave_lazy_index (void) - : octave_base_value (), index (), value () { } + : octave_base_value (), m_index (), m_value () { } octave_lazy_index (const octave::idx_vector& idx) - : octave_base_value (), index (idx), value () { } + : octave_base_value (), m_index (idx), m_value () { } octave_lazy_index (const octave_lazy_index& i) - : octave_base_value (), index (i.index), value (i.value) { } + : octave_base_value (), m_index (i.m_index), m_value (i.m_value) { } ~octave_lazy_index (void) = default; @@ -67,7 +67,7 @@ octave_value full_value (void) const { return make_value (); } octave::idx_vector index_vector (bool /* require_integers */ = false) const - { return index; } + { return m_index; } builtin_type_t builtin_type (void) const { return btyp_double; } @@ -96,9 +96,9 @@ bool resize_ok = false) { return make_value ().index_op (idx, resize_ok); } - dim_vector dims (void) const { return index.orig_dimensions (); } + dim_vector dims (void) const { return m_index.orig_dimensions (); } - octave_idx_type numel (void) const { return index.length (0); } + octave_idx_type numel (void) const { return m_index.length (0); } octave_idx_type nnz (void) const { return numel (); } @@ -256,22 +256,22 @@ const octave_value& make_value (void) const { - if (value.is_undefined ()) - value = octave_value (index, false); + if (m_value.is_undefined ()) + m_value = octave_value (m_index, false); - return value; + return m_value; } octave_value& make_value (void) { - if (value.is_undefined ()) - value = octave_value (index, false); + if (m_value.is_undefined ()) + m_value = octave_value (m_index, false); - return value; + return m_value; } - octave::idx_vector index; - mutable octave_value value; + octave::idx_vector m_index; + mutable octave_value m_value; static octave_base_value * numeric_conversion_function (const octave_base_value&); diff -r 43622407af81 -r b16e0d357437 libinterp/octave-value/ov-oncleanup.cc --- a/libinterp/octave-value/ov-oncleanup.cc Mon Aug 30 10:52:39 2021 -0700 +++ b/libinterp/octave-value/ov-oncleanup.cc Mon Aug 30 14:02:47 2021 -0400 @@ -40,7 +40,7 @@ "onCleanup"); octave_oncleanup::octave_oncleanup (const octave_value& f) - : fcn (f) + : m_fcn (f) { if (f.is_function_handle ()) { @@ -61,7 +61,7 @@ } else { - fcn = octave_value (); + m_fcn = octave_value (); error ("onCleanup: argument must be a function handle"); } } @@ -75,7 +75,7 @@ octave_oncleanup::scalar_map_value (void) const { octave_scalar_map retval; - retval.setfield ("task", fcn); + retval.setfield ("task", m_fcn); return retval; } @@ -140,19 +140,19 @@ octave_oncleanup::print_raw (std::ostream& os, bool pr_as_read_syntax) const { os << "onCleanup ("; - if (fcn.is_defined ()) - fcn.print_raw (os, pr_as_read_syntax); + if (m_fcn.is_defined ()) + m_fcn.print_raw (os, pr_as_read_syntax); os << ')'; } void octave_oncleanup::call_object_destructor (void) { - if (fcn.is_undefined ()) + if (m_fcn.is_undefined ()) return; - octave_value the_fcn = fcn; - fcn = octave_value (); + octave_value the_fcn = m_fcn; + m_fcn = octave_value (); octave::unwind_protect frame; diff -r 43622407af81 -r b16e0d357437 libinterp/octave-value/ov-oncleanup.h --- a/libinterp/octave-value/ov-oncleanup.h Mon Aug 30 10:52:39 2021 -0700 +++ b/libinterp/octave-value/ov-oncleanup.h Mon Aug 30 14:02:47 2021 -0400 @@ -41,11 +41,11 @@ octave_oncleanup (void) = default; - octave_oncleanup (const octave_value& fcn); + octave_oncleanup (const octave_value& m_fcn); octave_base_value * clone (void) const { - if (fcn.is_defined ()) + if (m_fcn.is_defined ()) error ("onCleanup: internal error: cloning nonempty object"); return empty_clone (); @@ -97,7 +97,7 @@ protected: - octave_value fcn; + octave_value m_fcn; }; #endif diff -r 43622407af81 -r b16e0d357437 libinterp/octave-value/ov-perm.cc --- a/libinterp/octave-value/ov-perm.cc Mon Aug 30 10:52:39 2021 -0700 +++ b/libinterp/octave-value/ov-perm.cc Mon Aug 30 14:02:47 2021 -0400 @@ -99,8 +99,8 @@ // matrix. if (nidx == 2) { - bool left = idx0.is_permutation (matrix.rows ()); - bool right = idx1.is_permutation (matrix.cols ()); + bool left = idx0.is_permutation (m_matrix.rows ()); + bool right = idx1.is_permutation (m_matrix.cols ()); if (left && right) { @@ -108,7 +108,7 @@ if (idx1.is_colon ()) right = false; if (left || right) { - PermMatrix p = matrix; + PermMatrix p = m_matrix; if (left) p = PermMatrix (idx0, false) * p; if (right) @@ -126,7 +126,7 @@ if (! retval.is_defined ()) { if (nidx == 2 && ! resize_ok && idx0.is_scalar () && idx1.is_scalar ()) - retval = matrix.checkelem (idx0(0), idx1(0)); + retval = m_matrix.checkelem (idx0(0), idx1(0)); else retval = to_dense ().index_op (idx, resize_ok); } @@ -157,7 +157,7 @@ warn_implicit_conversion ("Octave:array-to-scalar", type_name (), "real scalar"); - return matrix(0, 0); + return m_matrix(0, 0); } float @@ -169,7 +169,7 @@ warn_implicit_conversion ("Octave:array-to-scalar", type_name (), "real scalar"); - return matrix(0, 0); + return m_matrix(0, 0); } Complex @@ -181,7 +181,7 @@ warn_implicit_conversion ("Octave:array-to-scalar", type_name (), "complex scalar"); - return Complex (matrix(0, 0), 0); + return Complex (m_matrix(0, 0), 0); } FloatComplex @@ -197,7 +197,7 @@ warn_implicit_conversion ("Octave:array-to-scalar", type_name (), "complex scalar"); - retval = matrix(0, 0); + retval = m_matrix(0, 0); return retval; } @@ -212,13 +212,13 @@ SparseMatrix octave_perm_matrix::sparse_matrix_value (bool) const { - return SparseMatrix (matrix); + return SparseMatrix (m_matrix); } SparseBoolMatrix octave_perm_matrix::sparse_bool_matrix_value (bool) const { - return SparseBoolMatrix (matrix); + return SparseBoolMatrix (m_matrix); } SparseComplexMatrix @@ -256,7 +256,7 @@ octave_value octave_perm_matrix::as_double (void) const { - return matrix; + return m_matrix; } octave_value @@ -325,17 +325,17 @@ octave_idx_type j) const { std::ostringstream buf; - octave_print_internal (buf, fmt, octave_int (matrix(i,j))); + octave_print_internal (buf, fmt, octave_int (m_matrix(i,j))); return buf.str (); } bool octave_perm_matrix::save_ascii (std::ostream& os) { - os << "# size: " << matrix.rows () << "\n"; + os << "# size: " << m_matrix.rows () << "\n"; os << "# orient: c\n"; - Array pvec = matrix.col_perm_vec (); + Array pvec = m_matrix.col_perm_vec (); octave_idx_type n = pvec.numel (); ColumnVector tmp (n); for (octave_idx_type i = 0; i < n; i++) tmp(i) = pvec(i) + 1; @@ -362,10 +362,10 @@ Array pvec (dim_vector (n, 1)); for (octave_idx_type i = 0; i < n; i++) pvec(i) = tmp(i) - 1; - matrix = PermMatrix (pvec, colp); + m_matrix = PermMatrix (pvec, colp); // Invalidate cache. Probably not necessary, but safe. - dense_cache = octave_value (); + m_dense_cache = octave_value (); return true; } @@ -374,11 +374,11 @@ octave_perm_matrix::save_binary (std::ostream& os, bool) { - int32_t sz = matrix.rows (); + int32_t sz = m_matrix.rows (); bool colp = true; os.write (reinterpret_cast (&sz), 4); os.write (reinterpret_cast (&colp), 1); - const Array& col_perm = matrix.col_perm_vec (); + const Array& col_perm = m_matrix.col_perm_vec (); os.write (reinterpret_cast (col_perm.data ()), col_perm.byte_size ()); @@ -421,7 +421,7 @@ } } - matrix = PermMatrix (m, colp); + m_matrix = PermMatrix (m, colp); return true; } @@ -429,7 +429,7 @@ octave_perm_matrix::print_raw (std::ostream& os, bool pr_as_read_syntax) const { - return octave_print_internal (os, matrix, pr_as_read_syntax, + return octave_print_internal (os, m_matrix, pr_as_read_syntax, current_print_indent_level ()); } @@ -466,16 +466,16 @@ octave_perm_matrix::print_info (std::ostream& os, const std::string& prefix) const { - matrix.print_info (os, prefix); + m_matrix.print_info (os, prefix); } octave_value octave_perm_matrix::to_dense (void) const { - if (! dense_cache.is_defined ()) - dense_cache = Matrix (matrix); + if (! m_dense_cache.is_defined ()) + m_dense_cache = Matrix (m_matrix); - return dense_cache; + return m_dense_cache; } DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_perm_matrix, @@ -502,18 +502,18 @@ void octave_perm_matrix::short_disp (std::ostream& os) const { - if (matrix.isempty ()) + if (m_matrix.isempty ()) os << "[]"; - else if (matrix.ndims () == 2) + else if (m_matrix.ndims () == 2) { // FIXME: should this be configurable? octave_idx_type max_elts = 10; octave_idx_type elts = 0; - octave_idx_type nel = matrix.numel (); + octave_idx_type nel = m_matrix.numel (); - octave_idx_type nr = matrix.rows (); - octave_idx_type nc = matrix.columns (); + octave_idx_type nr = m_matrix.rows (); + octave_idx_type nc = m_matrix.columns (); os << '['; @@ -522,7 +522,7 @@ for (octave_idx_type j = 0; j < nc; j++) { std::ostringstream buf; - octave_int tval (matrix(i,j)); + octave_int tval (m_matrix(i,j)); octave_print_internal (buf, tval); std::string tmp = buf.str (); std::size_t pos = tmp.find_first_not_of (' '); @@ -556,8 +556,8 @@ { octave_base_value *retval = nullptr; - if (matrix.numel () == 1) - retval = new octave_scalar (matrix (0, 0)); + if (m_matrix.numel () == 1) + retval = new octave_scalar (m_matrix (0, 0)); return retval; } @@ -565,14 +565,14 @@ octave_value octave_perm_matrix::fast_elem_extract (octave_idx_type n) const { - if (n < matrix.numel ()) + if (n < m_matrix.numel ()) { - octave_idx_type nr = matrix.rows (); + octave_idx_type nr = m_matrix.rows (); octave_idx_type r = n % nr; octave_idx_type c = n / nr; - return octave_value (matrix.elem (r, c)); + return octave_value (m_matrix.elem (r, c)); } else return octave_value (); diff -r 43622407af81 -r b16e0d357437 libinterp/octave-value/ov-perm.h --- a/libinterp/octave-value/ov-perm.h Mon Aug 30 10:52:39 2021 -0700 +++ b/libinterp/octave-value/ov-perm.h Mon Aug 30 14:02:47 2021 -0400 @@ -40,9 +40,9 @@ octave_perm_matrix : public octave_base_value { public: - octave_perm_matrix (void) : matrix (), dense_cache () { } + octave_perm_matrix (void) : m_matrix (), m_dense_cache () { } - octave_perm_matrix (const PermMatrix& p) : matrix (p), dense_cache () { } + octave_perm_matrix (const PermMatrix& p) : m_matrix (p), m_dense_cache () { } octave_base_value * clone (void) const { return new octave_perm_matrix (*this); } @@ -53,9 +53,9 @@ octave_base_value * try_narrowing_conversion (void); - std::size_t byte_size (void) const { return matrix.byte_size (); } + std::size_t byte_size (void) const { return m_matrix.byte_size (); } - octave_value squeeze (void) const { return matrix; } + octave_value squeeze (void) const { return m_matrix; } octave_value full_value (void) const { return to_dense (); } @@ -74,9 +74,9 @@ octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false); - dim_vector dims (void) const { return matrix.dims (); } + dim_vector dims (void) const { return m_matrix.dims (); } - octave_idx_type nnz (void) const { return matrix.rows (); } + octave_idx_type nnz (void) const { return m_matrix.rows (); } octave_value reshape (const dim_vector& new_dims) const { return to_dense ().reshape (new_dims); } @@ -149,7 +149,7 @@ octave::idx_vector index_vector (bool require_integers = false) const; PermMatrix perm_matrix_value (void) const - { return matrix; } + { return m_matrix; } Matrix matrix_value (bool = false) const; @@ -257,11 +257,11 @@ protected: - PermMatrix matrix; + PermMatrix m_matrix; virtual octave_value to_dense (void) const; - mutable octave_value dense_cache; + mutable octave_value m_dense_cache; private: diff -r 43622407af81 -r b16e0d357437 libinterp/octave-value/ov-struct.cc --- a/libinterp/octave-value/ov-struct.cc Mon Aug 30 10:52:39 2021 -0700 +++ b/libinterp/octave-value/ov-struct.cc Mon Aug 30 14:02:47 2021 -0400 @@ -66,9 +66,9 @@ void octave_struct::break_closure_cycles (const std::shared_ptr& frame) { - for (octave_idx_type j = 0; j < map.nfields (); j++) + for (octave_idx_type j = 0; j < m_map.nfields (); j++) { - Cell& c = map.contents (j); + Cell& c = m_map.contents (j); for (octave_idx_type i = 0; i < c.numel (); i++) c(i).break_closure_cycles (frame); @@ -81,7 +81,7 @@ octave_base_value *retval = nullptr; if (numel () == 1) - retval = new octave_scalar_struct (map.checkelem (0)); + retval = new octave_scalar_struct (m_map.checkelem (0)); return retval; } @@ -95,10 +95,10 @@ std::string nm = idx(0).string_value (); - octave_map::const_iterator p = map.seek (nm); - - if (p != map.end ()) - retval = map.contents (p); + octave_map::const_iterator p = m_map.seek (nm); + + if (p != m_map.end ()) + retval = m_map.contents (p); else if (auto_add) retval = (isempty ()) ? Cell (dim_vector (1, 1)) : Cell (dims ()); else @@ -241,7 +241,7 @@ case '.': { - if (map.numel () > 0) + if (m_map.numel () > 0) { const Cell t = dotref (idx.front (), auto_add); @@ -338,11 +338,11 @@ std::string next_type = type.substr (2); Cell tmpc (1, 1); - auto pkey = map.seek (key); - if (pkey != map.end ()) + auto pkey = m_map.seek (key); + if (pkey != m_map.end ()) { - map.contents (pkey).make_unique (); - tmpc = map.contents (pkey).index (idx.front (), true); + m_map.contents (pkey).make_unique (); + tmpc = m_map.contents (pkey).index (idx.front (), true); } // FIXME: better code reuse? @@ -390,11 +390,11 @@ std::string next_type = type.substr (1); Cell tmpc (1, 1); - auto pkey = map.seek (key); - if (pkey != map.end ()) + auto pkey = m_map.seek (key); + if (pkey != m_map.end ()) { - map.contents (pkey).make_unique (); - tmpc = map.contents (pkey); + m_map.contents (pkey).make_unique (); + tmpc = m_map.contents (pkey); } // FIXME: better code reuse? @@ -463,19 +463,19 @@ if (didx.numel () == tmp_cell.numel ()) tmp_cell = tmp_cell.reshape (didx); - map.assign (idxf, key, tmp_cell); + m_map.assign (idxf, key, tmp_cell); count++; retval = octave_value (this); } else { - const octave_map& cmap = const_cast (map); + const octave_map& cmap = const_cast (m_map); // cast to const reference, avoid forced key insertion. if (idxf.all_scalars () || cmap.contents (key).index (idxf, true).numel () == 1) { - map.assign (idxf, + m_map.assign (idxf, key, Cell (t_rhs.storable_value ())); count++; @@ -491,7 +491,7 @@ { octave_map rhs_map = t_rhs.xmap_value ("invalid structure assignment"); - map.assign (idx.front (), rhs_map); + m_map.assign (idx.front (), rhs_map); count++; retval = octave_value (this); @@ -501,7 +501,7 @@ if (! t_rhs.isnull ()) error ("invalid structure assignment"); - map.delete_elements (idx.front ()); + m_map.delete_elements (idx.front ()); count++; retval = octave_value (this); @@ -531,13 +531,13 @@ if (numel () == tmp_cell.numel ()) tmp_cell = tmp_cell.reshape (dims ()); - map.setfield (key, tmp_cell); + m_map.setfield (key, tmp_cell); } else { Cell tmp_cell(1, 1); tmp_cell(0) = t_rhs.storable_value (); - map.setfield (key, tmp_cell); + m_map.setfield (key, tmp_cell); } count++; @@ -564,10 +564,10 @@ if (idx.length () == 0) { warn_empty_index (type_name ()); - return map; + return m_map; } else // octave_map handles indexing itself. - return map.index (idx, resize_ok); + return m_map.index (idx, resize_ok); } std::size_t @@ -577,11 +577,11 @@ std::size_t retval = 0; - for (auto p = map.cbegin (); p != map.cend (); p++) + for (auto p = m_map.cbegin (); p != m_map.cend (); p++) { - std::string key = map.key (p); - - octave_value val = octave_value (map.contents (p)); + std::string key = m_map.key (p); + + octave_value val = octave_value (m_map.contents (p)); retval += val.byte_size (); } @@ -616,13 +616,13 @@ increment_indent_level (); - string_vector key_list = map.fieldnames (); + string_vector key_list = m_map.fieldnames (); for (octave_idx_type i = 0; i < key_list.numel (); i++) { std::string key = key_list[i]; - Cell val = map.contents (key); + Cell val = m_map.contents (key); if (i > 0 || ! Vcompact_format) newline (os); @@ -686,11 +686,11 @@ octave_idx_type r, octave_idx_type c) const { octave_value val; - if (map.rows () == 1 || map.columns () == 1) + if (m_map.rows () == 1 || m_map.columns () == 1) { // Vector struct. Columns are fields, rows are values. - Cell cval = map.contents (c); + Cell cval = m_map.contents (c); val = cval(r); } @@ -699,7 +699,7 @@ // 2-d struct array. Rows and columns index individual // scalar structs. - val = map(r,c); + val = m_map(r,c); } std::string tname = val.type_name (); @@ -734,7 +734,7 @@ { std::string key = keys(i); - octave_value val = map.contents (key); + octave_value val = m_map.contents (key); bool b = save_text_data (os, val, key, false, 0); @@ -803,10 +803,10 @@ if (! is) error ("load: failed to load structure"); - map = m; + m_map = m; } else if (len == 0) - map = octave_map (dv); + m_map = octave_map (dv); else panic_impossible (); @@ -844,7 +844,7 @@ { std::string key = keys(i); - octave_value val = map.contents (key); + octave_value val = m_map.contents (key); bool b = save_binary_data (os, val, key, "", 0, save_as_floats); @@ -916,10 +916,10 @@ if (! is) error ("load: failed to load structure"); - map = m; + m_map = m; } else if (len == 0) - map = octave_map (dv); + m_map = octave_map (dv); else success = false; @@ -955,7 +955,7 @@ { std::string key = keys(i); - octave_value val = map.contents (key); + octave_value val = m_map.contents (key); bool retval2 = add_hdf5_data (data_hid, val, key, "", false, save_as_floats); @@ -1017,7 +1017,7 @@ if (retval2 >= 0) { - map = m; + m_map = m; retval = true; } @@ -1052,7 +1052,7 @@ for (int i = 0; i < nf; i++) { - Cell c = map.contents (kv[i]); + Cell c = m_map.contents (kv[i]); const octave_value *p = c.data (); @@ -1067,8 +1067,8 @@ octave_value octave_struct::fast_elem_extract (octave_idx_type n) const { - if (n < map.numel ()) - return map.checkelem (n); + if (n < m_map.numel ()) + return m_map.checkelem (n); else return octave_value (); } @@ -1079,14 +1079,14 @@ { bool retval = false; - if (n < map.numel ()) + if (n < m_map.numel ()) { // To avoid copying the scalar struct, it just stores a pointer to // itself. const octave_scalar_map *sm_ptr; void *here = reinterpret_cast(&sm_ptr); return (x.get_rep ().fast_elem_insert_self (here, btyp_struct) - && map.fast_elem_insert (n, *sm_ptr)); + && m_map.fast_elem_insert (n, *sm_ptr)); } return retval; @@ -1098,8 +1098,8 @@ void octave_scalar_struct::break_closure_cycles (const std::shared_ptr& frame) { - for (octave_idx_type i = 0; i < map.nfields (); i++) - map.contents(i).break_closure_cycles (frame); + for (octave_idx_type i = 0; i < m_map.nfields (); i++) + m_map.contents(i).break_closure_cycles (frame); } octave_value @@ -1113,7 +1113,7 @@ maybe_warn_invalid_field_name (nm, "subsref"); - retval = map.getfield (nm); + retval = m_map.getfield (nm); if (! auto_add && retval.is_undefined ()) error_with_id ("Octave:invalid-indexing", @@ -1243,11 +1243,11 @@ std::string next_type = type.substr (1); octave_value tmp; - auto pkey = map.seek (key); - if (pkey != map.end ()) + auto pkey = m_map.seek (key); + if (pkey != m_map.end ()) { - map.contents (pkey).make_unique (); - tmp = map.contents (pkey); + m_map.contents (pkey).make_unique (); + tmp = m_map.contents (pkey); } bool orig_undefined = tmp.is_undefined (); @@ -1258,7 +1258,7 @@ tmp.make_unique (); // probably a no-op. } else - // optimization: ignore the copy still stored inside our map. + // optimization: ignore the copy still stored inside our m_map. tmp.make_unique (1); t_rhs = (orig_undefined @@ -1266,7 +1266,7 @@ : tmp.subsasgn (next_type, next_idx, rhs)); } - map.setfield (key, t_rhs.storable_value ()); + m_map.setfield (key, t_rhs.storable_value ()); count++; retval = this; @@ -1274,7 +1274,7 @@ else { // Forward this case to octave_struct. - octave_value tmp (new octave_struct (octave_map (map))); + octave_value tmp (new octave_struct (octave_map (m_map))); retval = tmp.subsasgn (type, idx, rhs); } @@ -1285,7 +1285,7 @@ octave_scalar_struct::do_index_op (const octave_value_list& idx, bool resize_ok) { // octave_map handles indexing itself. - return octave_map (map).index (idx, resize_ok); + return octave_map (m_map).index (idx, resize_ok); } std::size_t @@ -1295,11 +1295,11 @@ std::size_t retval = 0; - for (auto p = map.cbegin (); p != map.cend (); p++) + for (auto p = m_map.cbegin (); p != m_map.cend (); p++) { - std::string key = map.key (p); - - octave_value val = octave_value (map.contents (p)); + std::string key = m_map.key (p); + + octave_value val = octave_value (m_map.contents (p)); retval += val.byte_size (); } @@ -1327,13 +1327,13 @@ increment_indent_level (); increment_indent_level (); - string_vector key_list = map.fieldnames (); + string_vector key_list = m_map.fieldnames (); for (octave_idx_type i = 0; i < key_list.numel (); i++) { std::string key = key_list[i]; - octave_value val = map.contents (key); + octave_value val = m_map.contents (key); if (print_fieldnames_only) { @@ -1397,7 +1397,7 @@ { // Scalar struct. Rows are fields, single column for values. - octave_value val = map.contents (r); + octave_value val = m_map.contents (r); std::string tname = val.type_name (); dim_vector dv = val.dims (); @@ -1430,7 +1430,7 @@ { std::string key = keys(i); - octave_value val = map.contents (key); + octave_value val = m_map.contents (key); bool b = save_text_data (os, val, key, false, 0); @@ -1471,10 +1471,10 @@ if (! is) error ("load: failed to load structure"); - map = m; + m_map = m; } else if (len == 0) - map = octave_scalar_map (); + m_map = octave_scalar_map (); else panic_impossible (); @@ -1499,7 +1499,7 @@ { std::string key = keys(i); - octave_value val = map.contents (key); + octave_value val = m_map.contents (key); bool b = save_binary_data (os, val, key, "", 0, save_as_floats); @@ -1544,10 +1544,10 @@ if (! is) error ("load: failed to load structure"); - map = m; + m_map = m; } else if (len == 0) - map = octave_scalar_map (); + m_map = octave_scalar_map (); else success = false; @@ -1583,7 +1583,7 @@ { std::string key = keys(i); - octave_value val = map.contents (key); + octave_value val = m_map.contents (key); bool retval2 = add_hdf5_data (data_hid, val, key, "", false, save_as_floats); @@ -1643,7 +1643,7 @@ if (retval2 >= 0) { - map = m; + m_map = m; retval = true; } @@ -1678,7 +1678,7 @@ for (int i = 0; i < nf; i++) { - Cell c = map.contents (kv[i]); + Cell c = m_map.contents (kv[i]); const octave_value *p = c.data (); @@ -1693,7 +1693,7 @@ octave_value octave_scalar_struct::to_array (void) { - return new octave_struct (octave_map (map)); + return new octave_struct (octave_map (m_map)); } bool @@ -1703,7 +1703,7 @@ if (btyp == btyp_struct) { - *(reinterpret_cast(where)) = ↦ + *(reinterpret_cast(where)) = &m_map; return true; } else @@ -1837,7 +1837,7 @@ // Create the return value. - octave_map map (dims); + octave_map m_map (dims); for (int i = 0; i < nargin; i+= 2) { @@ -1858,15 +1858,15 @@ const Cell c (args(i+1).cell_value ()); if (scalar (c.dims ())) - map.setfield (key, Cell (dims, c(0))); + m_map.setfield (key, Cell (dims, c(0))); else - map.setfield (key, c); + m_map.setfield (key, c); } else - map.setfield (key, Cell (dims, args(i+1))); + m_map.setfield (key, Cell (dims, args(i+1))); } - return ovl (map); + return ovl (m_map); } /* @@ -2125,16 +2125,16 @@ rdv.resize (nd-1); } - octave_map map (rdv); + octave_map m_map (rdv); Array ia (dim_vector (nd, 1), idx_vector::colon); for (octave_idx_type i = 0; i < ext; i++) { ia(dim) = i; - map.setfield (fields(i), vals.index (ia).reshape (rdv)); + m_map.setfield (fields(i), vals.index (ia).reshape (rdv)); } - return ovl (map); + return ovl (m_map); } /* diff -r 43622407af81 -r b16e0d357437 libinterp/octave-value/ov-struct.h --- a/libinterp/octave-value/ov-struct.h Mon Aug 30 10:52:39 2021 -0700 +++ b/libinterp/octave-value/ov-struct.h Mon Aug 30 14:02:47 2021 -0400 @@ -51,13 +51,13 @@ public: octave_struct (void) - : octave_base_value (), map () { } + : octave_base_value (), m_map () { } octave_struct (const octave_map& m) - : octave_base_value (), map (m) { } + : octave_base_value (), m_map (m) { } octave_struct (const octave_struct& s) - : octave_base_value (), map (s.map) { } + : octave_base_value (), m_map (s.m_map) { } ~octave_struct (void) = default; @@ -91,15 +91,15 @@ const std::list& idx, const octave_value& rhs); - octave_value squeeze (void) const { return map.squeeze (); } + octave_value squeeze (void) const { return m_map.squeeze (); } octave_value permute (const Array& vec, bool inv = false) const - { return map.permute (vec, inv); } + { return m_map.permute (vec, inv); } octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false); - dim_vector dims (void) const { return map.dims (); } + dim_vector dims (void) const { return m_map.dims (); } std::size_t byte_size (void) const; @@ -107,16 +107,16 @@ // of elements is numel () * nfields (). octave_idx_type numel (void) const { - return map.numel (); + return m_map.numel (); } - octave_idx_type nfields (void) const { return map.nfields (); } + octave_idx_type nfields (void) const { return m_map.nfields (); } octave_value reshape (const dim_vector& new_dims) const - { return map.reshape (new_dims); } + { return m_map.reshape (new_dims); } octave_value resize (const dim_vector& dv, bool fill = false) const - { octave_map tmap = map; tmap.resize (dv, fill); return tmap; } + { octave_map tmap = m_map; tmap.resize (dv, fill); return tmap; } bool is_defined (void) const { return true; } @@ -126,9 +126,9 @@ builtin_type_t builtin_type (void) const { return btyp_struct; } - octave_map map_value (void) const { return map; } + octave_map map_value (void) const { return m_map; } - string_vector map_keys (void) const { return map.fieldnames (); } + string_vector map_keys (void) const { return m_map.fieldnames (); } void print (std::ostream& os, bool pr_as_read_syntax = false); @@ -163,7 +163,7 @@ protected: // The associative array used to manage the structure data. - octave_map map; + octave_map m_map; private: @@ -176,16 +176,16 @@ public: octave_scalar_struct (void) - : octave_base_value (), map () { } + : octave_base_value (), m_map () { } octave_scalar_struct (const octave_scalar_map& m) - : octave_base_value (), map (m) { } + : octave_base_value (), m_map (m) { } octave_scalar_struct (const std::map& m) - : octave_base_value (), map (m) { } + : octave_base_value (), m_map (m) { } octave_scalar_struct (const octave_scalar_struct& s) - : octave_base_value (), map (s.map) { } + : octave_base_value (), m_map (s.m_map) { } ~octave_scalar_struct (void) = default; @@ -215,10 +215,10 @@ const std::list& idx, const octave_value& rhs); - octave_value squeeze (void) const { return map; } + octave_value squeeze (void) const { return m_map; } octave_value permute (const Array& vec, bool inv = false) const - { return octave_map (map).permute (vec, inv); } + { return octave_map (m_map).permute (vec, inv); } octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false); @@ -234,13 +234,13 @@ return 1; } - octave_idx_type nfields (void) const { return map.nfields (); } + octave_idx_type nfields (void) const { return m_map.nfields (); } octave_value reshape (const dim_vector& new_dims) const - { return octave_map (map).reshape (new_dims); } + { return octave_map (m_map).reshape (new_dims); } octave_value resize (const dim_vector& dv, bool fill = false) const - { octave_map tmap = map; tmap.resize (dv, fill); return tmap; } + { octave_map tmap = m_map; tmap.resize (dv, fill); return tmap; } bool is_defined (void) const { return true; } @@ -250,11 +250,11 @@ builtin_type_t builtin_type (void) const { return btyp_struct; } - octave_map map_value (void) const { return map; } + octave_map map_value (void) const { return m_map; } - octave_scalar_map scalar_map_value (void) const { return map; } + octave_scalar_map scalar_map_value (void) const { return m_map; } - string_vector map_keys (void) const { return map.fieldnames (); } + string_vector map_keys (void) const { return m_map.fieldnames (); } void print (std::ostream& os, bool pr_as_read_syntax = false); @@ -285,7 +285,7 @@ protected: // The associative array used to manage the structure data. - octave_scalar_map map; + octave_scalar_map m_map; private: diff -r 43622407af81 -r b16e0d357437 libinterp/octave-value/ov-typeinfo.cc --- a/libinterp/octave-value/ov-typeinfo.cc Mon Aug 30 10:52:39 2021 -0700 +++ b/libinterp/octave-value/ov-typeinfo.cc Mon Aug 30 14:02:47 2021 -0400 @@ -66,20 +66,20 @@ } type_info::type_info (int init_tab_sz) - : num_types (0), types (dim_vector (init_tab_sz, 1), ""), - vals (dim_vector (init_tab_sz, 1)), - unary_class_ops (dim_vector (octave_value::num_unary_ops, 1), nullptr), - unary_ops (dim_vector (octave_value::num_unary_ops, init_tab_sz), nullptr), - non_const_unary_ops (dim_vector (octave_value::num_unary_ops, init_tab_sz), nullptr), - binary_class_ops (dim_vector (octave_value::num_binary_ops, 1), nullptr), - binary_ops (dim_vector (octave_value::num_binary_ops, init_tab_sz, init_tab_sz), nullptr), - compound_binary_class_ops (dim_vector (octave_value::num_compound_binary_ops, 1), nullptr), - compound_binary_ops (dim_vector (octave_value::num_compound_binary_ops, init_tab_sz, init_tab_sz), nullptr), - cat_ops (dim_vector (init_tab_sz, init_tab_sz), nullptr), - assign_ops (dim_vector (octave_value::num_assign_ops, init_tab_sz, init_tab_sz), nullptr), - assignany_ops (dim_vector (octave_value::num_assign_ops, init_tab_sz), nullptr), - pref_assign_conv (dim_vector (init_tab_sz, init_tab_sz), -1), - widening_ops (dim_vector (init_tab_sz, init_tab_sz), nullptr) + : m_num_types (0), m_types (dim_vector (init_tab_sz, 1), ""), + m_vals (dim_vector (init_tab_sz, 1)), + m_unary_class_ops (dim_vector (octave_value::num_unary_ops, 1), nullptr), + m_unary_ops (dim_vector (octave_value::num_unary_ops, init_tab_sz), nullptr), + m_non_const_unary_ops (dim_vector (octave_value::num_unary_ops, init_tab_sz), nullptr), + m_binary_class_ops (dim_vector (octave_value::num_binary_ops, 1), nullptr), + m_binary_ops (dim_vector (octave_value::num_binary_ops, init_tab_sz, init_tab_sz), nullptr), + m_compound_binary_class_ops (dim_vector (octave_value::num_compound_binary_ops, 1), nullptr), + m_compound_binary_ops (dim_vector (octave_value::num_compound_binary_ops, init_tab_sz, init_tab_sz), nullptr), + m_cat_ops (dim_vector (init_tab_sz, init_tab_sz), nullptr), + m_assign_ops (dim_vector (octave_value::num_assign_ops, init_tab_sz, init_tab_sz), nullptr), + m_assignany_ops (dim_vector (octave_value::num_assign_ops, init_tab_sz), nullptr), + m_pref_assign_conv (dim_vector (init_tab_sz, init_tab_sz), -1), + m_widening_ops (dim_vector (init_tab_sz, init_tab_sz), nullptr) { install_types (*this); @@ -93,9 +93,9 @@ { int i = 0; - for (i = 0; i < num_types; i++) + for (i = 0; i < m_num_types; i++) { - if (t_name == types (i)) + if (t_name == m_types (i)) { if (abort_on_duplicate) { @@ -109,43 +109,43 @@ } } - int len = types.numel (); + int len = m_types.numel (); if (i == len) { len *= 2; - types.resize (dim_vector (len, 1), ""); + m_types.resize (dim_vector (len, 1), ""); - vals.resize (dim_vector (len, 1), nullptr); + m_vals.resize (dim_vector (len, 1), nullptr); - unary_ops.resize + m_unary_ops.resize (dim_vector (octave_value::num_unary_ops, len), nullptr); - non_const_unary_ops.resize + m_non_const_unary_ops.resize (dim_vector (octave_value::num_unary_ops, len), nullptr); - binary_ops.resize + m_binary_ops.resize (dim_vector (octave_value::num_binary_ops, len, len), nullptr); - compound_binary_ops.resize + m_compound_binary_ops.resize (dim_vector (octave_value::num_compound_binary_ops, len, len), nullptr); - cat_ops.resize (dim_vector (len, len), nullptr); + m_cat_ops.resize (dim_vector (len, len), nullptr); - assign_ops.resize + m_assign_ops.resize (dim_vector (octave_value::num_assign_ops, len, len), nullptr); - assignany_ops.resize + m_assignany_ops.resize (dim_vector (octave_value::num_assign_ops, len), nullptr); - pref_assign_conv.resize (dim_vector (len, len), -1); + m_pref_assign_conv.resize (dim_vector (len, len), -1); - widening_ops.resize (dim_vector (len, len), nullptr); + m_widening_ops.resize (dim_vector (len, len), nullptr); } - types (i) = t_name; + m_types (i) = t_name; // Yes, this object is intentionally not deleted in the destructor // so that we avoid a crash on exit for user-defined data types. @@ -153,9 +153,9 @@ // could be stored as an object instead of a pointer to an object // allocated with new. - vals(i) = new octave_value (val); + m_vals(i) = new octave_value (val); - num_types++; + m_num_types++; return i; } @@ -179,7 +179,7 @@ op_name.c_str ()); } - unary_class_ops.checkelem (static_cast (op)) + m_unary_class_ops.checkelem (static_cast (op)) = reinterpret_cast (f); return false; @@ -191,7 +191,7 @@ if (lookup_unary_op (op, t)) { std::string op_name = octave_value::unary_op_as_string (op); - std::string type_name = types(t); + std::string type_name = m_types(t); if (abort_on_duplicate) { @@ -204,7 +204,7 @@ op_name.c_str (), type_name.c_str ()); } - unary_ops.checkelem (static_cast (op), t) = reinterpret_cast (f); + m_unary_ops.checkelem (static_cast (op), t) = reinterpret_cast (f); return false; } @@ -217,7 +217,7 @@ if (lookup_non_const_unary_op (op, t)) { std::string op_name = octave_value::unary_op_as_string (op); - std::string type_name = types(t); + std::string type_name = m_types(t); if (abort_on_duplicate) { @@ -230,7 +230,7 @@ op_name.c_str (), type_name.c_str ()); } - non_const_unary_ops.checkelem (static_cast (op), t) + m_non_const_unary_ops.checkelem (static_cast (op), t) = reinterpret_cast (f); return false; @@ -257,7 +257,7 @@ op_name.c_str ()); } - binary_class_ops.checkelem (static_cast (op)) + m_binary_class_ops.checkelem (static_cast (op)) = reinterpret_cast (f); return false; @@ -271,8 +271,8 @@ if (lookup_binary_op (op, t1, t2)) { std::string op_name = octave_value::binary_op_as_string (op); - std::string t1_name = types(t1); - std::string t2_name = types(t2); + std::string t1_name = m_types(t1); + std::string t2_name = m_types(t2); if (abort_on_duplicate) { @@ -286,7 +286,7 @@ op_name.c_str (), t1_name.c_str (), t1_name.c_str ()); } - binary_ops.checkelem (static_cast (op), t1, t2) + m_binary_ops.checkelem (static_cast (op), t1, t2) = reinterpret_cast (f); return false; @@ -312,7 +312,7 @@ op_name.c_str ()); } - compound_binary_class_ops.checkelem (static_cast (op)) + m_compound_binary_class_ops.checkelem (static_cast (op)) = reinterpret_cast (f); return false; @@ -326,8 +326,8 @@ if (lookup_binary_op (op, t1, t2)) { std::string op_name = octave_value::binary_op_fcn_name (op); - std::string t1_name = types(t1); - std::string t2_name = types(t2); + std::string t1_name = m_types(t1); + std::string t2_name = m_types(t2); if (abort_on_duplicate) { @@ -341,7 +341,7 @@ op_name.c_str (), t1_name.c_str (), t1_name.c_str ()); } - compound_binary_ops.checkelem (static_cast (op), t1, t2) + m_compound_binary_ops.checkelem (static_cast (op), t1, t2) = reinterpret_cast (f); return false; @@ -352,8 +352,8 @@ { if (lookup_cat_op (t1, t2)) { - std::string t1_name = types(t1); - std::string t2_name = types(t2); + std::string t1_name = m_types(t1); + std::string t2_name = m_types(t2); if (abort_on_duplicate) { @@ -366,7 +366,7 @@ t1_name.c_str (), t1_name.c_str ()); } - cat_ops.checkelem (t1, t2) = reinterpret_cast (f); + m_cat_ops.checkelem (t1, t2) = reinterpret_cast (f); return false; } @@ -379,8 +379,8 @@ if (lookup_assign_op (op, t_lhs, t_rhs)) { std::string op_name = octave_value::assign_op_as_string (op); - std::string t_lhs_name = types(t_lhs); - std::string t_rhs_name = types(t_rhs); + std::string t_lhs_name = m_types(t_lhs); + std::string t_rhs_name = m_types(t_rhs); if (abort_on_duplicate) { @@ -394,7 +394,7 @@ op_name.c_str (), t_lhs_name.c_str (), t_rhs_name.c_str ()); } - assign_ops.checkelem (static_cast (op), t_lhs, t_rhs) + m_assign_ops.checkelem (static_cast (op), t_lhs, t_rhs) = reinterpret_cast (f); return false; @@ -407,7 +407,7 @@ if (lookup_assignany_op (op, t_lhs)) { std::string op_name = octave_value::assign_op_as_string (op); - std::string t_lhs_name = types(t_lhs); + std::string t_lhs_name = m_types(t_lhs); if (abort_on_duplicate) { @@ -420,7 +420,7 @@ op_name.c_str (), t_lhs_name.c_str ()); } - assignany_ops.checkelem (static_cast (op), t_lhs) + m_assignany_ops.checkelem (static_cast (op), t_lhs) = reinterpret_cast (f); return false; @@ -432,8 +432,8 @@ { if (lookup_pref_assign_conv (t_lhs, t_rhs) >= 0) { - std::string t_lhs_name = types(t_lhs); - std::string t_rhs_name = types(t_rhs); + std::string t_lhs_name = m_types(t_lhs); + std::string t_rhs_name = m_types(t_rhs); if (abort_on_duplicate) { @@ -447,7 +447,7 @@ t_lhs_name.c_str (), t_rhs_name.c_str ()); } - pref_assign_conv.checkelem (t_lhs, t_rhs) = t_result; + m_pref_assign_conv.checkelem (t_lhs, t_rhs) = t_result; return false; } @@ -458,8 +458,8 @@ { if (lookup_widening_op (t, t_result)) { - std::string t_name = types(t); - std::string t_result_name = types(t_result); + std::string t_name = m_types(t); + std::string t_result_name = m_types(t_result); if (abort_on_duplicate) { @@ -472,7 +472,7 @@ t_name.c_str (), t_result_name.c_str ()); } - widening_ops.checkelem (t, t_result) = reinterpret_cast (f); + m_widening_ops.checkelem (t, t_result) = reinterpret_cast (f); return false; } @@ -481,11 +481,11 @@ { octave_value retval; - for (int i = 0; i < num_types; i++) + for (int i = 0; i < m_num_types; i++) { - if (nm == types(i)) + if (nm == m_types(i)) { - retval = *vals(i); + retval = *m_vals(i); retval.make_unique (); break; } @@ -497,42 +497,42 @@ type_info::unary_class_op_fcn type_info::lookup_unary_class_op (octave_value::unary_op op) { - void *f = unary_class_ops.checkelem (static_cast (op)); + void *f = m_unary_class_ops.checkelem (static_cast (op)); return reinterpret_cast (f); } type_info::unary_op_fcn type_info::lookup_unary_op (octave_value::unary_op op, int t) { - void *f = unary_ops.checkelem (static_cast (op), t); + void *f = m_unary_ops.checkelem (static_cast (op), t); return reinterpret_cast (f); } type_info::non_const_unary_op_fcn type_info::lookup_non_const_unary_op (octave_value::unary_op op, int t) { - void *f = non_const_unary_ops.checkelem (static_cast (op), t); + void *f = m_non_const_unary_ops.checkelem (static_cast (op), t); return reinterpret_cast (f); } type_info::binary_class_op_fcn type_info::lookup_binary_class_op (octave_value::binary_op op) { - void *f = binary_class_ops.checkelem (static_cast (op)); + void *f = m_binary_class_ops.checkelem (static_cast (op)); return reinterpret_cast (f); } type_info::binary_op_fcn type_info::lookup_binary_op (octave_value::binary_op op, int t1, int t2) { - void *f = binary_ops.checkelem (static_cast (op), t1, t2); + void *f = m_binary_ops.checkelem (static_cast (op), t1, t2); return reinterpret_cast (f); } type_info::binary_class_op_fcn type_info::lookup_binary_class_op (octave_value::compound_binary_op op) { - void *f = compound_binary_class_ops.checkelem (static_cast (op)); + void *f = m_compound_binary_class_ops.checkelem (static_cast (op)); return reinterpret_cast (f); } @@ -540,14 +540,14 @@ type_info::lookup_binary_op (octave_value::compound_binary_op op, int t1, int t2) { - void *f = compound_binary_ops.checkelem (static_cast (op), t1, t2); + void *f = m_compound_binary_ops.checkelem (static_cast (op), t1, t2); return reinterpret_cast (f); } type_info::cat_op_fcn type_info::lookup_cat_op (int t1, int t2) { - void *f = cat_ops.checkelem (t1, t2); + void *f = m_cat_ops.checkelem (t1, t2); return reinterpret_cast (f); } @@ -555,37 +555,37 @@ type_info::lookup_assign_op (octave_value::assign_op op, int t_lhs, int t_rhs) { - void *f = assign_ops.checkelem (static_cast (op), t_lhs, t_rhs); + void *f = m_assign_ops.checkelem (static_cast (op), t_lhs, t_rhs); return reinterpret_cast (f); } type_info::assignany_op_fcn type_info::lookup_assignany_op (octave_value::assign_op op, int t_lhs) { - void *f = assignany_ops.checkelem (static_cast (op), t_lhs); + void *f = m_assignany_ops.checkelem (static_cast (op), t_lhs); return reinterpret_cast (f); } int type_info::lookup_pref_assign_conv (int t_lhs, int t_rhs) { - return pref_assign_conv.checkelem (t_lhs, t_rhs); + return m_pref_assign_conv.checkelem (t_lhs, t_rhs); } octave_base_value::type_conv_fcn type_info::lookup_widening_op (int t, int t_result) { - void *f = widening_ops.checkelem (t, t_result); + void *f = m_widening_ops.checkelem (t, t_result); return reinterpret_cast (f); } string_vector type_info::installed_type_names (void) const { - string_vector retval (num_types); + string_vector retval (m_num_types); - for (int i = 0; i < num_types; i++) - retval(i) = types(i); + for (int i = 0; i < m_num_types; i++) + retval(i) = m_types(i); return retval; } @@ -595,8 +595,8 @@ { octave_scalar_map retval; - int len = std::min (static_cast (non_const_unary_ops.columns ()), - num_types); + int len = std::min (static_cast (m_non_const_unary_ops.columns ()), + m_num_types); dim_vector tab_dims (1, len); @@ -605,7 +605,7 @@ boolNDArray tab (tab_dims); for (int i = 0; i < len; i++) - tab.xelem (i) = (unary_ops(j,i) != nullptr); + tab.xelem (i) = (m_unary_ops(j,i) != nullptr); octave_value::unary_op op_id = static_cast (j); @@ -620,8 +620,8 @@ { octave_scalar_map retval; - int len = std::min (static_cast (non_const_unary_ops.columns ()), - num_types); + int len = std::min (static_cast (m_non_const_unary_ops.columns ()), + m_num_types); dim_vector tab_dims (1, len); @@ -630,7 +630,7 @@ boolNDArray tab (tab_dims); for (int i = 0; i < len; i++) - tab.xelem (i) = (non_const_unary_ops(j,i) != nullptr); + tab.xelem (i) = (m_non_const_unary_ops(j,i) != nullptr); octave_value::unary_op op_id = static_cast (j); @@ -645,7 +645,7 @@ { octave_scalar_map retval; - int len = std::min (static_cast (binary_ops.columns ()), num_types); + int len = std::min (static_cast (m_binary_ops.columns ()), m_num_types); dim_vector tab_dims (len, len); @@ -655,7 +655,7 @@ for (int j = 0; j < len; j++) for (int i = 0; i < len; i++) - tab.xelem (j,i) = (binary_ops(k,j,i) != nullptr); + tab.xelem (j,i) = (m_binary_ops(k,j,i) != nullptr); octave_value::binary_op op_id = static_cast (k); @@ -670,8 +670,8 @@ { octave_scalar_map retval; - int len = std::min (static_cast (compound_binary_ops.columns ()), - num_types); + int len = std::min (static_cast (m_compound_binary_ops.columns ()), + m_num_types); dim_vector tab_dims (len, len); @@ -681,7 +681,7 @@ for (int j = 0; j < len; j++) for (int i = 0; i < len; i++) - tab.xelem (j,i) = (compound_binary_ops(k,j,i) != nullptr); + tab.xelem (j,i) = (m_compound_binary_ops(k,j,i) != nullptr); octave_value::compound_binary_op op_id = static_cast (k); @@ -697,7 +697,7 @@ { octave_scalar_map retval; - int len = std::min (static_cast (assign_ops.columns ()), num_types); + int len = std::min (static_cast (m_assign_ops.columns ()), m_num_types); dim_vector tab_dims (len, len); @@ -707,7 +707,7 @@ for (int j = 0; j < len; j++) for (int i = 0; i < len; i++) - tab.xelem (j,i) = (assign_ops(k,j,i) != nullptr); + tab.xelem (j,i) = (m_assign_ops(k,j,i) != nullptr); octave_value::assign_op op_id = static_cast (k); @@ -722,7 +722,7 @@ { octave_scalar_map retval; - int len = std::min (static_cast (assignany_ops.columns ()), num_types); + int len = std::min (static_cast (m_assignany_ops.columns ()), m_num_types); dim_vector tab_dims (1, len); @@ -731,7 +731,7 @@ boolNDArray tab (tab_dims); for (int i = 0; i < len; i++) - tab.xelem (i) = (assignany_ops(j,i) != nullptr); + tab.xelem (i) = (m_assignany_ops(j,i) != nullptr); octave_value::assign_op op_id = static_cast (j); @@ -751,11 +751,11 @@ retval.setfield ("non_const_unary_ops", non_const_unary_ops_map ()); retval.setfield ("binary_ops", binary_ops_map ()); retval.setfield ("compound_binary_ops", compound_binary_ops_map ()); - retval.setfield ("cat_ops", as_bool_nd_array (cat_ops)); + retval.setfield ("cat_ops", as_bool_nd_array (m_cat_ops)); retval.setfield ("assign_ops", assign_ops_map ()); retval.setfield ("assignany_ops", assignany_ops_map ()); - retval.setfield ("pref_assign_conv", as_nd_array (pref_assign_conv)); - retval.setfield ("widening_ops", as_bool_nd_array (widening_ops)); + retval.setfield ("pref_assign_conv", as_nd_array (m_pref_assign_conv)); + retval.setfield ("widening_ops", as_bool_nd_array (m_widening_ops)); return retval; } diff -r 43622407af81 -r b16e0d357437 libinterp/octave-value/ov-typeinfo.h --- a/libinterp/octave-value/ov-typeinfo.h Mon Aug 30 10:52:39 2021 -0700 +++ b/libinterp/octave-value/ov-typeinfo.h Mon Aug 30 14:02:47 2021 -0400 @@ -237,35 +237,35 @@ private: - int num_types; + int m_num_types; - Array types; + Array m_types; - Array vals; + Array m_vals; - Array unary_class_ops; + Array m_unary_class_ops; - Array unary_ops; + Array m_unary_ops; - Array non_const_unary_ops; + Array m_non_const_unary_ops; - Array binary_class_ops; + Array m_binary_class_ops; - Array binary_ops; + Array m_binary_ops; - Array compound_binary_class_ops; + Array m_compound_binary_class_ops; - Array compound_binary_ops; + Array m_compound_binary_ops; - Array cat_ops; + Array m_cat_ops; - Array assign_ops; + Array m_assign_ops; - Array assignany_ops; + Array m_assignany_ops; - Array pref_assign_conv; + Array m_pref_assign_conv; - Array widening_ops; + Array m_widening_ops; }; OCTAVE_NAMESPACE_END