Mercurial > octave
changeset 32589:05b4479c29d8 stable
maint: C++ style check for libinterp/ before 9.1 release.
* libinterp/corefcn/__ichol__.cc, libinterp/corefcn/__ilu__.cc,
libinterp/corefcn/bsxfun.cc, libinterp/corefcn/call-stack.cc,
libinterp/corefcn/defaults.cc, libinterp/corefcn/environment.cc,
libinterp/corefcn/error.cc, libinterp/corefcn/event-manager.cc,
libinterp/corefcn/ft-text-renderer.cc, libinterp/corefcn/gl-render.cc,
libinterp/corefcn/graphics-utils.cc, libinterp/corefcn/graphics.cc,
libinterp/corefcn/graphics.in.h, libinterp/corefcn/help.cc,
libinterp/corefcn/hook-fcn.cc, libinterp/corefcn/input.cc,
libinterp/corefcn/interpreter-private.cc, libinterp/corefcn/interpreter.cc,
libinterp/corefcn/load-path.cc, libinterp/corefcn/load-save.cc,
libinterp/corefcn/ls-hdf5.cc, libinterp/corefcn/lu.cc,
libinterp/corefcn/mex.cc, libinterp/corefcn/oct-hist.cc,
libinterp/corefcn/oct-map.cc, libinterp/corefcn/oct-stream.cc,
libinterp/corefcn/pager.cc, libinterp/corefcn/perms.cc,
libinterp/corefcn/pr-output.cc, libinterp/corefcn/qr.cc,
libinterp/corefcn/settings.cc, libinterp/corefcn/sparse-xdiv.cc,
libinterp/corefcn/stack-frame.cc, libinterp/corefcn/syminfo.cc,
libinterp/corefcn/symrcm.cc, libinterp/corefcn/symscope.cc,
libinterp/corefcn/symtab.cc, libinterp/corefcn/sysdep.cc,
libinterp/corefcn/tsearch.cc, libinterp/corefcn/url-handle-manager.cc,
libinterp/corefcn/utils.cc, libinterp/corefcn/xnorm.cc,
libinterp/dldfcn/__init_fltk__.cc, libinterp/octave-value/ov-base.cc,
libinterp/octave-value/ov-bool-mat.cc, libinterp/octave-value/ov-cell.cc,
libinterp/octave-value/ov-ch-mat.cc, libinterp/octave-value/ov-class.cc,
libinterp/octave-value/ov-classdef.cc, libinterp/octave-value/ov-fcn-handle.cc,
libinterp/octave-value/ov-fcn-handle.h, libinterp/octave-value/ov-fcn.h,
libinterp/octave-value/ov-inline.h, libinterp/octave-value/ov-lazy-idx.cc,
libinterp/octave-value/ov-range.cc, libinterp/octave-value/ov-range.h,
libinterp/octave-value/ov-typeinfo.cc, libinterp/octave-value/ov-usr-fcn.cc,
libinterp/octave-value/ov.cc, libinterp/octave.cc,
libinterp/parse-tree/anon-fcn-validator.cc, libinterp/parse-tree/bp-table.cc,
libinterp/parse-tree/oct-lvalue.cc, libinterp/parse-tree/pt-classdef.cc,
libinterp/parse-tree/pt-colon.cc, libinterp/parse-tree/pt-eval.cc,
libinterp/parse-tree/pt-eval.h, libinterp/parse-tree/pt-tm-const.cc,
libinterp/parse-tree/pt-walk.cc:
C++ style check for libinterp/ before 9.1 release.
line wrap: on
line diff
--- a/libinterp/corefcn/__ichol__.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/__ichol__.cc Tue Dec 12 18:24:05 2023 -0800 @@ -52,12 +52,14 @@ return a * b; } -double ichol_mult_real (double a, double b) +double +ichol_mult_real (double a, double b) { return a * b; } -bool ichol_checkpivot_complex (Complex pivot) +bool +ichol_checkpivot_complex (Complex pivot) { if (fabs (pivot.imag ()) > std::numeric_limits<double>::epsilon()) error ("ichol: non-real pivot encountered. The matrix must be Hermitian."); @@ -67,7 +69,8 @@ return true; } -bool ichol_checkpivot_real (double pivot) +bool +ichol_checkpivot_real (double pivot) { if (pivot < 0) error ("ichol: negative pivot encountered"); @@ -77,7 +80,8 @@ template <typename octave_matrix_t, typename T, T (*ichol_mult) (T, T), bool (*ichol_checkpivot) (T)> -void ichol_0 (octave_matrix_t& sm, const std::string michol = "off") +void +ichol_0 (octave_matrix_t& sm, const std::string michol = "off") { const octave_idx_type n = sm.cols (); octave_idx_type j1, jend, j2, jrow, jjrow, j, jw, i, k, jj, r; @@ -220,8 +224,9 @@ template <typename octave_matrix_t, typename T, T (*ichol_mult) (T, T), bool (*ichol_checkpivot) (T)> -void ichol_t (const octave_matrix_t& sm, octave_matrix_t& L, const T *cols_norm, - const T droptol, const std::string michol = "off") +void +ichol_t (const octave_matrix_t& sm, octave_matrix_t& L, const T *cols_norm, + const T droptol, const std::string michol = "off") { const octave_idx_type n = sm.cols ();
--- a/libinterp/corefcn/__ilu__.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/__ilu__.cc Tue Dec 12 18:24:05 2023 -0800 @@ -183,10 +183,11 @@ } template <typename octave_matrix_t, typename T> -void ilu_crout (octave_matrix_t& sm_l, octave_matrix_t& sm_u, - octave_matrix_t& L, octave_matrix_t& U, T *cols_norm, - T *rows_norm, const T droptol = 0, - const std::string milu = "off") +void +ilu_crout (octave_matrix_t& sm_l, octave_matrix_t& sm_u, + octave_matrix_t& L, octave_matrix_t& U, T *cols_norm, + T *rows_norm, const T droptol = 0, + const std::string milu = "off") { // Map the strings into chars for faster comparing inside loops char opt; @@ -523,11 +524,12 @@ // case IKJ version is used and column pivoting is performed. template <typename octave_matrix_t, typename T> -void ilu_tp (octave_matrix_t& sm, octave_matrix_t& L, octave_matrix_t& U, - octave_idx_type nnz_u, octave_idx_type nnz_l, T *cols_norm, - Array <octave_idx_type>& perm_vec, const T droptol = T(0), - const T thresh = T(0), const std::string milu = "off", - const double udiag = 0) +void +ilu_tp (octave_matrix_t& sm, octave_matrix_t& L, octave_matrix_t& U, + octave_idx_type nnz_u, octave_idx_type nnz_l, T *cols_norm, + Array <octave_idx_type>& perm_vec, const T droptol = T(0), + const T thresh = T(0), const std::string milu = "off", + const double udiag = 0) { char opt; enum {OFF, ROW, COL};
--- a/libinterp/corefcn/bsxfun.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/bsxfun.cc Tue Dec 12 18:24:05 2023 -0800 @@ -130,7 +130,8 @@ return octave_value (bsxfun_pow (xa, ya)); } -static void maybe_fill_table () +static void +maybe_fill_table () { static bool filled = false; if (filled)
--- a/libinterp/corefcn/call-stack.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/call-stack.cc Tue Dec 12 18:24:05 2023 -0800 @@ -63,7 +63,8 @@ push (symbol_scope ("top scope")); } -octave_function *call_stack::current_function (bool skip_first) const +octave_function * +call_stack::current_function (bool skip_first) const { if (m_cs.empty ()) error ("current_function: call stack is empty"); @@ -88,7 +89,8 @@ return fcn; } -int call_stack::current_line () const +int +call_stack::current_line () const { int retval = -1; @@ -101,7 +103,8 @@ return retval; } -int call_stack::current_column () const +int +call_stack::current_column () const { int retval = -1; @@ -114,7 +117,8 @@ return retval; } -octave_user_code *call_stack::current_user_code () const +octave_user_code * +call_stack::current_user_code () const { // Start at current frame. @@ -133,7 +137,8 @@ return nullptr; } -int call_stack::current_user_code_line () const +int +call_stack::current_user_code_line () const { // Start at current frame. @@ -157,7 +162,8 @@ return -1; } -int call_stack::current_user_code_column () const +int +call_stack::current_user_code_column () const { // Start at current frame. @@ -181,7 +187,8 @@ return -1; } -unwind_protect *call_stack::curr_fcn_unwind_protect_frame () +unwind_protect * +call_stack::curr_fcn_unwind_protect_frame () { // Start at current frame. @@ -200,7 +207,8 @@ return nullptr; } -octave_user_code *call_stack::debug_user_code () const +octave_user_code * +call_stack::debug_user_code () const { octave_user_code *retval = nullptr; @@ -226,7 +234,8 @@ return retval; } -int call_stack::debug_user_code_line () const +int +call_stack::debug_user_code_line () const { int retval = -1; @@ -255,7 +264,8 @@ return retval; } -int call_stack::debug_user_code_column () const +int +call_stack::debug_user_code_column () const { int retval = -1; @@ -285,17 +295,20 @@ return retval; } -std::string call_stack::get_dispatch_class () const +std::string +call_stack::get_dispatch_class () const { return m_cs[m_curr_frame]->get_dispatch_class (); } -void call_stack::set_dispatch_class (const std::string& class_name) +void +call_stack::set_dispatch_class (const std::string& class_name) { m_cs[m_curr_frame]->set_dispatch_class (class_name); } -bool call_stack::is_class_method_executing (std::string& dispatch_class) const +bool +call_stack::is_class_method_executing (std::string& dispatch_class) const { dispatch_class = ""; @@ -309,7 +322,8 @@ return retval; } -bool call_stack::is_class_constructor_executing (std::string& dispatch_class) const +bool +call_stack::is_class_constructor_executing (std::string& dispatch_class) const { dispatch_class = ""; @@ -323,7 +337,8 @@ return retval; } -bool call_stack::all_scripts () const +bool +call_stack::all_scripts () const { bool retval = true; @@ -375,7 +390,8 @@ : parent_link); } -void call_stack::push (const symbol_scope& scope) +void +call_stack::push (const symbol_scope& scope) { std::size_t new_frame_idx; std::shared_ptr<stack_frame> parent_link; @@ -392,8 +408,9 @@ m_curr_frame = new_frame_idx; } -void call_stack::push (octave_user_function *fcn, - const std::shared_ptr<stack_frame>& closure_frames) +void +call_stack::push (octave_user_function *fcn, + const std::shared_ptr<stack_frame>& closure_frames) { std::size_t new_frame_idx; std::shared_ptr<stack_frame> parent_link; @@ -411,9 +428,10 @@ m_curr_frame = new_frame_idx; } -void call_stack::push (octave_user_function *fcn, - const stack_frame::local_vars_map& local_vars, - const std::shared_ptr<stack_frame>& closure_frames) +void +call_stack::push (octave_user_function *fcn, + const stack_frame::local_vars_map& local_vars, + const std::shared_ptr<stack_frame>& closure_frames) { std::size_t new_frame_idx; std::shared_ptr<stack_frame> parent_link; @@ -431,7 +449,8 @@ m_curr_frame = new_frame_idx; } -void call_stack::push (octave_user_script *script) +void +call_stack::push (octave_user_script *script) { std::size_t new_frame_idx; std::shared_ptr<stack_frame> parent_link; @@ -448,7 +467,8 @@ m_curr_frame = new_frame_idx; } -void call_stack::push (octave_function *fcn) +void +call_stack::push (octave_function *fcn) { std::size_t new_frame_idx; std::shared_ptr<stack_frame> parent_link; @@ -465,7 +485,8 @@ m_curr_frame = new_frame_idx; } -bool call_stack::goto_frame (std::size_t n, bool verbose) +bool +call_stack::goto_frame (std::size_t n, bool verbose) { bool retval = false; @@ -486,7 +507,8 @@ return retval; } -std::size_t call_stack::find_current_user_frame () const +std::size_t +call_stack::find_current_user_frame () const { std::size_t user_frame = m_curr_frame; @@ -503,7 +525,8 @@ return user_frame; } -std::shared_ptr<stack_frame> call_stack::current_user_frame () const +std::shared_ptr<stack_frame> +call_stack::current_user_frame () const { std::size_t frame = find_current_user_frame (); @@ -514,7 +537,8 @@ // the call stack that corresponds to a script, function, or scope // beginning with the frame indexed by START. -std::size_t call_stack::dbupdown (std::size_t start, int n, bool verbose) +std::size_t +call_stack::dbupdown (std::size_t start, int n, bool verbose) { if (start >= m_cs.size ()) error ("invalid stack frame"); @@ -604,7 +628,8 @@ // function, script or scope frame then there is an error in the // implementation. -std::size_t call_stack::dbupdown (int n, bool verbose) +std::size_t +call_stack::dbupdown (int n, bool verbose) { std::size_t start = find_current_user_frame (); @@ -616,7 +641,8 @@ // value of m_curr_frame would be wiped out when dbup returns and the // stack frame for dbup is popped. -void call_stack::goto_caller_frame () +void +call_stack::goto_caller_frame () { std::size_t start = find_current_user_frame (); @@ -628,7 +654,8 @@ m_curr_frame = caller_frame ? caller_frame->index () : 0; } -void call_stack::goto_base_frame () +void +call_stack::goto_base_frame () { if (m_curr_frame > 0) m_curr_frame = 0; @@ -699,15 +726,17 @@ return retval; } -std::list<frame_info> call_stack::backtrace_info () const +std::list<frame_info> +call_stack::backtrace_info () const { octave_idx_type curr_user_frame = -1; return backtrace_info (curr_user_frame, true); } -octave_map call_stack::backtrace (octave_idx_type& curr_user_frame, - bool print_subfn) const +octave_map +call_stack::backtrace (octave_idx_type& curr_user_frame, + bool print_subfn) const { std::list<std::shared_ptr<stack_frame>> frames = backtrace_frames (curr_user_frame); @@ -740,19 +769,22 @@ return retval; } -octave_map call_stack::backtrace () const +octave_map +call_stack::backtrace () const { octave_idx_type curr_user_frame = -1; return backtrace (curr_user_frame, true); } -octave_map call_stack::empty_backtrace () const +octave_map +call_stack::empty_backtrace () const { return octave_map (dim_vector (0, 1), bt_fields); } -void call_stack::pop () +void +call_stack::pop () { // Never pop top scope. // FIXME: is it possible for this case to happen? @@ -774,7 +806,8 @@ } } -std::shared_ptr<stack_frame> call_stack::pop_return () +std::shared_ptr<stack_frame> +call_stack::pop_return () { if (!m_cs.empty ()) { @@ -794,18 +827,21 @@ return nullptr; } -void call_stack::clear () +void +call_stack::clear () { while (! m_cs.empty ()) pop (); } -symbol_info_list call_stack::all_variables () +symbol_info_list +call_stack::all_variables () { return m_cs[m_curr_frame]->all_variables (); } -std::list<std::string> call_stack::global_variable_names () const +std::list<std::string> +call_stack::global_variable_names () const { std::list<std::string> retval; @@ -820,17 +856,20 @@ return retval; } -std::list<std::string> call_stack::top_level_variable_names () const +std::list<std::string> +call_stack::top_level_variable_names () const { return m_cs[0]->variable_names (); } -std::list<std::string> call_stack::variable_names () const +std::list<std::string> +call_stack::variable_names () const { return m_cs[m_curr_frame]->variable_names (); } -void call_stack::clear_global_variable (const std::string& name) +void +call_stack::clear_global_variable (const std::string& name) { auto p = m_global_values.find (name); @@ -838,7 +877,8 @@ p->second = octave_value (); } -void call_stack::clear_global_variable_pattern (const std::string& pattern) +void +call_stack::clear_global_variable_pattern (const std::string& pattern) { symbol_match pat (pattern); @@ -849,7 +889,8 @@ } } -void call_stack::clear_global_variable_regexp (const std::string& pattern) +void +call_stack::clear_global_variable_regexp (const std::string& pattern) { regexp pat (pattern); @@ -860,7 +901,8 @@ } } -void call_stack::clear_global_variables () +void +call_stack::clear_global_variables () { for (auto& nm_ov : m_global_values) nm_ov.second = octave_value (); @@ -878,58 +920,68 @@ return m_cs[m_curr_frame]->regexp_symbol_info (pattern); } -symbol_info_list call_stack::get_symbol_info () +symbol_info_list +call_stack::get_symbol_info () { return m_cs[m_curr_frame]->get_symbol_info (); } -symbol_info_list call_stack::top_scope_symbol_info () const +symbol_info_list +call_stack::top_scope_symbol_info () const { return m_cs[0]->get_symbol_info (); } -octave_value call_stack::max_stack_depth (const octave_value_list& args, - int nargout) +octave_value +call_stack::max_stack_depth (const octave_value_list& args, + int nargout) { return set_internal_variable (m_max_stack_depth, args, nargout, "max_stack_depth", 0); } -void call_stack::make_persistent (const symbol_record& sym) +void +call_stack::make_persistent (const symbol_record& sym) { m_cs[m_curr_frame]->make_persistent (sym); } -void call_stack::make_global (const symbol_record& sym) +void +call_stack::make_global (const symbol_record& sym) { m_cs[m_curr_frame]->make_global (sym); } -octave_value call_stack::global_varval (const std::string& name) const +octave_value +call_stack::global_varval (const std::string& name) const { auto p = m_global_values.find (name); return p == m_global_values.end () ? octave_value () : p->second; } -octave_value& call_stack::global_varref (const std::string& name) +octave_value& +call_stack::global_varref (const std::string& name) { return m_global_values[name]; } -octave_value call_stack::get_top_level_value (const std::string& name) const +octave_value +call_stack::get_top_level_value (const std::string& name) const { return m_cs[0]->varval (name); } -void call_stack::set_top_level_value (const std::string& name, - const octave_value& value) +void +call_stack::set_top_level_value (const std::string& name, + const octave_value& value) { m_cs[0]->assign (name, value); } -octave_value call_stack::do_who (int argc, const string_vector& argv, - bool return_list, bool verbose) +octave_value +call_stack::do_who (int argc, const string_vector& argv, + bool return_list, bool verbose) { octave_value retval; @@ -1027,19 +1079,21 @@ } } -octave_value call_stack::do_who_two (const string_vector& patterns, - bool have_regexp, bool return_list, - bool verbose, const std::string& msg) +octave_value +call_stack::do_who_two (const string_vector& patterns, + bool have_regexp, bool return_list, + bool verbose, const std::string& msg) { return m_cs[m_curr_frame]->who (patterns, have_regexp, return_list, verbose, m_evaluator.whos_line_format (), msg); } -octave_value call_stack::do_global_who_two (const string_vector& patterns, - bool have_regexp, - bool return_list, bool verbose, - const std::string& msg) +octave_value +call_stack::do_global_who_two (const string_vector& patterns, + bool have_regexp, + bool return_list, bool verbose, + const std::string& msg) { symbol_info_list symbol_stats; std::list<std::string> symbol_names; @@ -1133,7 +1187,8 @@ return octave_value (); } -void call_stack::display () const +void +call_stack::display () const { std::ostream& os = octave_stdout; @@ -1147,8 +1202,9 @@ } } -void call_stack::set_auto_fcn_var (stack_frame::auto_var_type avt, - const octave_value& val) +void +call_stack::set_auto_fcn_var (stack_frame::auto_var_type avt, + const octave_value& val) { m_cs[m_curr_frame]->set_auto_fcn_var (avt, val); } @@ -1165,7 +1221,8 @@ m_cs[m_curr_frame]->set_nargout (nargout); } -octave_value call_stack::get_auto_fcn_var (stack_frame::auto_var_type avt) const +octave_value +call_stack::get_auto_fcn_var (stack_frame::auto_var_type avt) const { return m_cs[m_curr_frame]->get_auto_fcn_var (avt); }
--- a/libinterp/corefcn/defaults.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/defaults.cc Tue Dec 12 18:24:05 2023 -0800 @@ -74,7 +74,8 @@ return retval; } -static std::string get_octave_home () +static std::string +get_octave_home () { std::string op = OCTAVE_PREFIX; @@ -86,7 +87,8 @@ return oh.empty () ? op : oh; } -static std::string get_octave_exec_home () +static std::string +get_octave_exec_home () { std::string op = OCTAVE_PREFIX; std::string oep = OCTAVE_EXEC_PREFIX; @@ -108,31 +110,36 @@ return oep; } -static std::string get_local_site_defaults_file () +static std::string +get_local_site_defaults_file () { std::string lsf = sys::env::getenv ("OCTAVE_SITE_INITFILE"); return lsf.empty () ? local_startupfile_dir () + "/octaverc" : lsf; } -static std::string get_site_defaults_file () +static std::string +get_site_defaults_file () { std::string sf = sys::env::getenv ("OCTAVE_VERSION_INITFILE"); return sf.empty () ? startupfile_dir () + "/octaverc" : sf; } -std::string prepend_octave_home (const std::string& s) +std::string +prepend_octave_home (const std::string& s) { return prepend_home_dir (octave_home (), s); } -std::string prepend_octave_exec_home (const std::string& s) +std::string +prepend_octave_exec_home (const std::string& s) { return prepend_home_dir (octave_exec_home (), s); } -std::string canonical_host_type () +std::string +canonical_host_type () { static const std::string s_canonical_host_type = OCTAVE_CANONICAL_HOST_TYPE; @@ -140,35 +147,40 @@ return s_canonical_host_type; } -std::string release () +std::string +release () { static const std::string s_octave_release = OCTAVE_RELEASE; return s_octave_release; } -std::string default_pager () +std::string +default_pager () { static const std::string s_default_pager = OCTAVE_DEFAULT_PAGER; return s_default_pager; } -std::string octave_home () +std::string +octave_home () { static const std::string s_octave_home = get_octave_home (); return s_octave_home; } -std::string octave_exec_home () +std::string +octave_exec_home () { static const std::string s_octave_exec_home = get_octave_exec_home (); return s_octave_exec_home; } -std::string bin_dir () +std::string +bin_dir () { static const std::string s_bin_dir = prepend_octave_exec_home (OCTAVE_BINDIR); @@ -176,7 +188,8 @@ return s_bin_dir; } -std::string data_dir () +std::string +data_dir () { static const std::string s_data_dir = prepend_octave_home (OCTAVE_DATADIR); @@ -184,7 +197,8 @@ return s_data_dir; } -std::string dataroot_dir () +std::string +dataroot_dir () { static const std::string s_dataroot_dir = prepend_octave_home (OCTAVE_DATAROOTDIR); @@ -192,7 +206,8 @@ return s_dataroot_dir; } -std::string include_dir () +std::string +include_dir () { static const std::string s_include_dir = prepend_octave_home (OCTAVE_INCLUDEDIR); @@ -200,7 +215,8 @@ return s_include_dir; } -std::string lib_dir () +std::string +lib_dir () { static const std::string s_lib_dir = prepend_octave_exec_home (OCTAVE_LIBDIR); @@ -208,7 +224,8 @@ return s_lib_dir; } -std::string libexec_dir () +std::string +libexec_dir () { static const std::string s_libexec_dir = prepend_octave_exec_home (OCTAVE_LIBEXECDIR); @@ -216,7 +233,8 @@ return s_libexec_dir; } -std::string arch_lib_dir () +std::string +arch_lib_dir () { static const std::string s_arch_lib_dir = prepend_octave_exec_home (OCTAVE_ARCHLIBDIR); @@ -224,7 +242,8 @@ return s_arch_lib_dir; } -std::string info_dir () +std::string +info_dir () { static const std::string s_info_dir = prepend_octave_exec_home (OCTAVE_INFODIR); @@ -232,7 +251,8 @@ return s_info_dir; } -std::string local_ver_arch_lib_dir () +std::string +local_ver_arch_lib_dir () { static const std::string s_local_ver_arch_lib_dir = prepend_octave_exec_home (OCTAVE_LOCALVERARCHLIBDIR); @@ -240,7 +260,8 @@ return s_local_ver_arch_lib_dir; } -std::string local_api_arch_lib_dir () +std::string +local_api_arch_lib_dir () { static const std::string s_local_api_arch_lib_dir = prepend_octave_exec_home (OCTAVE_LOCALAPIARCHLIBDIR); @@ -248,7 +269,8 @@ return s_local_api_arch_lib_dir; } -std::string local_arch_lib_dir () +std::string +local_arch_lib_dir () { static const std::string s_local_arch_lib_dir = prepend_octave_exec_home (OCTAVE_LOCALARCHLIBDIR); @@ -256,7 +278,8 @@ return s_local_arch_lib_dir; } -std::string local_ver_oct_file_dir () +std::string +local_ver_oct_file_dir () { static const std::string s_local_ver_oct_file_dir = prepend_octave_exec_home (OCTAVE_LOCALVEROCTFILEDIR); @@ -264,7 +287,8 @@ return s_local_ver_oct_file_dir; } -std::string local_api_oct_file_dir () +std::string +local_api_oct_file_dir () { static const std::string s_local_api_oct_file_dir = prepend_octave_exec_home (OCTAVE_LOCALAPIOCTFILEDIR); @@ -272,7 +296,8 @@ return s_local_api_oct_file_dir; } -std::string local_oct_file_dir () +std::string +local_oct_file_dir () { static const std::string s_local_oct_file_dir = prepend_octave_exec_home (OCTAVE_LOCALOCTFILEDIR); @@ -280,7 +305,8 @@ return s_local_oct_file_dir; } -std::string oct_file_dir () +std::string +oct_file_dir () { static const std::string s_oct_file_dir = prepend_octave_exec_home (OCTAVE_OCTFILEDIR); @@ -288,7 +314,8 @@ return s_oct_file_dir; } -std::string local_ver_fcn_file_dir () +std::string +local_ver_fcn_file_dir () { static const std::string s_local_ver_fcn_file_dir = prepend_octave_home (OCTAVE_LOCALVERFCNFILEDIR); @@ -296,7 +323,8 @@ return s_local_ver_fcn_file_dir; } -std::string local_api_fcn_file_dir () +std::string +local_api_fcn_file_dir () { static const std::string s_local_api_fcn_file_dir = prepend_octave_home (OCTAVE_LOCALAPIFCNFILEDIR); @@ -304,7 +332,8 @@ return s_local_api_fcn_file_dir; } -std::string local_fcn_file_dir () +std::string +local_fcn_file_dir () { static const std::string s_local_fcn_file_dir = prepend_octave_home (OCTAVE_LOCALFCNFILEDIR); @@ -312,7 +341,8 @@ return s_local_fcn_file_dir; } -std::string fcn_file_dir () +std::string +fcn_file_dir () { static const std::string s_fcn_file_dir = prepend_octave_home (OCTAVE_FCNFILEDIR); @@ -320,7 +350,8 @@ return s_fcn_file_dir; } -std::string oct_data_dir () +std::string +oct_data_dir () { static const std::string s_oct_data_dir = prepend_octave_home (OCTAVE_OCTDATADIR); @@ -328,7 +359,8 @@ return s_oct_data_dir; } -std::string oct_doc_dir () +std::string +oct_doc_dir () { static const std::string s_oct_doc_dir = prepend_octave_home (OCTAVE_OCTDOCDIR); @@ -336,7 +368,8 @@ return s_oct_doc_dir; } -std::string oct_etc_dir () +std::string +oct_etc_dir () { static const std::string s_oct_etc_dir = prepend_octave_home (OCTAVE_OCTETCDIR); @@ -344,7 +377,8 @@ return s_oct_etc_dir; } -std::string oct_fonts_dir () +std::string +oct_fonts_dir () { static const std::string s_oct_fonts_dir = prepend_octave_home (OCTAVE_OCTFONTSDIR); @@ -352,7 +386,8 @@ return s_oct_fonts_dir; } -std::string oct_include_dir () +std::string +oct_include_dir () { static const std::string s_oct_include_dir = prepend_octave_home (OCTAVE_OCTINCLUDEDIR); @@ -360,7 +395,8 @@ return s_oct_include_dir; } -std::string oct_lib_dir () +std::string +oct_lib_dir () { static const std::string s_oct_lib_dir = prepend_octave_exec_home (OCTAVE_OCTLIBDIR); @@ -368,7 +404,8 @@ return s_oct_lib_dir; } -std::string oct_locale_dir () +std::string +oct_locale_dir () { static const std::string s_oct_locale_dir = prepend_octave_home (OCTAVE_OCTLOCALEDIR); @@ -376,7 +413,8 @@ return s_oct_locale_dir; } -std::string oct_tests_dir () +std::string +oct_tests_dir () { static const std::string s_oct_tests_dir = prepend_octave_home (OCTAVE_OCTTESTSDIR); @@ -384,7 +422,8 @@ return s_oct_tests_dir; } -std::string man_dir () +std::string +man_dir () { static const std::string s_man_dir = prepend_octave_home (OCTAVE_MANDIR); @@ -392,7 +431,8 @@ return s_man_dir; } -std::string man1_dir () +std::string +man1_dir () { static const std::string s_man1_dir = prepend_octave_home (OCTAVE_MAN1DIR); @@ -400,14 +440,16 @@ return s_man1_dir; } -std::string man1_ext () +std::string +man1_ext () { static const std::string s_man1_ext = OCTAVE_MAN1EXT; return s_man1_ext; } -std::string image_dir () +std::string +image_dir () { static const std::string s_image_dir = prepend_octave_home (OCTAVE_IMAGEDIR); @@ -415,7 +457,8 @@ return s_image_dir; } -std::string local_startupfile_dir () +std::string +local_startupfile_dir () { static const std::string s_local_startupfile_dir = prepend_octave_home (OCTAVE_LOCALSTARTUPFILEDIR); @@ -423,7 +466,8 @@ return s_local_startupfile_dir; } -std::string startupfile_dir () +std::string +startupfile_dir () { static const std::string s_startupfile_dir = prepend_octave_home (OCTAVE_STARTUPFILEDIR); @@ -431,7 +475,8 @@ return s_startupfile_dir; } -std::string local_site_defaults_file () +std::string +local_site_defaults_file () { static const std::string s_local_site_defaults_file = get_local_site_defaults_file (); @@ -439,7 +484,8 @@ return s_local_site_defaults_file; } -std::string site_defaults_file () +std::string +site_defaults_file () { static const std::string s_site_defaults_file = get_site_defaults_file ();
--- a/libinterp/corefcn/environment.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/environment.cc Tue Dec 12 18:24:05 2023 -0800 @@ -88,7 +88,8 @@ return retval; } -std::string environment::exec_path (const std::string& path) +std::string +environment::exec_path (const std::string& path) { std::string old_val = set (m_exec_path, path); @@ -104,7 +105,8 @@ false); } -std::string environment::init_editor () +std::string +environment::init_editor () { std::string retval = "emacs"; @@ -116,7 +118,8 @@ return retval; } -std::string environment::init_exec_path () +std::string +environment::init_exec_path () { std::string exec_path = sys::env::getenv ("OCTAVE_EXEC_PATH"); @@ -134,7 +137,8 @@ return exec_path; } -std::string environment::init_image_path () +std::string +environment::init_image_path () { std::string image_path = ".";
--- a/libinterp/corefcn/error.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/error.cc Tue Dec 12 18:24:05 2023 -0800 @@ -420,7 +420,8 @@ // enabled, and 2 if the given ID should be an error instead of a // warning. -int error_system::warning_enabled (const std::string& id) +int +error_system::warning_enabled (const std::string& id) { int retval = 0; @@ -492,7 +493,8 @@ return retval; } -void error_system::vusage (const char *id, const char *fmt, va_list args) +void +error_system::vusage (const char *id, const char *fmt, va_list args) { std::string str_id = id ? id : ""; std::string message = format_message (fmt, args); @@ -500,8 +502,9 @@ throw_error ("usage", str_id, message); } -void error_system::vwarning (const char *name, const char *id, - const char *fmt, va_list args) +void +error_system::vwarning (const char *name, const char *id, + const char *fmt, va_list args) { flush_stdout (); @@ -561,8 +564,9 @@ } } -void error_system::error_1 (execution_exception& ee, const char *id, - const char *fmt, va_list args) +void +error_system::error_1 (execution_exception& ee, const char *id, + const char *fmt, va_list args) { ee.set_identifier (id); ee.set_message (format_message (fmt, args)); @@ -570,8 +574,9 @@ throw_error (ee); } -void error_system::error_1 (const char *id, const char *fmt, - va_list args) +void +error_system::error_1 (const char *id, const char *fmt, + va_list args) { std::string message = format_message (fmt, args); @@ -580,7 +585,8 @@ throw_error ("error", id, message); } -void error_system::vwarning (const char *id, const char *fmt, va_list args) +void +error_system::vwarning (const char *id, const char *fmt, va_list args) { int warn_opt = warning_enabled (id); @@ -594,9 +600,10 @@ vwarning ("warning", id, fmt, args); } -void error_system::rethrow_error (const std::string& id, - const std::string& msg, - const octave_map& stack) +void +error_system::rethrow_error (const std::string& id, + const std::string& msg, + const octave_map& stack) { std::list<frame_info> stack_info; @@ -623,7 +630,8 @@ throw_error (ee); } -void error_system::vpanic (const char *fmt, va_list args) +void +error_system::vpanic (const char *fmt, va_list args) { // Is there any point in trying to write the panic message to the // diary? @@ -633,7 +641,8 @@ abort (); } -void error_system::panic (const char *fmt, ...) +void +error_system::panic (const char *fmt, ...) { va_list args; va_start (args, fmt); @@ -641,7 +650,8 @@ va_end (args); } -octave_scalar_map error_system::warning_query (const std::string& id_arg) +octave_scalar_map +error_system::warning_query (const std::string& id_arg) { octave_scalar_map retval; @@ -697,7 +707,8 @@ return retval; } -std::string error_system::default_warning_state () +std::string +error_system::default_warning_state () { std::string retval = "on"; @@ -720,7 +731,8 @@ return retval; } -void error_system::display_warning_options (std::ostream& os) +void +error_system::display_warning_options (std::ostream& os) { octave_map opts = warning_options (); @@ -760,8 +772,9 @@ os << std::endl; } -void error_system::set_warning_option (const std::string& state, - const std::string& ident) +void +error_system::set_warning_option (const std::string& state, + const std::string& ident) { std::string all_state = default_warning_state (); @@ -824,12 +837,14 @@ warning_options (opts); } -void error_system::disable_warning (const std::string& id) +void +error_system::disable_warning (const std::string& id) { set_warning_option ("off", id); } -void error_system::initialize_default_warning_state () +void +error_system::initialize_default_warning_state () { warning_options (init_warning_options ("on")); @@ -849,7 +864,8 @@ disable_warning ("Octave:variable-switch-label"); } -void error_system::interpreter_try (unwind_protect& frame) +void +error_system::interpreter_try (unwind_protect& frame) { frame.protect_var (m_debug_on_error); m_debug_on_error = false; @@ -861,10 +877,11 @@ // caught. } -void error_system::throw_error (const std::string& err_type, - const std::string& id, - const std::string& message, - const std::list<frame_info>& stack_info_arg) +void +error_system::throw_error (const std::string& err_type, + const std::string& id, + const std::string& message, + const std::list<frame_info>& stack_info_arg) { std::list<frame_info> stack_info = stack_info_arg; @@ -885,12 +902,14 @@ throw_error (ex); } -void error_system::throw_error (execution_exception& ex) +void +error_system::throw_error (execution_exception& ex) { throw ex; } -void error_system::save_exception (const execution_exception& ee) +void +error_system::save_exception (const execution_exception& ee) { last_error_id (ee.identifier ()); std::string message = ee.message (); @@ -901,7 +920,8 @@ last_error_stack (make_stack_map (ee.stack_info ())); } -void error_system::display_exception (const execution_exception& ee) const +void +error_system::display_exception (const execution_exception& ee) const { // FIXME: How should we handle beep_on_error?
--- a/libinterp/corefcn/event-manager.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/event-manager.cc Tue Dec 12 18:24:05 2023 -0800 @@ -55,8 +55,9 @@ return 0; } -void interpreter_events::display_exception (const execution_exception& ee, - bool beep) +void +interpreter_events::display_exception (const execution_exception& ee, + bool beep) { if (beep) std::cerr << "\a"; @@ -94,7 +95,8 @@ m_instance = obj; } -bool event_manager::enable () +bool +event_manager::enable () { bool retval = m_link_enabled; @@ -106,7 +108,8 @@ return retval; } -void event_manager::process_events (bool disable_flag) +void +event_manager::process_events (bool disable_flag) { if (enabled ()) { @@ -121,7 +124,8 @@ } } -void event_manager::discard_events () +void +event_manager::discard_events () { if (enabled ()) { @@ -133,13 +137,15 @@ } } -void event_manager::push_event_queue () +void +event_manager::push_event_queue () { std::shared_ptr<event_queue> evq (new event_queue ()); m_gui_event_queue.push (evq); } -void event_manager::pop_event_queue () +void +event_manager::pop_event_queue () { // FIXME: Should we worry about the possibility of events remaining // in the queue when we pop back to the previous queue? If so, then @@ -154,7 +160,8 @@ m_gui_event_queue.pop (); } -void event_manager::post_event (const fcn_callback& fcn) +void +event_manager::post_event (const fcn_callback& fcn) { if (enabled ()) { @@ -163,7 +170,8 @@ } } -void event_manager::post_event (const meth_callback& meth) +void +event_manager::post_event (const meth_callback& meth) { if (enabled ()) { @@ -172,7 +180,8 @@ } } -void event_manager::set_workspace () +void +event_manager::set_workspace () { if (enabled ()) { @@ -183,7 +192,8 @@ } } -void event_manager::set_history () +void +event_manager::set_history () { if (enabled ()) m_instance->set_history (command_history::list ());
--- a/libinterp/corefcn/ft-text-renderer.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/ft-text-renderer.cc Tue Dec 12 18:24:05 2023 -0800 @@ -812,7 +812,8 @@ } } -bool is_opaque (const FT_GlyphSlot& glyph, const int x, const int y) +bool +is_opaque (const FT_GlyphSlot& glyph, const int x, const int y) { // Borrowed from https://stackoverflow.com/questions/14800827/ // indexing-pixels-in-a-monochrome-freetype-glyph-buffer
--- a/libinterp/corefcn/gl-render.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/gl-render.cc Tue Dec 12 18:24:05 2023 -0800 @@ -4167,7 +4167,8 @@ #endif } -void opengl_renderer::draw (const Matrix& hlist, bool toplevel) +void +opengl_renderer::draw (const Matrix& hlist, bool toplevel) { int len = hlist.numel (); @@ -4768,7 +4769,7 @@ m_glfcns.glBegin (GL_POLYGON); for (double ang = 0; ang < 2*M_PI; ang += ang_step) - m_glfcns.glVertex2d (sz/6* cos (ang), sz/6*sin (ang)); + m_glfcns.glVertex2d (sz/6*cos (ang), sz/6*sin (ang)); m_glfcns.glEnd (); } break; @@ -4790,7 +4791,7 @@ m_glfcns.glBegin (filled ? GL_POLYGON : GL_LINE_LOOP); for (double ang = 0; ang < 2*M_PI; ang += ang_step) - m_glfcns.glVertex2d (sz/2* cos (ang), sz/2*sin (ang)); + m_glfcns.glVertex2d (sz/2*cos (ang), sz/2*sin (ang)); m_glfcns.glEnd (); } break; @@ -4840,7 +4841,7 @@ { ang = (-0.5 + double (i+1) / 5) * M_PI; r = 1.0 - (dr * fmod (double (i+1), 2.0)); - m_glfcns.glVertex2d (sz/2*r* cos (ang), sz/2*r*sin (ang)); + m_glfcns.glVertex2d (sz/2*r*cos (ang), sz/2*r*sin (ang)); } m_glfcns.glEnd (); } @@ -4855,7 +4856,7 @@ { ang = (0.5 + double (i+1) / 6.0) * M_PI; r = 1.0 - (dr * fmod (double (i+1), 2.0)); - m_glfcns.glVertex2d (sz/2*r* cos (ang), sz/2*r*sin (ang)); + m_glfcns.glVertex2d (sz/2*r*cos (ang), sz/2*r*sin (ang)); } m_glfcns.glEnd (); }
--- a/libinterp/corefcn/graphics-utils.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/graphics-utils.cc Tue Dec 12 18:24:05 2023 -0800 @@ -75,7 +75,8 @@ return go.get (pname); } -bool isfigure (double val) +bool +isfigure (double val) { gh_manager& gh_mgr = octave::__get_gh_manager__ ();
--- a/libinterp/corefcn/graphics.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/graphics.cc Tue Dec 12 18:24:05 2023 -0800 @@ -8611,8 +8611,8 @@ m_properties.update_transform (); } -inline -double force_in_range (double x, double lower, double upper) +inline double +force_in_range (double x, double lower, double upper) { if (x < lower) return lower; @@ -9503,7 +9503,8 @@ } // core coplanar tester -bool is_coplanar (const Matrix& cov) +bool +is_coplanar (const Matrix& cov) { // Accuracy note: this test will also accept single precision input (although // stored in double precision). This is because the error threshold is
--- a/libinterp/corefcn/graphics.in.h Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/graphics.in.h Tue Dec 12 18:24:05 2023 -0800 @@ -2366,7 +2366,7 @@ OCTINTERP_API void get_children_of_type (const caseless_str& type, bool get_invisible, bool traverse, - std::list<graphics_object> &children_list) const; + std::list<graphics_object>& children_list) const; void set_modified (const octave_value& val) { set___modified__ (val); } @@ -3498,10 +3498,10 @@ for (int i = 0; i < r; i++) { - retval(i,0) = m_sx.scale (m(i,0)); - retval(i,1) = m_sy.scale (m(i,1)); + retval(i, 0) = m_sx.scale (m(i, 0)); + retval(i, 1) = m_sy.scale (m(i, 1)); if (has_z) - retval(i,2) = m_sz.scale (m(i,2)); + retval(i, 2) = m_sz.scale (m(i, 2)); } return retval;
--- a/libinterp/corefcn/help.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/help.cc Tue Dec 12 18:24:05 2023 -0800 @@ -232,8 +232,9 @@ return h; } -std::string help_system::which (const std::string& name, - std::string& type) const +std::string +help_system::which (const std::string& name, + std::string& type) const { std::string file; @@ -313,14 +314,16 @@ return file; } -std::string help_system::which (const std::string& name) const +std::string +help_system::which (const std::string& name) const { std::string type; return which (name, type); } -string_vector help_system::make_name_list () const +string_vector +help_system::make_name_list () const { const static string_vector keywords = Fiskeyword ()(0).string_vector_value (); @@ -383,8 +386,9 @@ return list; } -void help_system::get_help_text (const std::string& name, std::string& text, - std::string& format) const +void +help_system::get_help_text (const std::string& name, std::string& text, + std::string& format) const { bool symbol_found = false; text = raw_help (name, symbol_found); @@ -413,9 +417,10 @@ } } -void help_system::get_help_text_from_file (const std::string& fname, - std::string& text, - std::string& format) const +void +help_system::get_help_text_from_file (const std::string& fname, + std::string& text, + std::string& format) const { bool symbol_found = false; @@ -447,7 +452,8 @@ } } -std::string help_system::init_built_in_docstrings_file () +std::string +help_system::init_built_in_docstrings_file () { std::string df = sys::env::getenv ("OCTAVE_BUILT_IN_DOCSTRINGS_FILE"); @@ -459,7 +465,8 @@ return df; } -std::string help_system::init_doc_cache_file () +std::string +help_system::init_doc_cache_file () { std::string def_file = config::prepend_octave_home (OCTAVE_DOC_CACHE_FILE); @@ -468,7 +475,8 @@ return (env_file.empty () ? def_file : env_file); } -std::string help_system::init_info_file () +std::string +help_system::init_info_file () { std::string std_info_file = config::prepend_octave_home (OCTAVE_INFOFILE); @@ -477,7 +485,8 @@ return (oct_info_file.empty () ? std_info_file : oct_info_file); } -std::string help_system::init_info_program () +std::string +help_system::init_info_program () { std::string info_prog = sys::env::getenv ("OCTAVE_INFO_PROGRAM"); @@ -487,7 +496,8 @@ return info_prog; } -std::string help_system::init_texi_macros_file () +std::string +help_system::init_texi_macros_file () { std::string def_file = config::prepend_octave_home (OCTAVE_TEXI_MACROS_FILE); @@ -499,7 +509,8 @@ // Return a vector of all functions from this file, // for use in command line auto-completion. -string_vector help_system::local_functions () const +string_vector +help_system::local_functions () const { string_vector retval; @@ -534,7 +545,8 @@ return retval; } -bool help_system::raw_help_from_symbol_table (const std::string& nm, +bool +help_system::raw_help_from_symbol_table (const std::string& nm, std::string& h, std::string& w, bool& symbol_found) const { @@ -581,9 +593,10 @@ return false; } -bool help_system::raw_help_from_file (const std::string& nm, - std::string& h, std::string& file, - bool& symbol_found) const +bool +help_system::raw_help_from_file (const std::string& nm, + std::string& h, std::string& file, + bool& symbol_found) const { bool retval = false; @@ -725,7 +738,8 @@ // FIXME: It's not likely that this does the right thing now. -string_vector make_name_list () +string_vector +make_name_list () { help_system& help_sys = __get_help_system__ ();
--- a/libinterp/corefcn/hook-fcn.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/hook-fcn.cc Tue Dec 12 18:24:05 2023 -0800 @@ -49,7 +49,8 @@ error ("invalid hook function"); } -void named_hook_function::eval (const octave_value_list& initial_args) +void +named_hook_function::eval (const octave_value_list& initial_args) { octave_value_list args = initial_args; @@ -61,7 +62,8 @@ interp.feval (m_name, args, 0); } -void fcn_handle_hook_function::eval (const octave_value_list& initial_args) +void +fcn_handle_hook_function::eval (const octave_value_list& initial_args) { octave_value_list args = initial_args;
--- a/libinterp/corefcn/input.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/input.cc Tue Dec 12 18:24:05 2023 -0800 @@ -385,7 +385,8 @@ return retval; } -static int internal_input_event_hook_fcn () +static int +internal_input_event_hook_fcn () { octave_quit (); @@ -408,7 +409,8 @@ m_initialized (false) { } -void input_system::initialize (bool line_editing) +void +input_system::initialize (bool line_editing) { if (m_initialized) return; @@ -534,7 +536,8 @@ } // Get part of the directory that would be added to the load path -static std::string load_path_dir (const std::string& dir) +static std::string +load_path_dir (const std::string& dir) { std::string lp_dir = dir; @@ -569,7 +572,8 @@ return lp_dir; } -std::string input_system::dir_encoding (const std::string& dir) +std::string +input_system::dir_encoding (const std::string& dir) { std::string enc = m_mfile_encoding; // use canonicalized path as key @@ -582,8 +586,9 @@ return enc; } -void input_system::set_dir_encoding (const std::string& dir, - std::string& enc) +void +input_system::set_dir_encoding (const std::string& dir, + std::string& enc) { // use lower case std::transform (enc.begin (), enc.end (), enc.begin (), ::tolower); @@ -629,7 +634,8 @@ "auto_repeat_debug_command"); } -bool input_system::yes_or_no (const std::string& prompt) +bool +input_system::yes_or_no (const std::string& prompt) { std::string prompt_string = prompt + "(yes or no) "; @@ -648,7 +654,8 @@ } } -std::string input_system::interactive_input (const std::string& s, bool& eof) +std::string +input_system::interactive_input (const std::string& s, bool& eof) { Vlast_prompt_time.stamp (); @@ -745,17 +752,20 @@ return retval; } -bool input_system::have_input_event_hooks () const +bool +input_system::have_input_event_hooks () const { return ! m_input_event_hook_functions.empty (); } -void input_system::add_input_event_hook (const hook_function& hook_fcn) +void +input_system::add_input_event_hook (const hook_function& hook_fcn) { m_input_event_hook_functions.insert (hook_fcn.id (), hook_fcn); } -bool input_system::remove_input_event_hook (const std::string& hook_fcn_id) +bool +input_system::remove_input_event_hook (const std::string& hook_fcn_id) { hook_function_list::iterator p = m_input_event_hook_functions.find (hook_fcn_id); @@ -767,12 +777,14 @@ return true; } -void input_system::clear_input_event_hooks () +void +input_system::clear_input_event_hooks () { m_input_event_hook_functions.clear (); } -void input_system::run_input_event_hooks () +void +input_system::run_input_event_hooks () { m_input_event_hook_functions.run (); } @@ -792,7 +804,8 @@ return retval; } -std::string base_reader::octave_gets (const std::string& prompt, bool& eof) +std::string +base_reader::octave_gets (const std::string& prompt, bool& eof) { octave_quit ();
--- a/libinterp/corefcn/interpreter-private.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/interpreter-private.cc Tue Dec 12 18:24:05 2023 -0800 @@ -64,91 +64,104 @@ return *interp; } -dynamic_loader& __get_dynamic_loader__ () +dynamic_loader& +__get_dynamic_loader__ () { interpreter& interp = __get_interpreter__ (); return interp.get_dynamic_loader (); } -error_system& __get_error_system__ () +error_system& +__get_error_system__ () { interpreter& interp = __get_interpreter__ (); return interp.get_error_system (); } -gh_manager& __get_gh_manager__ () +gh_manager& +__get_gh_manager__ () { interpreter& interp = __get_interpreter__ (); return interp.get_gh_manager (); } -help_system& __get_help_system__ () +help_system& +__get_help_system__ () { interpreter& interp = __get_interpreter__ (); return interp.get_help_system (); } -input_system& __get_input_system__ () +input_system& +__get_input_system__ () { interpreter& interp = __get_interpreter__ (); return interp.get_input_system (); } -output_system& __get_output_system__ () +output_system& +__get_output_system__ () { interpreter& interp = __get_interpreter__ (); return interp.get_output_system (); } -load_path& __get_load_path__ () +load_path& +__get_load_path__ () { interpreter& interp = __get_interpreter__ (); return interp.get_load_path (); } -load_save_system& __get_load_save_system__ () +load_save_system& +__get_load_save_system__ () { interpreter& interp = __get_interpreter__ (); return interp.get_load_save_system (); } -event_manager& __get_event_manager__ () +event_manager& +__get_event_manager__ () { interpreter& interp = __get_interpreter__ (); return interp.get_event_manager (); } -type_info& __get_type_info__ () +type_info& +__get_type_info__ () { interpreter& interp = __get_interpreter__ (); return interp.get_type_info (); } -symbol_table& __get_symbol_table__ () +symbol_table& +__get_symbol_table__ () { interpreter& interp = __get_interpreter__ (); return interp.get_symbol_table (); } -symbol_scope __get_current_scope__ () +symbol_scope +__get_current_scope__ () { interpreter& interp = __get_interpreter__ (); return interp.get_current_scope (); } -symbol_scope __require_current_scope__ () +symbol_scope +__require_current_scope__ () { symbol_scope scope = __get_current_scope__ (); @@ -158,42 +171,48 @@ return scope; } -tree_evaluator& __get_evaluator__ () +tree_evaluator& +__get_evaluator__ () { interpreter& interp = __get_interpreter__ (); return interp.get_evaluator (); } -bp_table& __get_bp_table__ () +bp_table& +__get_bp_table__ () { tree_evaluator& tw = __get_evaluator__ (); return tw.get_bp_table (); } -child_list& __get_child_list__ () +child_list& +__get_child_list__ () { interpreter& interp = __get_interpreter__ (); return interp.get_child_list (); } -cdef_manager& __get_cdef_manager__ () +cdef_manager& +__get_cdef_manager__ () { interpreter& interp = __get_interpreter__ (); return interp.get_cdef_manager (); } -display_info& __get_display_info__ () +display_info& +__get_display_info__ () { interpreter& interp = __get_interpreter__ (); return interp.get_display_info (); } -gtk_manager& __get_gtk_manager__ () +gtk_manager& +__get_gtk_manager__ () { interpreter& interp = __get_interpreter__ ();
--- a/libinterp/corefcn/interpreter.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/interpreter.cc Tue Dec 12 18:24:05 2023 -0800 @@ -322,12 +322,14 @@ cleanup (); } -void temporary_file_list::insert (const std::string& file) +void +temporary_file_list::insert (const std::string& file) { m_files.insert (file); } -void temporary_file_list::cleanup () +void +temporary_file_list::cleanup () { while (! m_files.empty ()) { @@ -342,7 +344,8 @@ // The time we last time we changed directories. sys::time Vlast_chdir_time = 0.0; -static void initialize_version_info () +static void +initialize_version_info () { octave_value_list args (4); @@ -354,12 +357,14 @@ F__version_info__ (args); } -static void xerbla_abort () +static void +xerbla_abort () { error ("Fortran procedure terminated by call to XERBLA"); } -static void initialize_xerbla_error_handler () +static void +initialize_xerbla_error_handler () { // The idea here is to force xerbla to be referenced so that we will // link to our own version instead of the one provided by the BLAS @@ -410,7 +415,8 @@ throw execution_exception (); } -static void initialize_error_handlers () +static void +initialize_error_handlers () { set_liboctave_error_handler (lo_error_handler); set_liboctave_error_with_id_handler (lo_error_with_id_handler); @@ -636,14 +642,16 @@ delete m_gh_manager; } -void interpreter::intern_nargin (octave_idx_type nargs) +void +interpreter::intern_nargin (octave_idx_type nargs) { m_evaluator.set_auto_fcn_var (stack_frame::NARGIN, nargs); } // Read the history file unless a command-line option inhibits that. -void interpreter::initialize_history (bool read_history_file) +void +interpreter::initialize_history (bool read_history_file) { if (! m_history_initialized) { @@ -671,7 +679,8 @@ // Set the initial path to the system default unless command-line // option says to leave it empty. -void interpreter::initialize_load_path (bool set_initial_path) +void +interpreter::initialize_load_path (bool set_initial_path) { if (! m_load_path_initialized) { @@ -707,7 +716,8 @@ // This may be called separately from execute -void interpreter::initialize () +void +interpreter::initialize () { if (m_initialized) return; @@ -760,7 +770,8 @@ // Note: this function is currently only used with the new // experimental terminal widget. -void interpreter::get_line_and_eval () +void +interpreter::get_line_and_eval () { m_evaluator.get_line_and_eval (); } @@ -798,8 +809,9 @@ std::thread m_thread; }; -void interpreter::parse_and_execute (const std::string& input, - bool& incomplete_parse) +void +interpreter::parse_and_execute (const std::string& input, + bool& incomplete_parse) { m_evaluator.parse_and_execute (input, incomplete_parse); } @@ -807,7 +819,8 @@ // FIXME: this function is intended to be executed only once. Should // we enforce that restriction? -int interpreter::execute () +int +interpreter::execute () { int exit_status = 0; @@ -934,7 +947,8 @@ } \ while (0) -void interpreter::shutdown () +void +interpreter::shutdown () { // Attempt to prevent more than one call to shutdown. @@ -1044,7 +1058,8 @@ // OCTAVE_SAFE_CALL (singleton_cleanup_list::cleanup, ()); } -void interpreter::execute_atexit_fcns () +void +interpreter::execute_atexit_fcns () { // Prevent atexit functions from adding new functions to the list. m_executing_atexit = true; @@ -1061,7 +1076,8 @@ } } -void interpreter::display_startup_message () const +void +interpreter::display_startup_message () const { bool inhibit_startup_message = false; @@ -1080,7 +1096,8 @@ // occurs when reading any of them, but don't exit early because of an // exception. -int interpreter::execute_startup_files () +int +interpreter::execute_startup_files () { bool read_site_files = m_read_site_files; bool read_init_files = m_read_init_files; @@ -1228,7 +1245,8 @@ // Execute any code specified with --eval 'CODE' -int interpreter::execute_eval_option_code () +int +interpreter::execute_eval_option_code () { if (! m_app_context) return 0; @@ -1261,7 +1279,8 @@ return parse_status; } -int interpreter::execute_command_line_file () +int +interpreter::execute_command_line_file () { if (! m_app_context) return 0; @@ -1310,29 +1329,34 @@ return safe_source_file (fname, context, verbose, require_file); } -int interpreter::main_loop () +int +interpreter::main_loop () { command_editor::add_event_hook (release_unreferenced_dynamic_libraries); return m_evaluator.repl (); } -int interpreter::server_loop () +int +interpreter::server_loop () { return m_evaluator.server_loop (); } -tree_evaluator& interpreter::get_evaluator () +tree_evaluator& +interpreter::get_evaluator () { return m_evaluator; } -stream_list& interpreter::get_stream_list () +stream_list& +interpreter::get_stream_list () { return m_stream_list; } -url_handle_manager& interpreter::get_url_handle_manager () +url_handle_manager& +interpreter::get_url_handle_manager () { return m_url_handle_manager; } @@ -1360,12 +1384,14 @@ return scope; } -profiler& interpreter::get_profiler () +profiler& +interpreter::get_profiler () { return m_evaluator.get_profiler (); } -int interpreter::chdir (const std::string& dir) +int +interpreter::chdir (const std::string& dir) { std::string xdir = sys::file_ops::tilde_expand (dir); @@ -1387,22 +1413,26 @@ return cd_ok; } -void interpreter::mlock (bool skip_first) const +void +interpreter::mlock (bool skip_first) const { m_evaluator.mlock (skip_first); } -void interpreter::munlock (bool skip_first) const +void +interpreter::munlock (bool skip_first) const { m_evaluator.munlock (skip_first); } -bool interpreter::mislocked (bool skip_first) const +bool +interpreter::mislocked (bool skip_first) const { return m_evaluator.mislocked (skip_first); } -void interpreter::munlock (const char *nm) +void +interpreter::munlock (const char *nm) { if (! nm) error ("munlock: invalid value for NAME"); @@ -1410,7 +1440,8 @@ munlock (std::string (nm)); } -void interpreter::munlock (const std::string& nm) +void +interpreter::munlock (const std::string& nm) { octave_value val = m_symbol_table.find_function (nm); @@ -1423,7 +1454,8 @@ } } -bool interpreter::mislocked (const char *nm) +bool +interpreter::mislocked (const char *nm) { if (! nm) error ("mislocked: invalid value for NAME"); @@ -1431,7 +1463,8 @@ return mislocked (std::string (nm)); } -bool interpreter::mislocked (const std::string& nm) +bool +interpreter::mislocked (const std::string& nm) { bool retval = false; @@ -1448,55 +1481,63 @@ return retval; } -std::string interpreter::mfilename (const std::string& opt) const +std::string +interpreter::mfilename (const std::string& opt) const { return m_evaluator.mfilename (opt); } -octave_value_list interpreter::eval_string (const std::string& eval_str, - bool silent, int& parse_status, - int nargout) +octave_value_list +interpreter::eval_string (const std::string& eval_str, + bool silent, int& parse_status, + int nargout) { return m_evaluator.eval_string (eval_str, silent, parse_status, nargout); } -octave_value interpreter::eval_string (const std::string& eval_str, - bool silent, int& parse_status) +octave_value +interpreter::eval_string (const std::string& eval_str, + bool silent, int& parse_status) { return m_evaluator.eval_string (eval_str, silent, parse_status); } -octave_value_list interpreter::eval_string (const octave_value& arg, - bool silent, int& parse_status, - int nargout) +octave_value_list +interpreter::eval_string (const octave_value& arg, + bool silent, int& parse_status, + int nargout) { return m_evaluator.eval_string (arg, silent, parse_status, nargout); } -octave_value_list interpreter::eval (const std::string& try_code, - int nargout) +octave_value_list +interpreter::eval (const std::string& try_code, + int nargout) { return m_evaluator.eval (try_code, nargout); } -octave_value_list interpreter::eval (const std::string& try_code, - const std::string& catch_code, - int nargout) +octave_value_list +interpreter::eval (const std::string& try_code, + const std::string& catch_code, + int nargout) { return m_evaluator.eval (try_code, catch_code, nargout); } -octave_value_list interpreter::evalin (const std::string& context, - const std::string& try_code, - int nargout) +octave_value_list +interpreter::evalin (const std::string& context, + const std::string& try_code, + int nargout) { return m_evaluator.evalin (context, try_code, nargout); } -octave_value_list interpreter::evalin (const std::string& context, - const std::string& try_code, - const std::string& catch_code, - int nargout) +octave_value_list +interpreter::evalin (const std::string& context, + const std::string& try_code, + const std::string& catch_code, + int nargout) { return m_evaluator.evalin (context, try_code, catch_code, nargout); } @@ -1510,16 +1551,18 @@ //! @return A list of output values. The length of the list is not //! necessarily the same as @c nargout. -octave_value_list interpreter::feval (const char *name, - const octave_value_list& args, - int nargout) +octave_value_list +interpreter::feval (const char *name, + const octave_value_list& args, + int nargout) { return feval (std::string (name), args, nargout); } -octave_value_list interpreter::feval (const std::string& name, - const octave_value_list& args, - int nargout) +octave_value_list +interpreter::feval (const std::string& name, + const octave_value_list& args, + int nargout) { octave_value fcn = m_symbol_table.find_function (name, args); @@ -1531,9 +1574,10 @@ return of->call (m_evaluator, nargout, args); } -octave_value_list interpreter::feval (octave_function *fcn, - const octave_value_list& args, - int nargout) +octave_value_list +interpreter::feval (octave_function *fcn, + const octave_value_list& args, + int nargout) { if (fcn) return fcn->call (m_evaluator, nargout, args); @@ -1541,9 +1585,10 @@ return octave_value_list (); } -octave_value_list interpreter::feval (const octave_value& val, - const octave_value_list& args, - int nargout) +octave_value_list +interpreter::feval (const octave_value& val, + const octave_value_list& args, + int nargout) { // FIXME: do we really want to silently return an empty ovl if // the function object is undefined? It's essentially what the @@ -1596,8 +1641,9 @@ //! @return A list of output values. The length of the list is not //! necessarily the same as @c nargout. -octave_value_list interpreter::feval (const octave_value_list& args, - int nargout) +octave_value_list +interpreter::feval (const octave_value_list& args, + int nargout) { if (args.length () == 0) error ("feval: first argument must be a string, inline function, or a function handle"); @@ -1609,195 +1655,232 @@ return feval (f_arg, tmp_args, nargout); } -octave_value interpreter::make_function_handle (const std::string& name) +octave_value +interpreter::make_function_handle (const std::string& name) { return m_evaluator.make_fcn_handle (name); } -void interpreter::install_variable (const std::string& name, - const octave_value& value, bool global) +void +interpreter::install_variable (const std::string& name, + const octave_value& value, bool global) { m_evaluator.install_variable (name, value, global); } -octave_value interpreter::global_varval (const std::string& name) const +octave_value +interpreter::global_varval (const std::string& name) const { return m_evaluator.global_varval (name); } -void interpreter::global_assign (const std::string& name, - const octave_value& val) +void +interpreter::global_assign (const std::string& name, + const octave_value& val) { m_evaluator.global_assign (name, val); } -octave_value interpreter::top_level_varval (const std::string& name) const +octave_value +interpreter::top_level_varval (const std::string& name) const { return m_evaluator.top_level_varval (name); } -void interpreter::top_level_assign (const std::string& name, - const octave_value& val) +void +interpreter::top_level_assign (const std::string& name, + const octave_value& val) { m_evaluator.top_level_assign (name, val); } -bool interpreter::is_variable (const std::string& name) const +bool +interpreter::is_variable (const std::string& name) const { return m_evaluator.is_variable (name); } -bool interpreter::is_local_variable (const std::string& name) const +bool +interpreter::is_local_variable (const std::string& name) const { return m_evaluator.is_local_variable (name); } -octave_value interpreter::varval (const std::string& name) const +octave_value +interpreter::varval (const std::string& name) const { return m_evaluator.varval (name); } -void interpreter::assign (const std::string& name, - const octave_value& val) +void +interpreter::assign (const std::string& name, + const octave_value& val) { m_evaluator.assign (name, val); } -void interpreter::assignin (const std::string& context, - const std::string& name, - const octave_value& val) +void +interpreter::assignin (const std::string& context, + const std::string& name, + const octave_value& val) { m_evaluator.assignin (context, name, val); } -void interpreter::source_file (const std::string& file_name, - const std::string& context, bool verbose, - bool require_file) +void +interpreter::source_file (const std::string& file_name, + const std::string& context, bool verbose, + bool require_file) { m_evaluator.source_file (file_name, context, verbose, require_file); } -bool interpreter::at_top_level () const +bool +interpreter::at_top_level () const { return m_evaluator.at_top_level (); } -bool interpreter::isglobal (const std::string& name) const +bool +interpreter::isglobal (const std::string& name) const { return m_evaluator.is_global (name); } -octave_value interpreter::find (const std::string& name) +octave_value +interpreter::find (const std::string& name) { return m_evaluator.find (name); } -void interpreter::clear_all (bool force) +void +interpreter::clear_all (bool force) { m_evaluator.clear_all (force); } -void interpreter::clear_objects () +void +interpreter::clear_objects () { m_evaluator.clear_objects (); } -void interpreter::clear_variable (const std::string& name) +void +interpreter::clear_variable (const std::string& name) { m_evaluator.clear_variable (name); } -void interpreter::clear_variable_pattern (const std::string& pattern) +void +interpreter::clear_variable_pattern (const std::string& pattern) { m_evaluator.clear_variable_pattern (pattern); } -void interpreter::clear_variable_regexp (const std::string& pattern) +void +interpreter::clear_variable_regexp (const std::string& pattern) { m_evaluator.clear_variable_regexp (pattern); } -void interpreter::clear_variables () +void +interpreter::clear_variables () { m_evaluator.clear_variables (); } -void interpreter::clear_global_variable (const std::string& name) +void +interpreter::clear_global_variable (const std::string& name) { m_evaluator.clear_global_variable (name); } -void interpreter::clear_global_variable_pattern (const std::string& pattern) +void +interpreter::clear_global_variable_pattern (const std::string& pattern) { m_evaluator.clear_global_variable_pattern (pattern); } -void interpreter::clear_global_variable_regexp (const std::string& pattern) +void +interpreter::clear_global_variable_regexp (const std::string& pattern) { m_evaluator.clear_global_variable_regexp (pattern); } -void interpreter::clear_global_variables () +void +interpreter::clear_global_variables () { m_evaluator.clear_global_variables (); } -void interpreter::clear_functions (bool force) +void +interpreter::clear_functions (bool force) { m_symbol_table.clear_functions (force); } -void interpreter::clear_function (const std::string& name) +void +interpreter::clear_function (const std::string& name) { m_symbol_table.clear_function (name); } -void interpreter::clear_symbol (const std::string& name) +void +interpreter::clear_symbol (const std::string& name) { m_evaluator.clear_symbol (name); } -void interpreter::clear_function_pattern (const std::string& pat) +void +interpreter::clear_function_pattern (const std::string& pat) { m_symbol_table.clear_function_pattern (pat); } -void interpreter::clear_function_regexp (const std::string& pat) +void +interpreter::clear_function_regexp (const std::string& pat) { m_symbol_table.clear_function_regexp (pat); } -void interpreter::clear_symbol_pattern (const std::string& pat) +void +interpreter::clear_symbol_pattern (const std::string& pat) { return m_evaluator.clear_symbol_pattern (pat); } -void interpreter::clear_symbol_regexp (const std::string& pat) +void +interpreter::clear_symbol_regexp (const std::string& pat) { return m_evaluator.clear_symbol_regexp (pat); } -std::list<std::string> interpreter::global_variable_names () +std::list<std::string> +interpreter::global_variable_names () { return m_evaluator.global_variable_names (); } -std::list<std::string> interpreter::top_level_variable_names () +std::list<std::string> +interpreter::top_level_variable_names () { return m_evaluator.top_level_variable_names (); } -std::list<std::string> interpreter::variable_names () +std::list<std::string> +interpreter::variable_names () { return m_evaluator.variable_names (); } -std::list<std::string> interpreter::user_function_names () +std::list<std::string> +interpreter::user_function_names () { return m_symbol_table.user_function_names (); } -std::list<std::string> interpreter::autoloaded_functions () const +std::list<std::string> +interpreter::autoloaded_functions () const { return m_evaluator.autoloaded_functions (); } @@ -1805,7 +1888,8 @@ // May be used to send an interrupt signal to the the interpreter from // another thread (for example, the GUI). -void interpreter::interrupt () +void +interpreter::interrupt () { static int sigint = 0; static bool first = true; @@ -1833,7 +1917,8 @@ octave_kill_wrapper (pid, sigint); } -void interpreter::pause () +void +interpreter::pause () { // FIXME: To be reliable, these tree_evaluator functions must be // made thread safe. @@ -1842,7 +1927,8 @@ m_evaluator.reset_debug_state (); } -void interpreter::stop () +void +interpreter::stop () { // FIXME: To be reliable, these tree_evaluator functions must be // made thread safe. @@ -1853,7 +1939,8 @@ interrupt (); } -void interpreter::resume () +void +interpreter::resume () { // FIXME: To be reliable, these tree_evaluator functions must be // made thread safe. @@ -1865,69 +1952,82 @@ m_evaluator.dbcont (); } -octave_value interpreter::PS1 (const octave_value_list& args, int nargout) +octave_value +interpreter::PS1 (const octave_value_list& args, int nargout) { return m_input_system.PS1 (args, nargout); } -std::string interpreter::PS1 () const +std::string +interpreter::PS1 () const { return m_input_system.PS1 (); } -std::string interpreter::PS1 (const std::string& s) +std::string +interpreter::PS1 (const std::string& s) { return m_input_system.PS1 (s); } -void interpreter::set_PS1 (const std::string& s) +void +interpreter::set_PS1 (const std::string& s) { m_input_system.set_PS1 (s); } -octave_value interpreter::PS2 (const octave_value_list& args, int nargout) +octave_value +interpreter::PS2 (const octave_value_list& args, int nargout) { return m_input_system.PS2 (args, nargout); } -std::string interpreter::PS2 () const +std::string +interpreter::PS2 () const { return m_input_system.PS2 (); } -std::string interpreter::PS2 (const std::string& s) +std::string +interpreter::PS2 (const std::string& s) { return m_input_system.PS2 (s); } -void interpreter::set_PS2 (const std::string& s) +void +interpreter::set_PS2 (const std::string& s) { m_input_system.set_PS2 (s); } -octave_value interpreter::PS4 (const octave_value_list& args, int nargout) +octave_value +interpreter::PS4 (const octave_value_list& args, int nargout) { return m_evaluator.PS4 (args, nargout); } -std::string interpreter::PS4 () const +std::string +interpreter::PS4 () const { return m_evaluator.PS4 (); } -std::string interpreter::PS4 (const std::string& s) +std::string +interpreter::PS4 (const std::string& s) { return m_evaluator.PS4 (s); } -void interpreter::set_PS4 (const std::string& s) +void +interpreter::set_PS4 (const std::string& s) { m_evaluator.set_PS4 (s); } // Provided for convenience. Will be removed once we eliminate the // old terminal widget. -bool interpreter::experimental_terminal_widget () const +bool +interpreter::experimental_terminal_widget () const { if (! m_app_context) return false; @@ -1938,27 +2038,32 @@ return options.experimental_terminal_widget (); } -void interpreter::add_debug_watch_expression (const std::string& expr) +void +interpreter::add_debug_watch_expression (const std::string& expr) { m_evaluator.add_debug_watch_expression (expr); } -void interpreter::remove_debug_watch_expression (const std::string& expr) +void +interpreter::remove_debug_watch_expression (const std::string& expr) { m_evaluator.remove_debug_watch_expression (expr); } -void interpreter::clear_debug_watch_expressions () +void +interpreter::clear_debug_watch_expressions () { m_evaluator.clear_debug_watch_expressions (); } -std::set<std::string> interpreter::debug_watch_expressions () const +std::set<std::string> +interpreter::debug_watch_expressions () const { return m_evaluator.debug_watch_expressions (); } -void interpreter::handle_exception (const execution_exception& ee) +void +interpreter::handle_exception (const execution_exception& ee) { m_error_system.save_exception (ee); @@ -1970,7 +2075,8 @@ recover_from_exception (); } -void interpreter::recover_from_exception () +void +interpreter::recover_from_exception () { if (octave_interrupt_state) m_event_manager.interpreter_interrupted (); @@ -1982,17 +2088,20 @@ catch_interrupts (); } -void interpreter::mark_for_deletion (const std::string& file) +void +interpreter::mark_for_deletion (const std::string& file) { m_tmp_files.insert (file); } -void interpreter::cleanup_tmp_files () +void +interpreter::cleanup_tmp_files () { m_tmp_files.cleanup (); } -void interpreter::quit (int exit_status, bool force, bool confirm) +void +interpreter::quit (int exit_status, bool force, bool confirm) { if (! force) { @@ -2034,7 +2143,8 @@ throw exit_exception (exit_status); } -void interpreter::add_atexit_fcn (const std::string& fname) +void +interpreter::add_atexit_fcn (const std::string& fname) { if (m_executing_atexit) return; @@ -2042,7 +2152,8 @@ m_atexit_fcns.push_front (fname); } -bool interpreter::remove_atexit_fcn (const std::string& fname) +bool +interpreter::remove_atexit_fcn (const std::string& fname) { bool found = false; @@ -2062,7 +2173,8 @@ // What internal options get configured by --traditional. -void interpreter::maximum_braindamage () +void +interpreter::maximum_braindamage () { PS1 (">> "); PS2 (""); @@ -2092,7 +2204,8 @@ m_error_system.disable_warning ("Octave:possible-matlab-short-circuit-operator"); } -void interpreter::execute_pkg_add (const std::string& dir) +void +interpreter::execute_pkg_add (const std::string& dir) { try { @@ -2113,9 +2226,10 @@ // commands from a file before we have entered the main loop in // toplev.cc. -int interpreter::safe_source_file (const std::string& file_name, - const std::string& context, - bool verbose, bool require_file) +int +interpreter::safe_source_file (const std::string& file_name, + const std::string& context, + bool verbose, bool require_file) { try {
--- a/libinterp/corefcn/load-path.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/load-path.cc Tue Dec 12 18:24:05 2023 -0800 @@ -963,7 +963,8 @@ execute_pkg_add_or_del (dir, "PKG_DEL"); } -void load_path::rehash () +void +load_path::rehash () { update (); @@ -980,8 +981,9 @@ Vlast_prompt_time.stamp (); } -void load_path::execute_pkg_add_or_del (const std::string& dir, - const std::string& script_file) +void +load_path::execute_pkg_add_or_del (const std::string& dir, + const std::string& script_file) { if (! octave_interpreter_ready) return;
--- a/libinterp/corefcn/load-save.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/load-save.cc Tue Dec 12 18:24:05 2023 -0800 @@ -670,11 +670,12 @@ return parse_save_options (argv, fmt, append, save_as_floats, use_zlib); } -void load_save_system::save_vars (const string_vector& argv, int argv_idx, - int argc, std::ostream& os, - const load_save_format& fmt, - bool save_as_floats, - bool write_header_info) +void +load_save_system::save_vars (const string_vector& argv, int argv_idx, + int argc, std::ostream& os, + const load_save_format& fmt, + bool save_as_floats, + bool write_header_info) { if (write_header_info) write_header (os, fmt); @@ -729,7 +730,8 @@ } } -void load_save_system::dump_octave_core () +void +load_save_system::dump_octave_core () { if (m_crash_dumps_octave_core) { @@ -822,8 +824,9 @@ } } -void load_save_system::write_header (std::ostream& os, - const load_save_format& fmt) +void +load_save_system::write_header (std::ostream& os, + const load_save_format& fmt) { switch (fmt.type ()) { @@ -907,10 +910,11 @@ // Save variables with names matching PATTERN on stream OS in the // format specified by FMT. -std::size_t load_save_system::save_vars (std::ostream& os, - const std::string& pattern, - const load_save_format& fmt, - bool save_as_floats) +std::size_t +load_save_system::save_vars (std::ostream& os, + const std::string& pattern, + const load_save_format& fmt, + bool save_as_floats) { tree_evaluator& tw = m_interpreter.get_evaluator (); @@ -928,11 +932,12 @@ return saved; } -void load_save_system::do_save (std::ostream& os, const octave_value& tc, - const std::string& name, - const std::string& help, - bool global, const load_save_format& fmt, - bool save_as_floats) +void +load_save_system::do_save (std::ostream& os, const octave_value& tc, + const std::string& name, + const std::string& help, + bool global, const load_save_format& fmt, + bool save_as_floats) { switch (fmt.type ()) { @@ -977,10 +982,11 @@ // Save the info from SR on stream OS in the format specified by FMT. -void load_save_system::do_save (std::ostream& os, - const symbol_info& syminfo, - const load_save_format& fmt, - bool save_as_floats) +void +load_save_system::do_save (std::ostream& os, + const symbol_info& syminfo, + const load_save_format& fmt, + bool save_as_floats) { octave_value val = syminfo.value (); @@ -997,11 +1003,12 @@ // save fields of a scalar structure STR matching PATTERN on stream OS // in the format specified by FMT. -std::size_t load_save_system::save_fields (std::ostream& os, - const octave_scalar_map& m, - const std::string& pattern, - const load_save_format& fmt, - bool save_as_floats) +std::size_t +load_save_system::save_fields (std::ostream& os, + const octave_scalar_map& m, + const std::string& pattern, + const load_save_format& fmt, + bool save_as_floats) { symbol_match pat (pattern); @@ -1023,10 +1030,11 @@ return saved; } -void load_save_system::dump_octave_core (std::ostream& os, - const char *fname, - const load_save_format& fmt, - bool save_as_floats) +void +load_save_system::dump_octave_core (std::ostream& os, + const char *fname, + const load_save_format& fmt, + bool save_as_floats) { write_header (os, fmt); @@ -1063,7 +1071,8 @@ // Install a variable with name NAME and the value VAL in the // symbol table. If GLOBAL is TRUE, make the variable global. -void load_save_system::install_loaded_variable (const std::string& name, +void +load_save_system::install_loaded_variable (const std::string& name, const octave_value& val, bool global, const std::string& /*doc*/) @@ -1071,7 +1080,8 @@ m_interpreter.install_variable (name, val, global); } -std::string load_save_system::init_save_header_format () +std::string +load_save_system::init_save_header_format () { return (std::string ("# Created by Octave " OCTAVE_VERSION
--- a/libinterp/corefcn/ls-hdf5.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/ls-hdf5.cc Tue Dec 12 18:24:05 2023 -0800 @@ -1433,7 +1433,8 @@ goto error_cleanup; // attach the type of the variable - type_id = H5Tcopy (H5T_C_S1); H5Tset_size (type_id, t.length () + 1); + type_id = H5Tcopy (H5T_C_S1); + H5Tset_size (type_id, t.length () + 1); if (type_id < 0) goto error_cleanup;
--- a/libinterp/corefcn/lu.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/lu.cc Tue Dec 12 18:24:05 2023 -0800 @@ -569,9 +569,9 @@ */ -static -bool check_lu_dims (const octave_value& l, const octave_value& u, - const octave_value& p) +static bool +check_lu_dims (const octave_value& l, const octave_value& u, + const octave_value& p) { octave_idx_type m = l.rows (); octave_idx_type k = u.rows ();
--- a/libinterp/corefcn/mex.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/mex.cc Tue Dec 12 18:24:05 2023 -0800 @@ -4125,62 +4125,74 @@ return ptr->get_imag_data (); } -mxDouble * mxGetDoubles (const mxArray *ptr) +mxDouble * +mxGetDoubles (const mxArray *ptr) { return ptr->get_doubles (); } -mxSingle * mxGetSingles (const mxArray *ptr) +mxSingle * +mxGetSingles (const mxArray *ptr) { return ptr->get_singles (); } -mxInt8 * mxGetInt8s (const mxArray *ptr) +mxInt8 * +mxGetInt8s (const mxArray *ptr) { return ptr->get_int8s (); } -mxInt16 * mxGetInt16s (const mxArray *ptr) +mxInt16 * +mxGetInt16s (const mxArray *ptr) { return ptr->get_int16s (); } -mxInt32 * mxGetInt32s (const mxArray *ptr) +mxInt32 * +mxGetInt32s (const mxArray *ptr) { return ptr->get_int32s (); } -mxInt64 * mxGetInt64s (const mxArray *ptr) +mxInt64 * +mxGetInt64s (const mxArray *ptr) { return ptr->get_int64s (); } -mxUint8 * mxGetUint8s (const mxArray *ptr) +mxUint8 * +mxGetUint8s (const mxArray *ptr) { return ptr->get_uint8s (); } -mxUint16 * mxGetUint16s (const mxArray *ptr) +mxUint16 * +mxGetUint16s (const mxArray *ptr) { return ptr->get_uint16s (); } -mxUint32 * mxGetUint32s (const mxArray *ptr) +mxUint32 * +mxGetUint32s (const mxArray *ptr) { return ptr->get_uint32s (); } -mxUint64 * mxGetUint64s (const mxArray *ptr) +mxUint64 * +mxGetUint64s (const mxArray *ptr) { return ptr->get_uint64s (); } -mxComplexDouble * mxGetComplexDoubles (const mxArray *ptr) +mxComplexDouble * +mxGetComplexDoubles (const mxArray *ptr) { return ptr->get_complex_doubles (); } -mxComplexSingle * mxGetComplexSingles (const mxArray *ptr) +mxComplexSingle * +mxGetComplexSingles (const mxArray *ptr) { return ptr->get_complex_singles (); } @@ -4198,62 +4210,74 @@ ptr->set_data (maybe_unmark (pr)); } -int mxSetDoubles (mxArray *ptr, mxDouble *data) +int +mxSetDoubles (mxArray *ptr, mxDouble *data) { return ptr->set_doubles (maybe_unmark (data)); } -int mxSetSingles (mxArray *ptr, mxSingle *data) +int +mxSetSingles (mxArray *ptr, mxSingle *data) { return ptr->set_singles (maybe_unmark (data)); } -int mxSetInt8s (mxArray *ptr, mxInt8 *data) +int +mxSetInt8s (mxArray *ptr, mxInt8 *data) { return ptr->set_int8s (maybe_unmark (data)); } -int mxSetInt16s (mxArray *ptr, mxInt16 *data) +int +mxSetInt16s (mxArray *ptr, mxInt16 *data) { return ptr->set_int16s (maybe_unmark (data)); } -int mxSetInt32s (mxArray *ptr, mxInt32 *data) +int +mxSetInt32s (mxArray *ptr, mxInt32 *data) { return ptr->set_int32s (maybe_unmark (data)); } -int mxSetInt64s (mxArray *ptr, mxInt64 *data) +int +mxSetInt64s (mxArray *ptr, mxInt64 *data) { return ptr->set_int64s (maybe_unmark (data)); } -int mxSetUint8s (mxArray *ptr, mxUint8 *data) +int +mxSetUint8s (mxArray *ptr, mxUint8 *data) { return ptr->set_uint8s (maybe_unmark (data)); } -int mxSetUint16s (mxArray *ptr, mxUint16 *data) +int +mxSetUint16s (mxArray *ptr, mxUint16 *data) { return ptr->set_uint16s (maybe_unmark (data)); } -int mxSetUint32s (mxArray *ptr, mxUint32 *data) +int +mxSetUint32s (mxArray *ptr, mxUint32 *data) { return ptr->set_uint32s (maybe_unmark (data)); } -int mxSetUint64s (mxArray *ptr, mxUint64 *data) +int +mxSetUint64s (mxArray *ptr, mxUint64 *data) { return ptr->set_uint64s (maybe_unmark (data)); } -int mxSetComplexDoubles (mxArray *ptr, mxComplexDouble *data) +int +mxSetComplexDoubles (mxArray *ptr, mxComplexDouble *data) { return ptr->set_complex_doubles (maybe_unmark (data)); } -int mxSetComplexSingles (mxArray *ptr, mxComplexSingle *data) +int +mxSetComplexSingles (mxArray *ptr, mxComplexSingle *data) { return ptr->set_complex_singles (maybe_unmark (data)); }
--- a/libinterp/corefcn/oct-hist.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/oct-hist.cc Tue Dec 12 18:24:05 2023 -0800 @@ -265,7 +265,8 @@ m_timestamp_format_string (default_timestamp_format ()) { } -void history_system::initialize (bool read_history_file) +void +history_system::initialize (bool read_history_file) { command_history::initialize (read_history_file, default_file (), default_size (), @@ -276,7 +277,8 @@ evmgr.set_history (command_history::list ()); } -void history_system::write_timestamp () +void +history_system::write_timestamp () { sys::localtime now; @@ -315,8 +317,9 @@ // means read file, arg of -q means don't number lines. Arg of N // means only display that many items. -string_vector history_system::do_history (const octave_value_list& args, - int nargout) +string_vector +history_system::do_history (const octave_value_list& args, + int nargout) { bool numbered_output = nargout == 0; @@ -443,7 +446,8 @@ return hlist; } -void history_system::do_edit_history (const octave_value_list& args) +void +history_system::do_edit_history (const octave_value_list& args) { std::string name = mk_tmp_hist_file (args, false, "edit_history"); @@ -506,7 +510,8 @@ source_file (name); } -void history_system::do_run_history (const octave_value_list& args) +void +history_system::do_run_history (const octave_value_list& args) { std::string name = mk_tmp_hist_file (args, false, "run_history"); @@ -524,7 +529,8 @@ source_file (name); } -std::string history_system::default_file () +std::string +history_system::default_file () { std::string file; @@ -550,7 +556,8 @@ return file; } -int history_system::default_size () +int +history_system::default_size () { int size = 1000; @@ -567,7 +574,8 @@ return size; } -std::string history_system::default_timestamp_format () +std::string +history_system::default_timestamp_format () { return "# Octave " OCTAVE_VERSION ", %a %b %d %H:%M:%S %Y %Z <"
--- a/libinterp/corefcn/oct-map.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/oct-map.cc Tue Dec 12 18:24:05 2023 -0800 @@ -639,17 +639,19 @@ } // This is just a wrapper. -void permute_to_correct_order1 (const octave_scalar_map& ref, - const octave_scalar_map& src, - octave_scalar_map& dest, - Array<octave_idx_type>& perm) +void +permute_to_correct_order1 (const octave_scalar_map& ref, + const octave_scalar_map& src, + octave_scalar_map& dest, + Array<octave_idx_type>& perm) { dest = src.orderfields (ref, perm); } // In non-scalar case, we also promote empty structs without fields. -void permute_to_correct_order1 (const octave_map& ref, const octave_map& src, - octave_map& dest, Array<octave_idx_type>& perm) +void +permute_to_correct_order1 (const octave_map& ref, const octave_map& src, + octave_map& dest, Array<octave_idx_type>& perm) { if (src.nfields () == 0 && src.isempty ()) dest = octave_map (src.dims (), ref.keys ());
--- a/libinterp/corefcn/oct-stream.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/oct-stream.cc Tue Dec 12 18:24:05 2023 -0800 @@ -4250,8 +4250,8 @@ { T value = T (); - is >> std::ws; // skip through whitespace and advance stream pointer - std::streampos pos = is.tellg (); + is >> std::ws; // skip through whitespace and advance stream pointer + std::streampos pos = is.tellg (); switch (fmt.type) { @@ -4266,7 +4266,7 @@ case 'i': { - int c1 = is.get (); + int c1 = is.get (); if (c1 != std::istream::traits_type::eof ()) { @@ -4315,33 +4315,33 @@ break; } - std::ios::iostate status = is.rdstate (); - if (! (status & std::ios::failbit)) - { - // Copy the converted value if the stream is in a good state - *valptr = value; - } - else - { - if (value != T ()) - { - // If conversion produces an integer that overflows, failbit is set - // but value is nonzero. We want to treat this case as success, - // so clear failbit from the stream state to keep going. - // FIXME: Maybe set error state on octave stream? Matlab does - // *not* indicate an error message on overflow. - is.clear (status & ~std::ios::failbit); - *valptr = value; - } - else - { - // True error. - // Reset stream to original position, clear eof bit, pass status on. - is.clear (); - is.seekg (pos); - is.setstate (status & ~std::ios_base::eofbit); - } - } + std::ios::iostate status = is.rdstate (); + if (! (status & std::ios::failbit)) + { + // Copy the converted value if the stream is in a good state + *valptr = value; + } + else + { + if (value != T ()) + { + // If conversion produces an integer that overflows, failbit is set + // but value is nonzero. We want to treat this case as success, + // so clear failbit from the stream state to keep going. + // FIXME: Maybe set error state on octave stream? Matlab does + // *not* indicate an error message on overflow. + is.clear (status & ~std::ios::failbit); + *valptr = value; + } + else + { + // True error. + // Reset stream to original position, clear eof bit, pass status on. + is.clear (); + is.seekg (pos); + is.setstate (status & ~std::ios_base::eofbit); + } + } return is; } @@ -4397,7 +4397,8 @@ template <> std::istream& -octave_scan<> (std::istream& is, const scanf_format_elt& fmt, double *valptr) +octave_scan<> +(std::istream& is, const scanf_format_elt& fmt, double *valptr) { double& ref = *valptr; @@ -4409,20 +4410,20 @@ case 'E': case 'G': { - is >> std::ws; // skip through whitespace and advance stream pointer - if (is.good ()) + is >> std::ws; // skip through whitespace and advance stream pointer + if (is.good ()) { - std::streampos pos = is.tellg (); + std::streampos pos = is.tellg (); ref = read_value<double> (is); - std::ios::iostate status = is.rdstate (); - if (status & std::ios::failbit) - { - is.clear (); - is.seekg (pos); - is.setstate (status & ~std::ios_base::eofbit); - } + std::ios::iostate status = is.rdstate (); + if (status & std::ios::failbit) + { + is.clear (); + is.seekg (pos); + is.setstate (status & ~std::ios_base::eofbit); + } } } break; @@ -5040,10 +5041,10 @@ // If it looks like we have a matching failure, then // reset the failbit in the stream state. - if (is.rdstate () & std::ios::failbit) + if (is.rdstate () & std::ios::failbit) { is.clear (is.rdstate () & (~std::ios::failbit)); - error (who, "format failed to match"); + error (who, "format failed to match"); } // FIXME: is this the right thing to do? @@ -7405,7 +7406,8 @@ clear (); } -int stream_list::insert (stream& os) +int +stream_list::insert (stream& os) { // Insert item with key corresponding to file-descriptor. @@ -7445,7 +7447,8 @@ ::error ("%s: invalid stream number = %d", who.c_str (), fid); } -stream stream_list::lookup (int fid, const std::string& who) const +stream +stream_list::lookup (int fid, const std::string& who) const { stream retval; @@ -7468,15 +7471,17 @@ return retval; } -stream stream_list::lookup (const octave_value& fid, - const std::string& who) const +stream +stream_list::lookup (const octave_value& fid, + const std::string& who) const { int i = get_file_number (fid); return lookup (i, who); } -int stream_list::remove (int fid, const std::string& who) +int +stream_list::remove (int fid, const std::string& who) { // Can't remove stdin (std::cin), stdout (std::cout), or stderr (std::cerr). if (fid < 3) @@ -7500,7 +7505,8 @@ return 0; } -int stream_list::remove (const octave_value& fid, const std::string& who) +int +stream_list::remove (const octave_value& fid, const std::string& who) { int retval = -1; @@ -7520,7 +7526,8 @@ return retval; } -void stream_list::clear (bool flush) +void +stream_list::clear (bool flush) { if (flush) { @@ -7561,7 +7568,8 @@ m_lookup_cache = m_list.end (); } -string_vector stream_list::get_info (int fid) const +string_vector +stream_list::get_info (int fid) const { string_vector retval (4); @@ -7593,7 +7601,8 @@ return retval; } -string_vector stream_list::get_info (const octave_value& fid) const +string_vector +stream_list::get_info (const octave_value& fid) const { int conv_err = 0; @@ -7608,7 +7617,8 @@ return get_info (int_fid); } -std::string stream_list::list_open_files () const +std::string +stream_list::list_open_files () const { std::ostringstream buf; @@ -7640,7 +7650,8 @@ return buf.str (); } -octave_value stream_list::open_file_numbers () const +octave_value +stream_list::open_file_numbers () const { Matrix retval (1, m_list.size (), 0.0); @@ -7658,7 +7669,8 @@ return retval; } -int stream_list::get_file_number (const octave_value& fid) const +int +stream_list::get_file_number (const octave_value& fid) const { int retval = -1; @@ -7698,17 +7710,20 @@ return retval; } -octave_value stream_list::stdin_file () const +octave_value +stream_list::stdin_file () const { return octave_value (m_stdin_file); } -octave_value stream_list::stdout_file () const +octave_value +stream_list::stdout_file () const { return octave_value (m_stdout_file); } -octave_value stream_list::stderr_file () const +octave_value +stream_list::stderr_file () const { return octave_value (m_stderr_file); }
--- a/libinterp/corefcn/pager.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/pager.cc Tue Dec 12 18:24:05 2023 -0800 @@ -114,7 +114,8 @@ return false; } -static std::string default_pager () +static std::string +default_pager () { std::string pager_binary = sys::env::getenv ("PAGER"); @@ -196,18 +197,21 @@ delete m_pb; } -std::ostream& pager_stream::stream () +std::ostream& +pager_stream::stream () { return *this; } -void pager_stream::flush_current_contents_to_diary () +void +pager_stream::flush_current_contents_to_diary () { if (m_pb) m_pb->flush_current_contents_to_diary (); } -void pager_stream::set_diary_skip () +void +pager_stream::set_diary_skip () { if (m_pb) m_pb->set_diary_skip (); @@ -218,7 +222,8 @@ // called when the pager is not in use. For example, just before // getting command-line input. -void pager_stream::reset () +void +pager_stream::reset () { delete m_pb; m_pb = new pager_buf (); @@ -239,7 +244,8 @@ delete m_db; } -std::ostream& diary_stream::stream () +std::ostream& +diary_stream::stream () { return *this; } @@ -249,7 +255,8 @@ // called when the pager is not in use. For example, just before // getting command-line input. -void diary_stream::reset () +void +diary_stream::reset () { delete m_db; m_db = new diary_buf (); @@ -257,7 +264,8 @@ setf (unitbuf); } -void flush_stdout () +void +flush_stdout () { output_system& output_sys = __get_output_system__ (); @@ -273,14 +281,16 @@ m_really_flush_to_pager (false), m_flushing_output_to_pager (false) { } -octave_value output_system::PAGER (const octave_value_list& args, - int nargout) +octave_value +output_system::PAGER (const octave_value_list& args, + int nargout) { return set_internal_variable (m_PAGER, args, nargout, "PAGER", false); } -octave_value output_system::PAGER_FLAGS (const octave_value_list& args, - int nargout) +octave_value +output_system::PAGER_FLAGS (const octave_value_list& args, + int nargout) { return set_internal_variable (m_PAGER_FLAGS, args, nargout, "PAGER_FLAGS", false); @@ -302,7 +312,8 @@ "page_screen_output"); } -std::string output_system::pager_command () const +std::string +output_system::pager_command () const { std::string cmd = m_PAGER; @@ -312,7 +323,8 @@ return cmd; } -void output_system::reset () +void +output_system::reset () { flush_stdout (); @@ -320,7 +332,8 @@ m_diary_stream.reset (); } -void output_system::flush_stdout () +void +output_system::flush_stdout () { if (! m_flushing_output_to_pager) { @@ -338,7 +351,8 @@ } } -void output_system::close_diary () +void +output_system::close_diary () { // Try to flush the current buffer to the diary now, so that things // like @@ -360,7 +374,8 @@ } } -void output_system::open_diary () +void +output_system::open_diary () { close_diary (); @@ -375,7 +390,8 @@ error ("diary: can't open diary file '%s'", m_diary_file_name.c_str ()); } -bool output_system::sync (const char *buf, int len) +bool +output_system::sync (const char *buf, int len) { // FIXME: The following seems to be a bit of a mess. @@ -406,7 +422,8 @@ return false; } -void output_system::clear_external_pager () +void +output_system::clear_external_pager () { if (m_external_pager) { @@ -419,7 +436,8 @@ } } -void output_system::start_external_pager () +void +output_system::start_external_pager () { if (m_external_pager) return; @@ -437,7 +455,8 @@ } } -void output_system::do_sync (const char *msg, int len, bool bypass_pager) +void +output_system::do_sync (const char *msg, int len, bool bypass_pager) { if (msg && len > 0) { @@ -489,14 +508,16 @@ } } -std::ostream& __stdout__ () +std::ostream& +__stdout__ () { output_system& output_sys = __get_output_system__ (); return output_sys.__stdout__ (); } -std::ostream& __diary__ () +std::ostream& +__diary__ () { output_system& output_sys = __get_output_system__ ();
--- a/libinterp/corefcn/perms.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/perms.cc Tue Dec 12 18:24:05 2023 -0800 @@ -50,7 +50,7 @@ // template <typename T> static inline Array<T> -GetPerms (const Array<T> &ar_in, bool uniq_v, bool do_sort = false) +GetPerms (const Array<T>& ar_in, bool uniq_v, bool do_sort = false) { octave_idx_type m = ar_in.numel (); double nr = Factorial (m); @@ -123,7 +123,7 @@ template <typename T> static inline Array<T> -GetPermsNoSort (const Array<T> &ar_in, bool uniq_v = false) +GetPermsNoSort (const Array<T>& ar_in, bool uniq_v = false) { octave_idx_type m = ar_in.numel (); double nr = Factorial (m); @@ -256,8 +256,8 @@ } if (! (args (0).is_matrix_type () || args (0).is_range () - || args (0).iscell () || args (0).is_scalar_type () - || args (0).isstruct ())) + || args (0).iscell () || args (0).is_scalar_type () + || args (0).isstruct ())) { error ("perms: INPUT must be a matrix, a range, a cell array, " "a struct or a scalar.");
--- a/libinterp/corefcn/pr-output.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/pr-output.cc Tue Dec 12 18:24:05 2023 -0800 @@ -2112,8 +2112,9 @@ } template <typename NDA_T, typename ELT_T, typename MAT_T> -void print_nd_array (std::ostream& os, const NDA_T& nda, - bool pr_as_read_syntax) +void +print_nd_array (std::ostream& os, const NDA_T& nda, + bool pr_as_read_syntax) { if (nda.isempty ()) @@ -3449,7 +3450,7 @@ DEFMETHOD (display, interp, args, , classes: cell char double function_handle int8 int16 int32 int64 logical single struct uint8 uint16 uint32 uint64 - doc: /* -*- texinfo -*- + doc: /* -*- texinfo -*- @deftypefn {} {} display (@var{obj}) Display the contents of the object @var{obj} prepended by its name.
--- a/libinterp/corefcn/qr.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/qr.cc Tue Dec 12 18:24:05 2023 -0800 @@ -1265,8 +1265,9 @@ */ static -bool check_qr_dims (const octave_value& q, const octave_value& r, - bool allow_ecf = false) +bool +check_qr_dims (const octave_value& q, const octave_value& r, + bool allow_ecf = false) { octave_idx_type m = q.rows (); octave_idx_type k = r.rows (); @@ -1276,7 +1277,8 @@ } static -bool check_index (const octave_value& i, bool vector_allowed = false) +bool +check_index (const octave_value& i, bool vector_allowed = false) { return ((i.isreal () || i.isinteger ()) && (i.is_scalar_type () || vector_allowed));
--- a/libinterp/corefcn/settings.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/settings.cc Tue Dec 12 18:24:05 2023 -0800 @@ -41,15 +41,17 @@ m_lexer_debug_flag (false) { } -octave_value settings::display_tokens (const octave_value_list& args, - int nargout) +octave_value +settings::display_tokens (const octave_value_list& args, + int nargout) { return set_internal_variable (m_display_tokens, args, nargout, "__display_tokens__"); } -octave_value settings::lexer_debug_flag (const octave_value_list& args, - int nargout) +octave_value +settings::lexer_debug_flag (const octave_value_list& args, + int nargout) { return set_internal_variable (m_lexer_debug_flag, args, nargout, "__lexer_debug_flag__");
--- a/libinterp/corefcn/sparse-xdiv.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/sparse-xdiv.cc Tue Dec 12 18:24:05 2023 -0800 @@ -294,7 +294,8 @@ } template <typename RT, typename SM, typename DM> -RT do_rightdiv_sm_dm (const SM& a, const DM& d) +RT +do_rightdiv_sm_dm (const SM& a, const DM& d) { const octave_idx_type d_nr = d.rows (); @@ -561,7 +562,8 @@ } template <typename RT, typename DM, typename SM> -RT do_leftdiv_dm_sm (const DM& d, const SM& a) +RT +do_leftdiv_dm_sm (const DM& d, const SM& a) { const octave_idx_type a_nr = a.rows (); const octave_idx_type a_nc = a.cols ();
--- a/libinterp/corefcn/stack-frame.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/stack-frame.cc Tue Dec 12 18:24:05 2023 -0800 @@ -1053,50 +1053,55 @@ std::set<std::string> m_found_names; }; -stack_frame *stack_frame::create (tree_evaluator& tw, octave_function *fcn, - std::size_t index, - const std::shared_ptr<stack_frame>& parent_link, - const std::shared_ptr<stack_frame>& static_link) +stack_frame * +stack_frame::create (tree_evaluator& tw, octave_function *fcn, + std::size_t index, + const std::shared_ptr<stack_frame>& parent_link, + const std::shared_ptr<stack_frame>& static_link) { return new compiled_fcn_stack_frame (tw, fcn, index, parent_link, static_link); } -stack_frame *stack_frame::create (tree_evaluator& tw, - octave_user_script *script, - std::size_t index, - const std::shared_ptr<stack_frame>& parent_link, - const std::shared_ptr<stack_frame>& static_link) +stack_frame * +stack_frame::create (tree_evaluator& tw, + octave_user_script *script, + std::size_t index, + const std::shared_ptr<stack_frame>& parent_link, + const std::shared_ptr<stack_frame>& static_link) { return new script_stack_frame (tw, script, index, parent_link, static_link); } -stack_frame *stack_frame::create (tree_evaluator& tw, - octave_user_function *fcn, std::size_t index, - const std::shared_ptr<stack_frame>& parent_link, - const std::shared_ptr<stack_frame>& static_link, - const std::shared_ptr<stack_frame>& access_link) +stack_frame * +stack_frame::create (tree_evaluator& tw, + octave_user_function *fcn, std::size_t index, + const std::shared_ptr<stack_frame>& parent_link, + const std::shared_ptr<stack_frame>& static_link, + const std::shared_ptr<stack_frame>& access_link) { return new user_fcn_stack_frame (tw, fcn, index, parent_link, static_link, access_link); } -stack_frame *stack_frame::create (tree_evaluator& tw, - octave_user_function *fcn, std::size_t index, - const std::shared_ptr<stack_frame>& parent_link, - const std::shared_ptr<stack_frame>& static_link, - const local_vars_map& local_vars, - const std::shared_ptr<stack_frame>& access_link) +stack_frame * +stack_frame::create (tree_evaluator& tw, + octave_user_function *fcn, std::size_t index, + const std::shared_ptr<stack_frame>& parent_link, + const std::shared_ptr<stack_frame>& static_link, + const local_vars_map& local_vars, + const std::shared_ptr<stack_frame>& access_link) { return new user_fcn_stack_frame (tw, fcn, index, parent_link, static_link, local_vars, access_link); } -stack_frame *stack_frame::create (tree_evaluator& tw, - const symbol_scope& scope, std::size_t index, - const std::shared_ptr<stack_frame>& parent_link, - const std::shared_ptr<stack_frame>& static_link) +stack_frame * +stack_frame::create (tree_evaluator& tw, + const symbol_scope& scope, std::size_t index, + const std::shared_ptr<stack_frame>& parent_link, + const std::shared_ptr<stack_frame>& static_link) { return new scope_stack_frame (tw, scope, index, parent_link, static_link); } @@ -1105,7 +1110,8 @@ // user_fcn stack frames. Anything else indicates an error in the // implementation, but we'll simply warn if that happens. -void stack_frame::clear_values () +void +stack_frame::clear_values () { warning ("invalid call to stack_frame::clear_values; please report"); } @@ -1132,10 +1138,11 @@ return symbol_stats; } -octave_value stack_frame::who (const string_vector& patterns, - bool have_regexp, bool return_list, - bool verbose, const std::string& whos_line_fmt, - const std::string& msg) +octave_value +stack_frame::who (const string_vector& patterns, + bool have_regexp, bool return_list, + bool verbose, const std::string& whos_line_fmt, + const std::string& msg) { symbol_info_accumulator sym_inf_accum (patterns, have_regexp); @@ -1174,7 +1181,8 @@ // Return first occurrence of variables in current stack frame and any // parent frames reachable through access links. -symbol_info_list stack_frame::all_variables () +symbol_info_list +stack_frame::all_variables () { symbol_info_accumulator sia (true, true); @@ -1183,7 +1191,8 @@ return sia.symbol_info (); } -octave_value stack_frame::workspace () +octave_value +stack_frame::workspace () { std::list<octave_scalar_map> ws_list; @@ -1221,7 +1230,8 @@ // FIXME: Should this function also find any variables in parent // scopes accessible through access_links? -std::list<std::string> stack_frame::variable_names () const +std::list<std::string> +stack_frame::variable_names () const { std::list<std::string> retval; @@ -1240,7 +1250,8 @@ return retval; } -symbol_info_list stack_frame::glob_symbol_info (const std::string& pattern) +symbol_info_list +stack_frame::glob_symbol_info (const std::string& pattern) { symbol_info_accumulator sia (pattern, false); @@ -1249,7 +1260,8 @@ return sia.symbol_info (); } -symbol_info_list stack_frame::regexp_symbol_info (const std::string& pattern) +symbol_info_list +stack_frame::regexp_symbol_info (const std::string& pattern) { symbol_info_accumulator sia (pattern, true); @@ -1258,7 +1270,8 @@ return sia.symbol_info (); } -std::size_t stack_frame::size () const +std::size_t +stack_frame::size () const { // This function should only be called for user_fcn_stack_frame or // scope_stack_frame objects. Anything else indicates an error in @@ -1267,7 +1280,8 @@ panic_impossible (); } -void stack_frame::resize (std::size_t) +void +stack_frame::resize (std::size_t) { // This function should only be called for user_fcn_stack_frame or // scope_stack_frame objects. Anything else indicates an error in @@ -1276,7 +1290,8 @@ panic_impossible (); } -stack_frame::scope_flags stack_frame::get_scope_flag (std::size_t) const +stack_frame::scope_flags +stack_frame::get_scope_flag (std::size_t) const { // This function should only be called for user_fcn_stack_frame or // scope_stack_frame objects. Anything else indicates an error in @@ -1285,7 +1300,8 @@ panic_impossible (); } -void stack_frame::set_scope_flag (std::size_t, scope_flags) +void +stack_frame::set_scope_flag (std::size_t, scope_flags) { // This function should only be called for user_fcn_stack_frame or // scope_stack_frame objects. Anything else indicates an error in @@ -1294,8 +1310,9 @@ panic_impossible (); } -void stack_frame::install_variable (const symbol_record& sym, - const octave_value& value, bool global) +void +stack_frame::install_variable (const symbol_record& sym, + const octave_value& value, bool global) { if (global && ! is_global (sym)) { @@ -1340,7 +1357,8 @@ assign (sym, value); } -octave_value stack_frame::varval (std::size_t) const +octave_value +stack_frame::varval (std::size_t) const { // This function should only be called for user_fcn_stack_frame or // scope_stack_frame objects. Anything else indicates an error in @@ -1349,7 +1367,8 @@ panic_impossible (); } -octave_value& stack_frame::varref (std::size_t) +octave_value& +stack_frame::varref (std::size_t) { // This function should only be called for user_fcn_stack_frame or // scope_stack_frame objects. Anything else indicates an error in @@ -1358,56 +1377,64 @@ panic_impossible (); } -void stack_frame::clear_objects () +void +stack_frame::clear_objects () { symbol_cleaner sc (true, true); accept (sc); } -void stack_frame::clear_variable (const std::string& name) +void +stack_frame::clear_variable (const std::string& name) { symbol_cleaner sc (name); accept (sc); } -void stack_frame::clear_variable_pattern (const std::string& pattern) +void +stack_frame::clear_variable_pattern (const std::string& pattern) { symbol_cleaner sc (pattern); accept (sc); } -void stack_frame::clear_variable_pattern (const string_vector& patterns) +void +stack_frame::clear_variable_pattern (const string_vector& patterns) { symbol_cleaner sc (patterns); accept (sc); } -void stack_frame::clear_variable_regexp (const std::string& pattern) +void +stack_frame::clear_variable_regexp (const std::string& pattern) { symbol_cleaner sc (pattern, true); accept (sc); } -void stack_frame::clear_variable_regexp (const string_vector& patterns) +void +stack_frame::clear_variable_regexp (const string_vector& patterns) { symbol_cleaner sc (patterns, true); accept (sc); } -void stack_frame::clear_variables () +void +stack_frame::clear_variables () { symbol_cleaner sc; accept (sc); } -void stack_frame::display_stopped_in_message (std::ostream& os) const +void +stack_frame::display_stopped_in_message (std::ostream& os) const { if (index () == 0) os << "at top level" << std::endl; @@ -1423,7 +1450,8 @@ } } -void stack_frame::display (bool follow) const +void +stack_frame::display (bool follow) const { std::ostream& os = octave_stdout; @@ -1470,7 +1498,8 @@ } } -void compiled_fcn_stack_frame::display (bool follow) const +void +compiled_fcn_stack_frame::display (bool follow) const { std::ostream& os = octave_stdout; @@ -1481,7 +1510,8 @@ << " (" << m_fcn->type_name () << ")" << std::endl; } -void compiled_fcn_stack_frame::accept (stack_frame_walker& sfw) +void +compiled_fcn_stack_frame::accept (stack_frame_walker& sfw) { sfw.visit_compiled_fcn_stack_frame (*this); } @@ -1500,14 +1530,16 @@ set_script_offsets (); } -std::size_t script_stack_frame::get_num_symbols (octave_user_script *script) +std::size_t +script_stack_frame::get_num_symbols (octave_user_script *script) { symbol_scope script_scope = script->scope (); return script_scope.num_symbols (); } -void script_stack_frame::set_script_offsets () +void +script_stack_frame::set_script_offsets () { // Set frame and data offsets inside stack frame based on enclosing // scope(s). @@ -1612,7 +1644,8 @@ } } -void script_stack_frame::resize_and_update_script_offsets (const symbol_record& sym) +void +script_stack_frame::resize_and_update_script_offsets (const symbol_record& sym) { std::size_t data_offset = sym.data_offset (); @@ -1655,7 +1688,8 @@ return alink; } -unwind_protect *script_stack_frame::unwind_protect_frame () +unwind_protect * +script_stack_frame::unwind_protect_frame () { if (! m_unwind_protect_frame) m_unwind_protect_frame = new unwind_protect (); @@ -1663,7 +1697,8 @@ return m_unwind_protect_frame; } -symbol_record script_stack_frame::lookup_symbol (const std::string& name) const +symbol_record +script_stack_frame::lookup_symbol (const std::string& name) const { symbol_scope scope = get_scope (); @@ -1686,7 +1721,8 @@ return new_sym; } -symbol_record script_stack_frame::insert_symbol (const std::string& name) +symbol_record +script_stack_frame::insert_symbol (const std::string& name) { // If the symbols is already in the immediate scope, there is // nothing more to do. @@ -1794,9 +1830,10 @@ return found; } -bool script_stack_frame::get_val_offsets (const symbol_record& sym, - std::size_t& frame_offset, - std::size_t& data_offset) const +bool +script_stack_frame::get_val_offsets (const symbol_record& sym, + std::size_t& frame_offset, + std::size_t& data_offset) const { data_offset = sym.data_offset (); frame_offset = sym.frame_offset (); @@ -1843,7 +1880,8 @@ return true; } -void script_stack_frame::get_val_offsets_with_insert (const symbol_record& sym, +void +script_stack_frame::get_val_offsets_with_insert (const symbol_record& sym, std::size_t& frame_offset, std::size_t& data_offset) { @@ -1936,7 +1974,8 @@ return frame->get_scope_flag (data_offset); } -octave_value script_stack_frame::varval (const symbol_record& sym) const +octave_value +script_stack_frame::varval (const symbol_record& sym) const { std::size_t frame_offset; std::size_t data_offset; @@ -1982,7 +2021,8 @@ error ("internal error: invalid switch case"); } -octave_value& script_stack_frame::varref (const symbol_record& sym) +octave_value& +script_stack_frame::varref (const symbol_record& sym) { std::size_t frame_offset; std::size_t data_offset; @@ -2021,8 +2061,9 @@ error ("internal error: invalid switch case"); } -void script_stack_frame::mark_scope (const symbol_record& sym, - scope_flags flag) +void +script_stack_frame::mark_scope (const symbol_record& sym, + scope_flags flag) { std::size_t data_offset = sym.data_offset (); @@ -2045,7 +2086,8 @@ frame->set_scope_flag (data_offset, flag); } -void script_stack_frame::display (bool follow) const +void +script_stack_frame::display (bool follow) const { std::ostream& os = octave_stdout; @@ -2070,12 +2112,14 @@ display_scope (os, get_scope ()); } -void script_stack_frame::accept (stack_frame_walker& sfw) +void +script_stack_frame::accept (stack_frame_walker& sfw) { sfw.visit_script_stack_frame (*this); } -void base_value_stack_frame::display (bool follow) const +void +base_value_stack_frame::display (bool follow) const { std::ostream& os = octave_stdout; @@ -2147,7 +2191,8 @@ return alink; } -void user_fcn_stack_frame::clear_values () +void +user_fcn_stack_frame::clear_values () { symbol_scope fcn_scope = m_fcn->scope (); @@ -2181,7 +2226,8 @@ } } -unwind_protect *user_fcn_stack_frame::unwind_protect_frame () +unwind_protect * +user_fcn_stack_frame::unwind_protect_frame () { if (! m_unwind_protect_frame) m_unwind_protect_frame = new unwind_protect (); @@ -2189,7 +2235,8 @@ return m_unwind_protect_frame; } -symbol_record user_fcn_stack_frame::lookup_symbol (const std::string& name) const +symbol_record +user_fcn_stack_frame::lookup_symbol (const std::string& name) const { const stack_frame *frame = this; @@ -2209,7 +2256,8 @@ return symbol_record (); } -symbol_record user_fcn_stack_frame::insert_symbol (const std::string& name) +symbol_record +user_fcn_stack_frame::insert_symbol (const std::string& name) { // If the symbols is already in the immediate scope, there is // nothing more to do. @@ -2273,7 +2321,8 @@ return frame->get_scope_flag (data_offset); } -octave_value user_fcn_stack_frame::varval (const symbol_record& sym) const +octave_value +user_fcn_stack_frame::varval (const symbol_record& sym) const { std::size_t frame_offset = sym.frame_offset (); std::size_t data_offset = sym.data_offset (); @@ -2314,7 +2363,8 @@ error ("internal error: invalid switch case"); } -octave_value& user_fcn_stack_frame::varref (const symbol_record& sym) +octave_value& +user_fcn_stack_frame::varref (const symbol_record& sym) { std::size_t frame_offset = sym.frame_offset (); std::size_t data_offset = sym.data_offset (); @@ -2352,7 +2402,8 @@ error ("internal error: invalid switch case"); } -void user_fcn_stack_frame::mark_scope (const symbol_record& sym, scope_flags flag) +void +user_fcn_stack_frame::mark_scope (const symbol_record& sym, scope_flags flag) { std::size_t frame_offset = sym.frame_offset (); @@ -2367,7 +2418,8 @@ set_scope_flag (data_offset, flag); } -void user_fcn_stack_frame::display (bool follow) const +void +user_fcn_stack_frame::display (bool follow) const { std::ostream& os = octave_stdout; @@ -2380,12 +2432,14 @@ display_scope (os, get_scope ()); } -void user_fcn_stack_frame::accept (stack_frame_walker& sfw) +void +user_fcn_stack_frame::accept (stack_frame_walker& sfw) { sfw.visit_user_fcn_stack_frame (*this); } -void user_fcn_stack_frame::break_closure_cycles (const std::shared_ptr<stack_frame>& frame) +void +user_fcn_stack_frame::break_closure_cycles (const std::shared_ptr<stack_frame>& frame) { for (auto& val : m_values) val.break_closure_cycles (frame); @@ -2394,7 +2448,8 @@ m_access_link->break_closure_cycles (frame); } -symbol_record scope_stack_frame::insert_symbol (const std::string& name) +symbol_record +scope_stack_frame::insert_symbol (const std::string& name) { // There is no access link for scope frames, so there is no other // frame to search in and the offset must be zero. @@ -2428,7 +2483,8 @@ return get_scope_flag (data_offset); } -octave_value scope_stack_frame::varval (const symbol_record& sym) const +octave_value +scope_stack_frame::varval (const symbol_record& sym) const { // There is no access link for scope frames, so the frame // offset must be zero. @@ -2453,7 +2509,8 @@ error ("internal error: invalid switch case"); } -octave_value& scope_stack_frame::varref (const symbol_record& sym) +octave_value& +scope_stack_frame::varref (const symbol_record& sym) { // There is no access link for scope frames, so the frame // offset must be zero. @@ -2478,8 +2535,9 @@ error ("internal error: invalid switch case"); } -void scope_stack_frame::mark_scope (const symbol_record& sym, - scope_flags flag) +void +scope_stack_frame::mark_scope (const symbol_record& sym, + scope_flags flag) { // There is no access link for scope frames, so the frame // offset must be zero. @@ -2492,7 +2550,8 @@ set_scope_flag (data_offset, flag); } -void scope_stack_frame::display (bool follow) const +void +scope_stack_frame::display (bool follow) const { std::ostream& os = octave_stdout; @@ -2502,7 +2561,8 @@ display_scope (os, m_scope); } -void scope_stack_frame::accept (stack_frame_walker& sfw) +void +scope_stack_frame::accept (stack_frame_walker& sfw) { sfw.visit_scope_stack_frame (*this); }
--- a/libinterp/corefcn/syminfo.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/syminfo.cc Tue Dec 12 18:24:05 2023 -0800 @@ -166,7 +166,8 @@ // FIXME: should we be using std::map<symbol_info> instead of a list? -octave_value symbol_info_list::varval (const std::string& name) const +octave_value +symbol_info_list::varval (const std::string& name) const { for (const auto& syminfo : m_lst) { @@ -177,7 +178,8 @@ return octave_value (); } -std::list<std::string> symbol_info_list::names () const +std::list<std::string> +symbol_info_list::names () const { std::list<std::string> retval; @@ -328,8 +330,9 @@ os << param_buf.str (); } -void symbol_info_list::display (std::ostream& os, - const std::string& format) const +void +symbol_info_list::display (std::ostream& os, + const std::string& format) const { if (! m_lst.empty ()) {
--- a/libinterp/corefcn/symrcm.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/symrcm.cc Tue Dec 12 18:24:05 2023 -0800 @@ -334,7 +334,7 @@ static octave_idx_type calc_degrees (octave_idx_type N, octave_idx_type *cidx, octave_idx_type *ridx, - octave_idx_type *cidx2, octave_idx_type *ridx2, octave_idx_type *D) + octave_idx_type *cidx2, octave_idx_type *ridx2, octave_idx_type *D) { octave_idx_type max_deg = 0; for (octave_idx_type i = 0; i < N; i++)
--- a/libinterp/corefcn/symscope.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/symscope.cc Tue Dec 12 18:24:05 2023 -0800 @@ -51,7 +51,8 @@ return sym; } -void symbol_scope_rep::insert_symbol_record (symbol_record& sr) +void +symbol_scope_rep::insert_symbol_record (symbol_record& sr) { std::size_t data_offset = num_symbols (); std::string name = sr.name (); @@ -61,7 +62,8 @@ m_symbols[name] = sr; } -symbol_record symbol_scope_rep::insert (const std::string& name) +symbol_record +symbol_scope_rep::insert (const std::string& name) { table_iterator p = m_symbols.find (name); @@ -92,7 +94,8 @@ return p->second; } -std::list<octave_value> symbol_scope_rep::localfunctions () const +std::list<octave_value> +symbol_scope_rep::localfunctions () const { std::list<octave_value> retval; @@ -159,7 +162,8 @@ return octave_value (info_map); } -std::list<symbol_record> symbol_scope_rep::symbol_list () const +std::list<symbol_record> +symbol_scope_rep::symbol_list () const { std::list<symbol_record> retval; @@ -271,7 +275,8 @@ return false; } -void symbol_scope_rep::mark_as_variable (const std::string& nm) +void +symbol_scope_rep::mark_as_variable (const std::string& nm) { table_iterator p = m_symbols.find (nm); @@ -279,13 +284,15 @@ p->second.mark_as_variable (); } -void symbol_scope_rep::mark_as_variables (const std::list<std::string>& lst) +void +symbol_scope_rep::mark_as_variables (const std::list<std::string>& lst) { for (const auto& nm : lst) mark_as_variable (nm); } -bool symbol_scope_rep::is_variable (const std::string& nm) const +bool +symbol_scope_rep::is_variable (const std::string& nm) const { table_const_iterator p = m_symbols.find (nm); @@ -304,7 +311,8 @@ return false; } -void symbol_scope_rep::update_nest () +void +symbol_scope_rep::update_nest () { auto t_parent = m_parent.lock (); @@ -335,9 +343,10 @@ scope_obj.update_nest (); } -bool symbol_scope_rep::look_nonlocal (const std::string& name, - std::size_t offset, - symbol_record& result) +bool +symbol_scope_rep::look_nonlocal (const std::string& name, + std::size_t offset, + symbol_record& result) { offset++; @@ -370,7 +379,8 @@ return false; } -std::list<octave_value> symbol_scope::localfunctions () const +std::list<octave_value> +symbol_scope::localfunctions () const { if (! m_rep) return std::list<octave_value> ();
--- a/libinterp/corefcn/symtab.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/symtab.cc Tue Dec 12 18:24:05 2023 -0800 @@ -57,14 +57,16 @@ install_builtins (); } -symbol_scope symbol_table::current_scope () const +symbol_scope +symbol_table::current_scope () const { tree_evaluator& tw = m_interpreter.get_evaluator (); return tw.get_current_scope (); } -bool symbol_table::is_built_in_function_name (const std::string& name) +bool +symbol_table::is_built_in_function_name (const std::string& name) { octave_value val = find_built_in_function (name); @@ -122,8 +124,9 @@ // FIXME: this function only finds legacy class methods, not // classdef methods. -octave_value symbol_table::find_method (const std::string& name, - const std::string& dispatch_type) +octave_value +symbol_table::find_method (const std::string& name, + const std::string& dispatch_type) { if (name.empty ()) return octave_value (); @@ -145,7 +148,8 @@ } } -octave_value symbol_table::find_built_in_function (const std::string& name) +octave_value +symbol_table::find_built_in_function (const std::string& name) { fcn_table_const_iterator p = m_fcn_table.find (name); @@ -164,7 +168,8 @@ } } -octave_value symbol_table::find_autoload (const std::string& name) +octave_value +symbol_table::find_autoload (const std::string& name) { if (name.empty ()) return octave_value (); @@ -307,7 +312,8 @@ } } -octave_value symbol_table::find_cmdline_function (const std::string& name) +octave_value +symbol_table::find_cmdline_function (const std::string& name) { if (name.empty ()) return octave_value (); @@ -329,8 +335,9 @@ } } -void symbol_table::install_cmdline_function (const std::string& name, - const octave_value& fcn) +void +symbol_table::install_cmdline_function (const std::string& name, + const octave_value& fcn) { auto p = m_fcn_table.find (name); @@ -353,9 +360,10 @@ // Install local function FCN named NAME. FILE_NAME is the name of // the file containing the local function. -void symbol_table::install_local_function (const std::string& name, - const octave_value& fcn, - const std::string& file_name) +void +symbol_table::install_local_function (const std::string& name, + const octave_value& fcn, + const std::string& file_name) { auto p = m_fcn_table.find (name); @@ -375,8 +383,9 @@ } } -void symbol_table::install_user_function (const std::string& name, - const octave_value& fcn) +void +symbol_table::install_user_function (const std::string& name, + const octave_value& fcn) { auto p = m_fcn_table.find (name); @@ -398,7 +407,8 @@ // FIXME: should we ensure that FCN really is a built-in function // object? -void symbol_table::install_built_in_function (const std::string& name, +void +symbol_table::install_built_in_function (const std::string& name, const octave_value& fcn) { auto p = m_fcn_table.find (name); @@ -423,7 +433,8 @@ // function with default values so that it will work properly with // unwind_protect. -void symbol_table::clear_functions (bool force) +void +symbol_table::clear_functions (bool force) { auto p = m_fcn_table.begin (); @@ -431,12 +442,14 @@ (p++)->second.clear (force); } -void symbol_table::clear_function (const std::string& name) +void +symbol_table::clear_function (const std::string& name) { clear_user_function (name); } -void symbol_table::clear_function_pattern (const std::string& pat) +void +symbol_table::clear_function_pattern (const std::string& pat) { symbol_match pattern (pat); @@ -451,7 +464,8 @@ } } -void symbol_table::clear_function_regexp (const std::string& pat) +void +symbol_table::clear_function_regexp (const std::string& pat) { regexp pattern (pat); @@ -466,7 +480,8 @@ } } -void symbol_table::clear_user_function (const std::string& name) +void +symbol_table::clear_user_function (const std::string& name) { auto p = m_fcn_table.find (name); @@ -482,7 +497,8 @@ } // This clears oct and mex files, including autoloads. -void symbol_table::clear_dld_function (const std::string& name) +void +symbol_table::clear_dld_function (const std::string& name) { auto p = m_fcn_table.find (name); @@ -495,7 +511,8 @@ } } -void symbol_table::clear_mex_functions () +void +symbol_table::clear_mex_functions () { auto p = m_fcn_table.begin (); @@ -507,8 +524,9 @@ // inferior to SUP_CLASS. Return FALSE if INF_CLASS is currently // marked as superior to SUP_CLASS. -bool symbol_table::set_class_relationship (const std::string& sup_class, - const std::string& inf_class) +bool +symbol_table::set_class_relationship (const std::string& sup_class, + const std::string& inf_class) { if (is_superiorto (inf_class, sup_class)) return false; @@ -534,7 +552,8 @@ // else // // No relation. -bool symbol_table::is_superiorto (const std::string& a, const std::string& b) +bool +symbol_table::is_superiorto (const std::string& a, const std::string& b) { class_precedence_table_const_iterator p = m_class_precedence_table.find (a); // If a has no entry in the precedence table, return false @@ -546,8 +565,9 @@ return (q != inferior_classes.end ()); } -void symbol_table::alias_built_in_function (const std::string& alias, - const std::string& name) +void +symbol_table::alias_built_in_function (const std::string& alias, + const std::string& name) { octave_value fcn = find_built_in_function (name); @@ -563,7 +583,8 @@ panic ("alias: '%s' is undefined", name.c_str ()); } -void symbol_table::install_built_in_dispatch (const std::string& name, +void +symbol_table::install_built_in_dispatch (const std::string& name, const std::string& klass) { auto p = m_fcn_table.find (name); @@ -578,7 +599,8 @@ error ("install_built_in_dispatch: '%s' is undefined", name.c_str ()); } -std::list<std::string> symbol_table::user_function_names () +std::list<std::string> +symbol_table::user_function_names () { std::list<std::string> retval; @@ -594,7 +616,8 @@ return retval; } -std::list<std::string> symbol_table::built_in_function_names () +std::list<std::string> +symbol_table::built_in_function_names () { std::list<std::string> retval; @@ -612,7 +635,8 @@ return retval; } -std::list<std::string> symbol_table::cmdline_function_names () +std::list<std::string> +symbol_table::cmdline_function_names () { std::list<std::string> retval; @@ -650,7 +674,8 @@ return octave_value (info_map); } -octave_value symbol_table::dump () const +octave_value +symbol_table::dump () const { std::map<std::string, octave_value> m = {{ "function_info", dump_fcn_table_map () }, @@ -661,13 +686,15 @@ return octave_value (m); } -void symbol_table::add_to_parent_map (const std::string& classname, - const std::list<std::string>& parent_list) +void +symbol_table::add_to_parent_map (const std::string& classname, + const std::list<std::string>& parent_list) { m_parent_map[classname] = parent_list; } -std::list<std::string> symbol_table::parent_classes (const std::string& dispatch_type) +std::list<std::string> +symbol_table::parent_classes (const std::string& dispatch_type) { std::list<std::string> retval; @@ -691,7 +718,8 @@ return retval; } -void symbol_table::cleanup () +void +symbol_table::cleanup () { clear_functions (); @@ -700,13 +728,15 @@ m_parent_map.clear (); } -fcn_info *symbol_table::get_fcn_info (const std::string& name) +fcn_info * +symbol_table::get_fcn_info (const std::string& name) { auto p = m_fcn_table.find (name); return p != m_fcn_table.end () ? &p->second : nullptr; } -octave_value symbol_table::dump_fcn_table_map () const +octave_value +symbol_table::dump_fcn_table_map () const { if (m_fcn_table.empty ()) return octave_value (Matrix ());
--- a/libinterp/corefcn/sysdep.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/sysdep.cc Tue Dec 12 18:24:05 2023 -0800 @@ -180,7 +180,8 @@ #endif -void set_application_id () +void +set_application_id () { #if defined (__MINGW32__) || defined (_MSC_VER) @@ -382,7 +383,8 @@ // Return TRUE if NAME refers to an existing drive letter or UNC share -bool drive_or_unc_share (const std::string& name) +bool +drive_or_unc_share (const std::string& name) { #if defined (OCTAVE_USE_WINDOWS_API) std::size_t len = name.length (); @@ -431,7 +433,8 @@ #endif } -void sysdep_init () +void +sysdep_init () { // Use a function from libgomp to force loading of OpenMP library. // Otherwise, a dynamically loaded library making use of OpenMP such @@ -449,7 +452,8 @@ #endif } -void sysdep_cleanup () +void +sysdep_cleanup () { #if defined (OCTAVE_USE_WINDOWS_API) // Let us fail immediately without displaying any dialog. @@ -469,7 +473,8 @@ // etc. are NOT disabled. // It doesn't matter whether an input \n is mapped to \r, or vice versa. -void raw_mode (bool on, bool wait) +void +raw_mode (bool on, bool wait) { static bool curr_on = false; @@ -617,7 +622,8 @@ curr_on = on; } -FILE * popen (const char *command, const char *mode) +FILE * +popen (const char *command, const char *mode) { #if defined (__MINGW32__) || defined (_MSC_VER) std::wstring wcommand = sys::u8_to_wstring (command); @@ -633,7 +639,8 @@ #endif } -int pclose (FILE *f) +int +pclose (FILE *f) { #if defined (__MINGW32__) || defined (_MSC_VER) return ::_pclose (f); @@ -644,7 +651,8 @@ // Read one character from the terminal. -int kbhit (bool wait) +int +kbhit (bool wait) { #if defined (HAVE__KBHIT) && defined (HAVE__GETCH) // This essentially means we are on a Windows system. @@ -688,7 +696,8 @@ return c; } -std::string get_P_tmpdir () +std::string +get_P_tmpdir () { #if defined (OCTAVE_USE_WINDOWS_API)
--- a/libinterp/corefcn/tsearch.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/tsearch.cc Tue Dec 12 18:24:05 2023 -0800 @@ -37,12 +37,14 @@ OCTAVE_BEGIN_NAMESPACE(octave) -inline double max (double a, double b, double c) +inline double +max (double a, double b, double c) { return (a > b) ? (a > c ? a : c) : (b > c ? b : c); } -inline double min (double a, double b, double c) +inline double +min (double a, double b, double c) { return (a < b) ? (a < c ? a : c) : (b < c ? b : c); }
--- a/libinterp/corefcn/url-handle-manager.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/url-handle-manager.cc Tue Dec 12 18:24:05 2023 -0800 @@ -43,7 +43,8 @@ return (rand () + 1.0) / maxrand; } -url_handle url_handle_manager::get_handle () +url_handle +url_handle_manager::get_handle () { url_handle retval; @@ -68,7 +69,8 @@ return retval; } -void url_handle_manager::free (const url_handle& h) +void +url_handle_manager::free (const url_handle& h) { if (h.ok ()) {
--- a/libinterp/corefcn/utils.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/utils.cc Tue Dec 12 18:24:05 2023 -0800 @@ -88,7 +88,8 @@ return true; } -bool valid_identifier (const std::string& s) +bool +valid_identifier (const std::string& s) { return valid_identifier (s.c_str ()); } @@ -292,7 +293,8 @@ // Return TRUE if F and G are both names for the same file. -bool same_file (const std::string& f, const std::string& g) +bool +same_file (const std::string& f, const std::string& g) { return sys::same_file (f, g); } @@ -406,8 +408,9 @@ %!error <arrays .* must be the same size> is_same_file ({"1", "2"}, {"1"; "2"}) */ -int almost_match (const std::string& std, const std::string& s, - int min_match_len, int case_sens) +int +almost_match (const std::string& std, const std::string& s, + int min_match_len, int case_sens) { int stdlen = std.length (); int slen = s.length (); @@ -421,9 +424,10 @@ // Ugh. -int keyword_almost_match (const char *const *std, int *min_len, - const std::string& s, - int min_toks_to_match, int max_toks) +int +keyword_almost_match (const char *const *std, int *min_len, + const std::string& s, + int min_toks_to_match, int max_toks) { int status = 0; int tok_count = 0; @@ -509,8 +513,9 @@ // See if the given file is in the path. -std::string search_path_for_file (const std::string& path, - const string_vector& names) +std::string +search_path_for_file (const std::string& path, + const string_vector& names) { directory_path p (path); @@ -519,8 +524,9 @@ // Find all locations of the given file in the path. -string_vector search_path_for_all_files (const std::string& path, - const string_vector& names) +string_vector +search_path_for_all_files (const std::string& path, + const string_vector& names) { directory_path p (path); @@ -534,7 +540,8 @@ return sv; } -static string_vector make_absolute (const string_vector& sv) +static string_vector +make_absolute (const string_vector& sv) { octave_idx_type len = sv.numel (); @@ -687,7 +694,8 @@ %!error file_in_path (path (), "plot.m", "bar") */ -std::string file_in_path (const std::string& name, const std::string& suffix) +std::string +file_in_path (const std::string& name, const std::string& suffix) { std::string nm = name; @@ -699,9 +707,10 @@ return sys::env::make_absolute (lp.find_file (nm)); } -std::string find_data_file_in_load_path (const std::string& fcn, - const std::string& file, - bool require_regular_file) +std::string +find_data_file_in_load_path (const std::string& fcn, + const std::string& file, + bool require_regular_file) { std::string fname = file; @@ -736,7 +745,8 @@ // See if there is a function file in the path. // If so, return the full path to the file. -std::string fcn_file_in_path (const std::string& name) +std::string +fcn_file_in_path (const std::string& name) { std::string retval; @@ -774,7 +784,8 @@ // See if there is a directory called "name" in the path and if it // contains a Contents.m file. If so, return the full path to this file. -std::string contents_file_in_path (const std::string& dir) +std::string +contents_file_in_path (const std::string& dir) { std::string retval; @@ -794,7 +805,8 @@ // Replace backslash escapes in a string with the real values. -std::string do_string_escapes (const std::string& s) +std::string +do_string_escapes (const std::string& s) { std::string retval; @@ -975,7 +987,8 @@ %!warning <unrecognized escape sequence> do_string_escapes ('\G'); */ -const char * undo_string_escape (char c) +const char * +undo_string_escape (char c) { switch (c) { @@ -1019,7 +1032,8 @@ } } -std::string undo_string_escapes (const std::string& s) +std::string +undo_string_escapes (const std::string& s) { std::string retval; @@ -1297,8 +1311,9 @@ %!error errno_list ("foo") */ -static void check_dimensions (octave_idx_type& nr, octave_idx_type& nc, - const char *warnfor) +static void +check_dimensions (octave_idx_type& nr, octave_idx_type& nc, + const char *warnfor) { if (nr < 0 || nc < 0) { @@ -1310,7 +1325,8 @@ } } -void check_dimensions (dim_vector& dim, const char *warnfor) +void +check_dimensions (dim_vector& dim, const char *warnfor) { bool neg = false; @@ -1328,8 +1344,9 @@ "%s: converting negative dimension to zero", warnfor); } -void get_dimensions (const octave_value& a, const char *warn_for, - dim_vector& dim) +void +get_dimensions (const octave_value& a, const char *warn_for, + dim_vector& dim) { // We support dimensions to be specified by a vector, even if it's empty. // If the vector is empty, the final dimensions end up being 0x0. @@ -1357,8 +1374,9 @@ check_dimensions (dim, warn_for); } -void get_dimensions (const octave_value& a, const char *warn_for, - octave_idx_type& nr, octave_idx_type& nc) +void +get_dimensions (const octave_value& a, const char *warn_for, + octave_idx_type& nr, octave_idx_type& nc) { if (a.is_scalar_type ()) { @@ -1380,9 +1398,10 @@ check_dimensions (nr, nc, warn_for); } -void get_dimensions (const octave_value& a, const octave_value& b, - const char *warn_for, octave_idx_type& nr, - octave_idx_type& nc) +void +get_dimensions (const octave_value& a, const octave_value& b, + const char *warn_for, octave_idx_type& nr, + octave_idx_type& nc) { nr = (a.isempty () ? 0 : a.idx_type_value (true)); nc = (b.isempty () ? 0 : b.idx_type_value (true)); @@ -1390,8 +1409,9 @@ check_dimensions (nr, nc, warn_for); } -octave_idx_type dims_to_numel (const dim_vector& dims, - const octave_value_list& idx_arg) +octave_idx_type +dims_to_numel (const dim_vector& dims, + const octave_value_list& idx_arg) { octave_idx_type retval; @@ -1429,7 +1449,8 @@ return retval; } -Matrix identity_matrix (octave_idx_type nr, octave_idx_type nc) +Matrix +identity_matrix (octave_idx_type nr, octave_idx_type nc) { Matrix m (nr, nc, 0.0); @@ -1444,7 +1465,8 @@ return m; } -FloatMatrix float_identity_matrix (octave_idx_type nr, octave_idx_type nc) +FloatMatrix +float_identity_matrix (octave_idx_type nr, octave_idx_type nc) { FloatMatrix m (nr, nc, 0.0); @@ -1459,7 +1481,8 @@ return m; } -std::size_t format (std::ostream& os, const char *fmt, ...) +std::size_t +format (std::ostream& os, const char *fmt, ...) { std::size_t retval; @@ -1473,7 +1496,8 @@ return retval; } -std::size_t vformat (std::ostream& os, const char *fmt, va_list args) +std::size_t +vformat (std::ostream& os, const char *fmt, va_list args) { std::string s = vasprintf (fmt, args); @@ -1482,7 +1506,8 @@ return s.length (); } -std::string vasprintf (const char *fmt, va_list args) +std::string +vasprintf (const char *fmt, va_list args) { std::string retval; @@ -1499,7 +1524,8 @@ return retval; } -std::string asprintf (const char *fmt, ...) +std::string +asprintf (const char *fmt, ...) { std::string retval; @@ -1518,7 +1544,8 @@ // won't respond to SIGINT. Maybe there is a better way than // breaking this up into multiple shorter intervals? -void sleep (double seconds, bool do_graphics_events) +void +sleep (double seconds, bool do_graphics_events) { if (seconds <= 0) return;
--- a/libinterp/corefcn/xnorm.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/corefcn/xnorm.cc Tue Dec 12 18:24:05 2023 -0800 @@ -92,7 +92,8 @@ return retval; } -octave_value xcolnorms (const octave_value& x, const octave_value& p) +octave_value +xcolnorms (const octave_value& x, const octave_value& p) { octave_value retval; @@ -131,7 +132,8 @@ return retval; } -octave_value xrownorms (const octave_value& x, const octave_value& p) +octave_value +xrownorms (const octave_value& x, const octave_value& p) { octave_value retval; @@ -170,7 +172,8 @@ return retval; } -octave_value xfrobnorm (const octave_value& x) +octave_value +xfrobnorm (const octave_value& x) { octave_value retval;
--- a/libinterp/dldfcn/__init_fltk__.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/dldfcn/__init_fltk__.cc Tue Dec 12 18:24:05 2023 -0800 @@ -296,7 +296,8 @@ } }; -static void script_cb (Fl_Widget *, void *data) +static void +script_cb (Fl_Widget *, void *data) { static_cast<uimenu::properties *> (data)->execute_menuselectedfcn (); }
--- a/libinterp/octave-value/ov-base.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave-value/ov-base.cc Tue Dec 12 18:24:05 2023 -0800 @@ -63,7 +63,8 @@ #include "variables.h" #include "ov-inline.h" -builtin_type_t btyp_mixed_numeric (builtin_type_t x, builtin_type_t y) +builtin_type_t +btyp_mixed_numeric (builtin_type_t x, builtin_type_t y) { builtin_type_t retval = btyp_unknown;
--- a/libinterp/octave-value/ov-bool-mat.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave-value/ov-bool-mat.cc Tue Dec 12 18:24:05 2023 -0800 @@ -363,7 +363,7 @@ const bool *mtmp = m_matrix.data (); octave_idx_type nel = m_matrix.numel (); - os.write (reinterpret_cast<const char*> (mtmp), nel); + os.write (reinterpret_cast<const char *> (mtmp), nel); return true; } @@ -465,7 +465,7 @@ retval = H5Dwrite (data_hid, H5T_NATIVE_HBOOL, octave_H5S_ALL, octave_H5S_ALL, octave_H5P_DEFAULT, - reinterpret_cast<const char*> (mtmp)) >= 0; + reinterpret_cast<const char *> (mtmp)) >= 0; H5Dclose (data_hid); H5Sclose (space_hid);
--- a/libinterp/octave-value/ov-cell.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave-value/ov-cell.cc Tue Dec 12 18:24:05 2023 -0800 @@ -144,7 +144,8 @@ DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_cell, "cell", "cell"); -void octave_cell::break_closure_cycles (const std::shared_ptr<octave::stack_frame>& frame) +void +octave_cell::break_closure_cycles (const std::shared_ptr<octave::stack_frame>& frame) { for (octave_idx_type i = 0; i < m_matrix.numel (); i++) m_matrix(i).break_closure_cycles (frame);
--- a/libinterp/octave-value/ov-ch-mat.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave-value/ov-ch-mat.cc Tue Dec 12 18:24:05 2023 -0800 @@ -243,7 +243,8 @@ // there's no need to fuck around. The exceptions are isascii and // toascii, which are not C++. Oddly enough, all those character // functions are int (*) (int), even in C++. Wicked! -static inline int xisascii (int c) +static inline int +xisascii (int c) { #if defined (HAVE_ISASCII) return isascii (c);
--- a/libinterp/octave-value/ov-class.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave-value/ov-class.cc Tue Dec 12 18:24:05 2023 -0800 @@ -69,7 +69,7 @@ octave_class::register_type (octave::type_info& ti) { s_t_id = ti.register_type (octave_class::s_t_name, "<unknown>", - octave_value (new octave_class ())); + octave_value (new octave_class ())); } octave_class::octave_class (const octave_map& m, const std::string& id, @@ -494,14 +494,14 @@ // and the caller to subsref accepts more that one output, return // the elements as a comma-separated list so that we can pass it to the // evaluator - if (retval.length () > 1 && (nargout < 0 || nargout >1)) + if (retval.length () > 1 && (nargout < 0 || nargout > 1)) { - if (nargout <= 0 || nargout>=retval.length()) + if (nargout <= 0 || nargout >= retval.length ()) // Take the whole list retval = octave_value (retval); else // Take nargout elements of the list - retval = octave_value(retval.slice(0,nargout)); + retval = octave_value (retval.slice (0, nargout)); } } else @@ -1446,7 +1446,8 @@ goto error_cleanup; // Add the class name to the group - type_hid = H5Tcopy (H5T_C_S1); H5Tset_size (type_hid, m_c_name.length () + 1); + type_hid = H5Tcopy (H5T_C_S1); + H5Tset_size (type_hid, m_c_name.length () + 1); if (type_hid < 0) goto error_cleanup;
--- a/libinterp/octave-value/ov-classdef.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave-value/ov-classdef.cc Tue Dec 12 18:24:05 2023 -0800 @@ -65,7 +65,7 @@ octave_classdef::register_type (octave::type_info& ti) { s_t_id = ti.register_type (octave_classdef::s_t_name, "<unknown>", - octave_value (new octave_classdef ())); + octave_value (new octave_classdef ())); } octave_value_list @@ -120,14 +120,14 @@ // and the caller to subsref accepts more that one output, return // the elements as a comma-separated list so that we can pass it to the // evaluator - if (retval.length () > 1 && (nargout < 0 || nargout >1)) + if (retval.length () > 1 && (nargout < 0 || nargout > 1)) { - if (nargout <= 0 || nargout>=retval.length()) + if (nargout <= 0 || nargout >= retval.length ()) // Take the whole list retval = octave_value (retval); else // Take nargout elements of the list - retval = octave_value(retval.slice(0,nargout)); + retval = octave_value (retval.slice (0, nargout)); } return retval; @@ -439,7 +439,8 @@ return octave::to_ov (octave::lookup_class (cls)); } -bool octave_classdef_meta::is_classdef_method (const std::string& cname) const +bool +octave_classdef_meta::is_classdef_method (const std::string& cname) const { bool retval = false; @@ -458,7 +459,8 @@ return retval; } -bool octave_classdef_meta::is_classdef_constructor (const std::string& cname) const +bool +octave_classdef_meta::is_classdef_constructor (const std::string& cname) const { bool retval = false; @@ -478,7 +480,8 @@ return retval; } -std::string octave_classdef_meta::doc_string (const std::string& meth_name) const +std::string +octave_classdef_meta::doc_string (const std::string& meth_name) const { if (m_object.is_class ()) { @@ -496,7 +499,8 @@ return ""; } -std::string octave_classdef_meta::file_name () const +std::string +octave_classdef_meta::file_name () const { if (m_object.is_class ()) { @@ -615,7 +619,8 @@ return retval; } -bool octave_classdef_superclass_ref::is_constructed_object (octave::tree_evaluator& tw, +bool +octave_classdef_superclass_ref::is_constructed_object (octave::tree_evaluator& tw, const std::string& nm) { octave_function *of = tw.current_function ();
--- a/libinterp/octave-value/ov-fcn-handle.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave-value/ov-fcn-handle.cc Tue Dec 12 18:24:05 2023 -0800 @@ -780,20 +780,23 @@ extern bool is_equal_to (const anonymous_fcn_handle& fh1, const anonymous_fcn_handle& fh2); -static void err_invalid_fcn_handle (const std::string& name) +static void +err_invalid_fcn_handle (const std::string& name) { error ("invalid function handle, unable to find function for @%s", name.c_str ()); } -octave_value base_fcn_handle::make_weak_nested_handle () const +octave_value +base_fcn_handle::make_weak_nested_handle () const { std::string type_str = type (); error ("invalid conversion from %s handle to weak nestead handle", type_str.c_str ()); } -octave_value base_fcn_handle::make_weak_anonymous_handle () const +octave_value +base_fcn_handle::make_weak_anonymous_handle () const { std::string type_str = type (); error ("invalid conversion from %s handle to weak anonymous handle", @@ -891,7 +894,8 @@ return true; } -void base_fcn_handle::warn_load (const char *file_type) const +void +base_fcn_handle::warn_load (const char *file_type) const { std::string obj_type = type (); @@ -901,7 +905,8 @@ obj_type.c_str (), file_type); } -void base_fcn_handle::warn_save (const char *file_type) const +void +base_fcn_handle::warn_save (const char *file_type) const { std::string obj_type = type (); @@ -911,7 +916,8 @@ obj_type.c_str (), file_type); } -void base_fcn_handle::unimplemented (const char *op, const char *fmt) const +void +base_fcn_handle::unimplemented (const char *op, const char *fmt) const { std::string htype = type (); @@ -933,7 +939,8 @@ return interp.feval (m_fcn, args, nargout); } -octave_scalar_map internal_fcn_handle::info () +octave_scalar_map +internal_fcn_handle::info () { octave_scalar_map m; @@ -944,8 +951,9 @@ return m; } -bool is_equal_to (const internal_fcn_handle& fh1, - const internal_fcn_handle& fh2) +bool +is_equal_to (const internal_fcn_handle& fh1, + const internal_fcn_handle& fh2) { if (fh1.m_name == fh2.m_name && fh1.m_fcn.is_defined () && fh2.m_fcn.is_defined ()) @@ -1140,7 +1148,8 @@ return interp.feval (fcn_to_call, args, nargout); } -octave_function *simple_fcn_handle::function_value (bool) +octave_function * +simple_fcn_handle::function_value (bool) { // FIXME: Shouldn't the lookup rules here match those used in the // call method? @@ -1159,7 +1168,8 @@ return m_fcn.is_defined () ? m_fcn.function_value () : nullptr; } -octave_user_function *simple_fcn_handle::user_function_value (bool) +octave_user_function * +simple_fcn_handle::user_function_value (bool) { // FIXME: Shouldn't the lookup rules here match those used in the // call method? @@ -1178,7 +1188,8 @@ return m_fcn.is_defined () ? m_fcn.user_function_value () : nullptr; } -octave_value simple_fcn_handle::fcn_val () +octave_value +simple_fcn_handle::fcn_val () { if (m_fcn.is_defined ()) return m_fcn; @@ -1194,7 +1205,8 @@ return m_fcn; } -octave_scalar_map simple_fcn_handle::info () +octave_scalar_map +simple_fcn_handle::info () { octave_scalar_map m; @@ -1206,7 +1218,8 @@ return m; } -bool simple_fcn_handle::save_ascii (std::ostream& os) +bool +simple_fcn_handle::save_ascii (std::ostream& os) { os << "# octaveroot: " << config::octave_exec_home () << "\n"; @@ -1221,7 +1234,8 @@ return true; } -bool simple_fcn_handle::load_ascii (std::istream& is) +bool +simple_fcn_handle::load_ascii (std::istream& is) { // FIXME: If m_file is not empty, try to load the file and define // the function? Is it an error if that fails? Or should this job @@ -1230,7 +1244,8 @@ return is.good (); } -bool simple_fcn_handle::save_binary (std::ostream& os, bool) +bool +simple_fcn_handle::save_binary (std::ostream& os, bool) { std::ostringstream nmbuf; @@ -1248,14 +1263,16 @@ return true; } -bool simple_fcn_handle::load_binary (std::istream& is, bool, - mach_info::float_format) +bool +simple_fcn_handle::load_binary (std::istream& is, bool, + mach_info::float_format) { return is.good (); } -bool simple_fcn_handle::save_hdf5 (octave_hdf5_id loc_id, const char *name, - bool) +bool +simple_fcn_handle::save_hdf5 (octave_hdf5_id loc_id, const char *name, + bool) { #if defined (HAVE_HDF5) @@ -1404,9 +1421,10 @@ #endif } -bool simple_fcn_handle::load_hdf5 (octave_hdf5_id& group_hid, - octave_hdf5_id& space_hid, - octave_hdf5_id& type_hid) +bool +simple_fcn_handle::load_hdf5 (octave_hdf5_id& group_hid, + octave_hdf5_id& space_hid, + octave_hdf5_id& type_hid) { #if defined (HAVE_HDF5) @@ -1429,14 +1447,16 @@ #endif } -void simple_fcn_handle::print_raw (std::ostream& os, bool pr_as_read_syntax, - int current_print_indent_level) const +void +simple_fcn_handle::print_raw (std::ostream& os, bool pr_as_read_syntax, + int current_print_indent_level) const { octave_print_internal (os, '@' + m_name, pr_as_read_syntax, current_print_indent_level); } -bool is_equal_to (const simple_fcn_handle& fh1, const simple_fcn_handle& fh2) +bool +is_equal_to (const simple_fcn_handle& fh1, const simple_fcn_handle& fh2) { if (fh1.m_name == fh2.m_name) { @@ -1488,7 +1508,8 @@ return interp.feval (m_fcn, args, nargout); } -octave_scalar_map scoped_fcn_handle::info () +octave_scalar_map +scoped_fcn_handle::info () { octave_scalar_map m; @@ -1501,7 +1522,8 @@ return m; } -bool scoped_fcn_handle::save_ascii (std::ostream& os) +bool +scoped_fcn_handle::save_ascii (std::ostream& os) { os << "# octaveroot: " << config::octave_exec_home () << "\n"; @@ -1519,7 +1541,8 @@ return os.good (); } -bool scoped_fcn_handle::load_ascii (std::istream& is) +bool +scoped_fcn_handle::load_ascii (std::istream& is) { octave_cell ov_cell; ov_cell.load_ascii (is); @@ -1535,7 +1558,8 @@ return is.good (); } -bool scoped_fcn_handle::save_binary (std::ostream& os, bool save_as_floats) +bool +scoped_fcn_handle::save_binary (std::ostream& os, bool save_as_floats) { std::ostringstream nmbuf; @@ -1555,8 +1579,9 @@ return os.good (); } -bool scoped_fcn_handle::load_binary (std::istream& is, bool swap, - mach_info::float_format fmt) +bool +scoped_fcn_handle::load_binary (std::istream& is, bool swap, + mach_info::float_format fmt) { octave_cell ov_cell; ov_cell.load_binary (is, swap, fmt); @@ -1572,8 +1597,9 @@ return is.good (); } -bool scoped_fcn_handle::save_hdf5 (octave_hdf5_id loc_id, const char *name, - bool) +bool +scoped_fcn_handle::save_hdf5 (octave_hdf5_id loc_id, const char *name, + bool) { #if defined (HAVE_HDF5) @@ -1598,9 +1624,10 @@ #endif } -bool scoped_fcn_handle::load_hdf5 (octave_hdf5_id& group_hid, - octave_hdf5_id& space_hid, - octave_hdf5_id& type_hid) +bool +scoped_fcn_handle::load_hdf5 (octave_hdf5_id& group_hid, + octave_hdf5_id& space_hid, + octave_hdf5_id& type_hid) { #if defined (HAVE_HDF5) @@ -1625,15 +1652,17 @@ #endif } -void scoped_fcn_handle::print_raw (std::ostream& os, - bool pr_as_read_syntax, - int current_print_indent_level) const +void +scoped_fcn_handle::print_raw (std::ostream& os, + bool pr_as_read_syntax, + int current_print_indent_level) const { octave_print_internal (os, '@' + m_name, pr_as_read_syntax, current_print_indent_level); } -bool is_equal_to (const scoped_fcn_handle& fh1, const scoped_fcn_handle& fh2) +bool +is_equal_to (const scoped_fcn_handle& fh1, const scoped_fcn_handle& fh2) { if (fh1.m_name == fh2.m_name && fh2.m_parentage == fh2.m_parentage @@ -1643,7 +1672,8 @@ return false; } -void scoped_fcn_handle::find_function () +void +scoped_fcn_handle::find_function () { // Since a scoped function is not visible by itself, try to load the // file named in m_file then find and define the scoped function. @@ -1700,7 +1730,8 @@ } } -octave_scalar_map base_nested_fcn_handle::info () +octave_scalar_map +base_nested_fcn_handle::info () { octave_scalar_map m; @@ -1721,7 +1752,8 @@ // Is it an error if that fails? Or should this job always be // deferred until the handle is used? -bool base_nested_fcn_handle::save_ascii (std::ostream& os) +bool +base_nested_fcn_handle::save_ascii (std::ostream& os) { unimplemented ("save", "text"); @@ -1730,7 +1762,8 @@ return true; } -bool base_nested_fcn_handle::load_ascii (std::istream& is) +bool +base_nested_fcn_handle::load_ascii (std::istream& is) { unimplemented ("load", "text"); @@ -1739,8 +1772,9 @@ return true; } -bool base_nested_fcn_handle::save_binary (std::ostream& os, - bool save_as_floats) +bool +base_nested_fcn_handle::save_binary (std::ostream& os, + bool save_as_floats) { unimplemented ("save", "binary"); @@ -1750,8 +1784,9 @@ return true; } -bool base_nested_fcn_handle::load_binary (std::istream& is, bool swap, - mach_info::float_format fmt) +bool +base_nested_fcn_handle::load_binary (std::istream& is, bool swap, + mach_info::float_format fmt) { unimplemented ("load", "binary"); @@ -1762,8 +1797,9 @@ return true; } -bool base_nested_fcn_handle::save_hdf5 (octave_hdf5_id loc_id, - const char *name, bool) +bool +base_nested_fcn_handle::save_hdf5 (octave_hdf5_id loc_id, + const char *name, bool) { #if defined (HAVE_HDF5) @@ -1786,9 +1822,10 @@ #endif } -bool base_nested_fcn_handle::load_hdf5 (octave_hdf5_id& group_hid, - octave_hdf5_id& space_hid, - octave_hdf5_id& type_hid) +bool +base_nested_fcn_handle::load_hdf5 (octave_hdf5_id& group_hid, + octave_hdf5_id& space_hid, + octave_hdf5_id& type_hid) { #if defined (HAVE_HDF5) @@ -1811,15 +1848,17 @@ #endif } -void base_nested_fcn_handle::print_raw (std::ostream& os, - bool pr_as_read_syntax, - int current_print_indent_level) const +void +base_nested_fcn_handle::print_raw (std::ostream& os, + bool pr_as_read_syntax, + int current_print_indent_level) const { octave_print_internal (os, '@' + m_name, pr_as_read_syntax, current_print_indent_level); } -octave_value nested_fcn_handle::make_weak_nested_handle () const +octave_value +nested_fcn_handle::make_weak_nested_handle () const { return octave_value (new octave_fcn_handle (new weak_nested_fcn_handle (*this))); @@ -1839,12 +1878,14 @@ return oct_usr_fcn->execute (tw, nargout, args); } -octave_value nested_fcn_handle::workspace () const +octave_value +nested_fcn_handle::workspace () const { return m_stack_context->workspace (); } -bool is_equal_to (const nested_fcn_handle& fh1, const nested_fcn_handle& fh2) +bool +is_equal_to (const nested_fcn_handle& fh1, const nested_fcn_handle& fh2) { if (fh1.m_name == fh2.m_name && fh1.m_fcn.is_defined () && fh2.m_fcn.is_defined ()) @@ -1869,15 +1910,17 @@ return oct_usr_fcn->execute (tw, nargout, args); } -octave_value weak_nested_fcn_handle::workspace () const +octave_value +weak_nested_fcn_handle::workspace () const { std::shared_ptr<stack_frame> frames = m_stack_context.lock (); return frames ? frames->workspace () : octave_value (); } -bool is_equal_to (const weak_nested_fcn_handle& fh1, - const weak_nested_fcn_handle& fh2) +bool +is_equal_to (const weak_nested_fcn_handle& fh1, + const weak_nested_fcn_handle& fh2) { if (fh1.m_name == fh2.m_name && fh1.m_fcn.is_defined () && fh2.m_fcn.is_defined ()) @@ -1937,7 +1980,8 @@ return interp.feval (fcn_name (), args, nargout); } -octave_scalar_map class_simple_fcn_handle::info () +octave_scalar_map +class_simple_fcn_handle::info () { octave_scalar_map m; @@ -1954,7 +1998,8 @@ // function? Is it an error if that fails? Or should this job always // be deferred until the handle is used? -bool class_simple_fcn_handle::save_ascii (std::ostream& os) +bool +class_simple_fcn_handle::save_ascii (std::ostream& os) { unimplemented ("save", "text"); @@ -1963,7 +2008,8 @@ return true; } -bool class_simple_fcn_handle::load_ascii (std::istream& is) +bool +class_simple_fcn_handle::load_ascii (std::istream& is) { unimplemented ("load", "text"); @@ -1972,8 +2018,9 @@ return true; } -bool class_simple_fcn_handle::save_binary (std::ostream& os, - bool save_as_floats) +bool +class_simple_fcn_handle::save_binary (std::ostream& os, + bool save_as_floats) { unimplemented ("save", "binary"); @@ -1983,8 +2030,9 @@ return true; } -bool class_simple_fcn_handle::load_binary (std::istream& is, bool swap, - mach_info::float_format fmt) +bool +class_simple_fcn_handle::load_binary (std::istream& is, bool swap, + mach_info::float_format fmt) { unimplemented ("load", "binary"); @@ -1995,8 +2043,9 @@ return true; } -bool class_simple_fcn_handle::save_hdf5 (octave_hdf5_id loc_id, - const char *name, bool) +bool +class_simple_fcn_handle::save_hdf5 (octave_hdf5_id loc_id, + const char *name, bool) { #if defined (HAVE_HDF5) @@ -2019,9 +2068,10 @@ #endif } -bool class_simple_fcn_handle::load_hdf5 (octave_hdf5_id& group_hid, - octave_hdf5_id& space_hid, - octave_hdf5_id& type_hid) +bool +class_simple_fcn_handle::load_hdf5 (octave_hdf5_id& group_hid, + octave_hdf5_id& space_hid, + octave_hdf5_id& type_hid) { #if defined (HAVE_HDF5) @@ -2044,16 +2094,18 @@ #endif } -void class_simple_fcn_handle::print_raw (std::ostream& os, - bool pr_as_read_syntax, - int current_print_indent_level) const +void +class_simple_fcn_handle::print_raw (std::ostream& os, + bool pr_as_read_syntax, + int current_print_indent_level) const { octave_print_internal (os, '@' + m_name, pr_as_read_syntax, current_print_indent_level); } -bool is_equal_to (const class_simple_fcn_handle& fh1, - const class_simple_fcn_handle& fh2) +bool +is_equal_to (const class_simple_fcn_handle& fh1, + const class_simple_fcn_handle& fh2) { // FIXME: Also need to check object values are equivalent? @@ -2066,7 +2118,8 @@ const std::string base_anonymous_fcn_handle::anonymous ("@<anonymous>"); -octave_scalar_map base_anonymous_fcn_handle::info () +octave_scalar_map +base_anonymous_fcn_handle::info () { octave_scalar_map m; @@ -2082,7 +2135,8 @@ return m; } -bool base_anonymous_fcn_handle::save_ascii (std::ostream& os) +bool +base_anonymous_fcn_handle::save_ascii (std::ostream& os) { // FIXME: can we ensure that m_fcn is always defined? @@ -2110,7 +2164,8 @@ return true; } -bool base_anonymous_fcn_handle::load_ascii (std::istream& is) +bool +base_anonymous_fcn_handle::load_ascii (std::istream& is) { octave::skip_preceeding_newline (is); @@ -2168,8 +2223,9 @@ return false; } -bool base_anonymous_fcn_handle::save_binary (std::ostream& os, - bool save_as_floats) +bool +base_anonymous_fcn_handle::save_binary (std::ostream& os, + bool save_as_floats) { // FIXME: can we ensure that m_fcn is always defined? @@ -2209,8 +2265,9 @@ return true; } -bool base_anonymous_fcn_handle::load_binary (std::istream& is, bool swap, - mach_info::float_format fmt) +bool +base_anonymous_fcn_handle::load_binary (std::istream& is, bool swap, + mach_info::float_format fmt) { // Read extra characters in m_name as the number of local variable // values in this anonymous function. @@ -2276,9 +2333,10 @@ return false; } -bool base_anonymous_fcn_handle::save_hdf5 (octave_hdf5_id loc_id, - const char *name, - bool save_as_floats) +bool +base_anonymous_fcn_handle::save_hdf5 (octave_hdf5_id loc_id, + const char *name, + bool save_as_floats) { #if defined (HAVE_HDF5) @@ -2443,9 +2501,10 @@ #endif } -bool base_anonymous_fcn_handle::load_hdf5 (octave_hdf5_id& group_hid, - octave_hdf5_id& space_hid, - octave_hdf5_id& type_hid) +bool +base_anonymous_fcn_handle::load_hdf5 (octave_hdf5_id& group_hid, + octave_hdf5_id& space_hid, + octave_hdf5_id& type_hid) { #if defined (HAVE_HDF5) @@ -2609,7 +2668,8 @@ #endif } -void base_anonymous_fcn_handle::print_raw (std::ostream& os, bool, int) const +void +base_anonymous_fcn_handle::print_raw (std::ostream& os, bool, int) const { tree_print_code tpc (os); @@ -2650,7 +2710,8 @@ tpc.print_fcn_handle_body (e); } -bool base_anonymous_fcn_handle::parse (const std::string& fcn_text) +bool +base_anonymous_fcn_handle::parse (const std::string& fcn_text) { // FIXME: If evaluation of the string gives us an anonymous function // handle object, then why extract the function and create a new @@ -2706,7 +2767,8 @@ m_stack_context->mark_closure_context (); } -octave_value anonymous_fcn_handle::make_weak_anonymous_handle () const +octave_value +anonymous_fcn_handle::make_weak_anonymous_handle () const { return octave_value (new octave_fcn_handle (new weak_anonymous_fcn_handle (*this))); @@ -2726,7 +2788,8 @@ return oct_usr_fcn->execute (tw, nargout, args); } -octave_value anonymous_fcn_handle::workspace () const +octave_value +anonymous_fcn_handle::workspace () const { octave_scalar_map local_vars_map; @@ -2755,8 +2818,9 @@ return retval; } -bool is_equal_to (const anonymous_fcn_handle& fh1, - const anonymous_fcn_handle& fh2) +bool +is_equal_to (const anonymous_fcn_handle& fh1, + const anonymous_fcn_handle& fh2) { if (fh1.m_fcn.is_defined () && fh2.m_fcn.is_defined ()) return fh1.m_fcn.is_copy_of (fh2.m_fcn); @@ -2780,7 +2844,8 @@ return oct_usr_fcn->execute (tw, nargout, args); } -octave_value weak_anonymous_fcn_handle::workspace () const +octave_value +weak_anonymous_fcn_handle::workspace () const { octave_scalar_map local_vars_map; @@ -2813,8 +2878,9 @@ return retval; } -bool is_equal_to (const weak_anonymous_fcn_handle& fh1, - const weak_anonymous_fcn_handle& fh2) +bool +is_equal_to (const weak_anonymous_fcn_handle& fh1, + const weak_anonymous_fcn_handle& fh2) { if (fh1.m_name == fh2.m_name && fh1.m_fcn.is_defined () && fh2.m_fcn.is_defined ())
--- a/libinterp/octave-value/ov-fcn-handle.h Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave-value/ov-fcn-handle.h Tue Dec 12 18:24:05 2023 -0800 @@ -163,7 +163,7 @@ virtual bool has_function_cache () const { return false; } - virtual void compile () {} + virtual void compile () { } protected:
--- a/libinterp/octave-value/ov-fcn.h Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave-value/ov-fcn.h Tue Dec 12 18:24:05 2023 -0800 @@ -236,7 +236,7 @@ execute (octave::tree_evaluator& tw, int nargout = 0, const octave_value_list& args = octave_value_list ()) = 0; - protected: +protected: octave_function (const std::string& nm, const std::string& ds = "")
--- a/libinterp/octave-value/ov-inline.h Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave-value/ov-inline.h Tue Dec 12 18:24:05 2023 -0800 @@ -42,7 +42,7 @@ class octave_value_factory { - public: +public: static octave_value make (double d) {
--- a/libinterp/octave-value/ov-lazy-idx.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave-value/ov-lazy-idx.cc Tue Dec 12 18:24:05 2023 -0800 @@ -222,12 +222,14 @@ static const std::string value_save_tag ("index_value"); -bool octave_lazy_index::save_ascii (std::ostream& os) +bool +octave_lazy_index::save_ascii (std::ostream& os) { return save_text_data (os, make_value (), value_save_tag, false, 0); } -bool octave_lazy_index::load_ascii (std::istream& is) +bool +octave_lazy_index::load_ascii (std::istream& is) { bool dummy; @@ -240,14 +242,16 @@ return true; } -bool octave_lazy_index::save_binary (std::ostream& os, bool save_as_floats) +bool +octave_lazy_index::save_binary (std::ostream& os, bool save_as_floats) { return save_binary_data (os, make_value (), value_save_tag, "", false, save_as_floats); } -bool octave_lazy_index::load_binary (std::istream& is, bool swap, - octave::mach_info::float_format fmt) +bool +octave_lazy_index::load_binary (std::istream& is, bool swap, + octave::mach_info::float_format fmt) { bool dummy; std::string doc;
--- a/libinterp/octave-value/ov-range.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave-value/ov-range.cc Tue Dec 12 18:24:05 2023 -0800 @@ -979,7 +979,7 @@ } DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_trivial_range, - "trivial range", "double"); + "trivial range", "double"); template <typename T> bool
--- a/libinterp/octave-value/ov-range.h Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave-value/ov-range.h Tue Dec 12 18:24:05 2023 -0800 @@ -57,7 +57,7 @@ public: octave_trivial_range (octave_idx_type numel, int base, int incr) - : m_numel (numel), m_base (base), m_increment(incr) { } + : m_numel (numel), m_base (base), m_increment(incr) { } octave_trivial_range () {};
--- a/libinterp/octave-value/ov-typeinfo.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave-value/ov-typeinfo.cc Tue Dec 12 18:24:05 2023 -0800 @@ -45,7 +45,8 @@ // FIXME: we should also store all class names and provide a // way to list them (calling class with nargin == 0?). -static NDArray as_nd_array (const Array<int>& x) +static NDArray +as_nd_array (const Array<int>& x) { NDArray retval (x.dims ()); @@ -55,7 +56,8 @@ return retval; } -static boolNDArray as_bool_nd_array (const Array<void *>& x) +static boolNDArray +as_bool_nd_array (const Array<void *>& x) { boolNDArray retval (x.dims ()); @@ -87,10 +89,11 @@ install_ops (*this); } -int type_info::register_type (const std::string& t_name, - const std::string& /* c_name */, - const octave_value& val, - bool abort_on_duplicate) +int +type_info::register_type (const std::string& t_name, + const std::string& /* c_name */, + const octave_value& val, + bool abort_on_duplicate) { int i = 0; @@ -161,9 +164,10 @@ return i; } -bool type_info::register_unary_class_op (octave_value::unary_op op, - type_info::unary_class_op_fcn f, - bool abort_on_duplicate) +bool +type_info::register_unary_class_op (octave_value::unary_op op, + type_info::unary_class_op_fcn f, + bool abort_on_duplicate) { if (lookup_unary_class_op (op)) { @@ -186,8 +190,9 @@ return false; } -bool type_info::register_unary_op (octave_value::unary_op op, int t, - unary_op_fcn f, bool abort_on_duplicate) +bool +type_info::register_unary_op (octave_value::unary_op op, int t, + unary_op_fcn f, bool abort_on_duplicate) { if (lookup_unary_op (op, t)) { @@ -264,10 +269,11 @@ return false; } -bool type_info::register_binary_op (octave_value::binary_op op, - int t1, int t2, - type_info::binary_op_fcn f, - bool abort_on_duplicate) +bool +type_info::register_binary_op (octave_value::binary_op op, + int t1, int t2, + type_info::binary_op_fcn f, + bool abort_on_duplicate) { if (lookup_binary_op (op, t1, t2)) { @@ -319,10 +325,11 @@ return false; } -bool type_info::register_binary_op (octave_value::compound_binary_op op, - int t1, int t2, - type_info::binary_op_fcn f, - bool abort_on_duplicate) +bool +type_info::register_binary_op (octave_value::compound_binary_op op, + int t1, int t2, + type_info::binary_op_fcn f, + bool abort_on_duplicate) { if (lookup_binary_op (op, t1, t2)) { @@ -348,8 +355,9 @@ return false; } -bool type_info::register_cat_op (int t1, int t2, type_info::cat_op_fcn f, - bool abort_on_duplicate) +bool +type_info::register_cat_op (int t1, int t2, type_info::cat_op_fcn f, + bool abort_on_duplicate) { if (lookup_cat_op (t1, t2)) { @@ -372,10 +380,11 @@ return false; } -bool type_info::register_assign_op (octave_value::assign_op op, - int t_lhs, int t_rhs, - type_info::assign_op_fcn f, - bool abort_on_duplicate) +bool +type_info::register_assign_op (octave_value::assign_op op, + int t_lhs, int t_rhs, + type_info::assign_op_fcn f, + bool abort_on_duplicate) { if (lookup_assign_op (op, t_lhs, t_rhs)) { @@ -401,9 +410,10 @@ return false; } -bool type_info::register_assignany_op (octave_value::assign_op op, int t_lhs, - type_info::assignany_op_fcn f, - bool abort_on_duplicate) +bool +type_info::register_assignany_op (octave_value::assign_op op, int t_lhs, + type_info::assignany_op_fcn f, + bool abort_on_duplicate) { if (lookup_assignany_op (op, t_lhs)) { @@ -427,9 +437,10 @@ return false; } -bool type_info::register_pref_assign_conv (int t_lhs, int t_rhs, - int t_result, - bool abort_on_duplicate) +bool +type_info::register_pref_assign_conv (int t_lhs, int t_rhs, + int t_result, + bool abort_on_duplicate) { if (lookup_pref_assign_conv (t_lhs, t_rhs) >= 0) { @@ -453,9 +464,10 @@ return false; } -bool type_info::register_widening_op (int t, int t_result, - octave_base_value::type_conv_fcn f, - bool abort_on_duplicate) +bool +type_info::register_widening_op (int t, int t_result, + octave_base_value::type_conv_fcn f, + bool abort_on_duplicate) { if (lookup_widening_op (t, t_result)) { @@ -478,7 +490,8 @@ return false; } -octave_value type_info::lookup_type (const std::string& nm) +octave_value +type_info::lookup_type (const std::string& nm) { octave_value retval; @@ -776,21 +789,24 @@ return type_info.register_type (t_name, c_name, val); } -octave_value lookup_type (const std::string& nm) +octave_value +lookup_type (const std::string& nm) { octave::type_info& type_info = octave::__get_type_info__ (); return type_info.lookup_type (nm); } -unary_class_op_fcn lookup_unary_class_op (octave_value::unary_op op) +unary_class_op_fcn +lookup_unary_class_op (octave_value::unary_op op) { octave::type_info& type_info = octave::__get_type_info__ (); return type_info.lookup_unary_class_op (op); } -unary_op_fcn lookup_unary_op (octave_value::unary_op op, int t) +unary_op_fcn +lookup_unary_op (octave_value::unary_op op, int t) { octave::type_info& type_info = octave::__get_type_info__ (); @@ -837,7 +853,8 @@ return type_info.lookup_binary_op (op, t1, t2); } -cat_op_fcn lookup_cat_op (int t1, int t2) +cat_op_fcn +lookup_cat_op (int t1, int t2) { octave::type_info& type_info = octave::__get_type_info__ (); @@ -860,7 +877,8 @@ return type_info.lookup_assignany_op (op, t_lhs); } -int lookup_pref_assign_conv (int t_lhs, int t_rhs) +int +lookup_pref_assign_conv (int t_lhs, int t_rhs) { octave::type_info& type_info = octave::__get_type_info__ (); @@ -875,14 +893,16 @@ return type_info.lookup_widening_op (t, t_result); } -string_vector installed_type_names () +string_vector +installed_type_names () { octave::type_info& type_info = octave::__get_type_info__ (); return type_info.installed_type_names (); } -octave_scalar_map installed_type_info () +octave_scalar_map +installed_type_info () { octave::type_info& type_info = octave::__get_type_info__ ();
--- a/libinterp/octave-value/ov-usr-fcn.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave-value/ov-usr-fcn.cc Tue Dec 12 18:24:05 2023 -0800 @@ -886,7 +886,8 @@ "optimize_subsasgn_calls"); } -static bool val_in_table (const Matrix& table, double val) +static bool +val_in_table (const Matrix& table, double val) { if (table.isempty ()) return false; @@ -895,7 +896,8 @@ return (i > 0 && table(i-1) == val); } -static bool isargout1 (int nargout, const Matrix& ignored, double k) +static bool +isargout1 (int nargout, const Matrix& ignored, double k) { if (k != math::fix (k) || k <= 0) error ("isargout: K must be a positive integer");
--- a/libinterp/octave-value/ov.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave-value/ov.cc Tue Dec 12 18:24:05 2023 -0800 @@ -2242,7 +2242,8 @@ m_rep->print_info (os, prefix + ' '); } -bool octave_value::load_ascii (std::istream& is) +bool +octave_value::load_ascii (std::istream& is) { bool status = m_rep->load_ascii (is); @@ -2252,8 +2253,9 @@ return status; } -bool octave_value::load_binary (std::istream& is, bool swap, - octave::mach_info::float_format fmt) +bool +octave_value::load_binary (std::istream& is, bool swap, + octave::mach_info::float_format fmt) { bool status = m_rep->load_binary (is, swap, fmt); @@ -2264,7 +2266,8 @@ return status; } -bool octave_value::load_hdf5 (octave_hdf5_id loc_id, const char *name) +bool +octave_value::load_hdf5 (octave_hdf5_id loc_id, const char *name) { bool status = m_rep->load_hdf5 (loc_id, name);
--- a/libinterp/octave.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/octave.cc Tue Dec 12 18:24:05 2023 -0800 @@ -239,7 +239,8 @@ argc-octave_optind_wrapper ()); } -octave_value cmdline_options::as_octave_value () const +octave_value +cmdline_options::as_octave_value () const { octave_scalar_map m; @@ -324,25 +325,29 @@ } } -bool application::forced_interactive () +bool +application::forced_interactive () { return s_instance ? s_instance->m_options.forced_interactive () : false; } // Provided for convenience. Will be removed once we eliminate the // old terminal widget. -bool application::experimental_terminal_widget () const +bool +application::experimental_terminal_widget () const { return (s_instance ? s_instance->m_options.experimental_terminal_widget () : false); } -bool application::interpreter_initialized () +bool +application::interpreter_initialized () { return m_interpreter ? m_interpreter->initialized () : false; } -interpreter& application::create_interpreter () +interpreter& +application::create_interpreter () { if (! m_interpreter) m_interpreter = std::unique_ptr<interpreter> (new interpreter (this)); @@ -350,23 +355,27 @@ return *m_interpreter; } -void application::initialize_interpreter () +void +application::initialize_interpreter () { if (m_interpreter) m_interpreter->initialize (); } -int application::execute_interpreter () +int +application::execute_interpreter () { return m_interpreter ? m_interpreter->execute () : -1; } -void application::delete_interpreter () +void +application::delete_interpreter () { m_interpreter.reset (); } -void application::init () +void +application::init () { if (s_instance) throw std::runtime_error @@ -420,7 +429,8 @@ sysdep_init (); } -int cli_application::execute () +int +cli_application::execute () { interpreter& interp = create_interpreter ();
--- a/libinterp/parse-tree/anon-fcn-validator.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/parse-tree/anon-fcn-validator.cc Tue Dec 12 18:24:05 2023 -0800 @@ -42,7 +42,8 @@ expr->accept (*this); } -void anon_fcn_validator::visit_postfix_expression (tree_postfix_expression& expr) +void +anon_fcn_validator::visit_postfix_expression (tree_postfix_expression& expr) { octave_value::unary_op op = expr.op_type (); @@ -52,7 +53,8 @@ tree_walker::visit_postfix_expression (expr); } -void anon_fcn_validator::visit_prefix_expression (tree_prefix_expression& expr) +void +anon_fcn_validator::visit_prefix_expression (tree_prefix_expression& expr) { octave_value::unary_op op = expr.op_type (); @@ -62,17 +64,20 @@ tree_walker::visit_prefix_expression (expr); } -void anon_fcn_validator::visit_multi_assignment (tree_multi_assignment& expr) +void +anon_fcn_validator::visit_multi_assignment (tree_multi_assignment& expr) { error (expr); } -void anon_fcn_validator::visit_simple_assignment (tree_simple_assignment& expr) +void +anon_fcn_validator::visit_simple_assignment (tree_simple_assignment& expr) { error (expr); } -void anon_fcn_validator::error (tree_expression& expr) +void +anon_fcn_validator::error (tree_expression& expr) { m_ok = false; m_line = expr.line ();
--- a/libinterp/parse-tree/bp-table.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/parse-tree/bp-table.cc Tue Dec 12 18:24:05 2023 -0800 @@ -116,7 +116,8 @@ // Clear all reasons to stop, other than breakpoints. -void bp_table::dbclear_all_signals () +void +bp_table::dbclear_all_signals () { interpreter& interp = m_evaluator.get_interpreter (); error_system& es = interp.get_error_system (); @@ -136,7 +137,8 @@ // Process the "warn", "errs", "caught" and "intr" fields for a call of // "dbstop (p)". -void bp_table::dbstop_process_map_args (const octave_map& mv) +void +bp_table::dbstop_process_map_args (const octave_map& mv) { interpreter& interp = m_evaluator.get_interpreter (); error_system& es = interp.get_error_system (); @@ -231,11 +233,12 @@ // to stop only when condition is true. // Record in m_bp_set that fname contains a breakpoint. -bool bp_table::add_breakpoint_1 (octave_user_code *fcn, - const std::string& fcn_ident, - const bp_table::bp_lines& line, - const std::string& condition, - bp_table::bp_lines& retval) +bool +bp_table::add_breakpoint_1 (octave_user_code *fcn, + const std::string& fcn_ident, + const bp_table::bp_lines& line, + const std::string& condition, + bp_table::bp_lines& retval) { bool found = false; @@ -279,7 +282,8 @@ // it is odd that the former is not flagged by "is_assignment_expression". // Throws an exception if not valid. -bool bp_table::condition_valid (const std::string& cond) +bool +bp_table::condition_valid (const std::string& cond) { if (cond.length () > 0) { @@ -339,12 +343,13 @@ // be a class name. Otherwise it should be a function name. // Also execute "if [error|warning|interrupt|naninf]" clauses. -void bp_table::parse_dbfunction_params (const char *who, - const octave_value_list& args, - std::string& fcn_name, - std::string& class_name, - bp_table::bp_lines& lines, - std::string& cond) +void +bp_table::parse_dbfunction_params (const char *who, + const octave_value_list& args, + std::string& fcn_name, + std::string& class_name, + bp_table::bp_lines& lines, + std::string& cond) { int nargin = args.length (); fcn_name = ""; @@ -552,8 +557,9 @@ %! assert (s.errs, {"Octave:undefined-function"}); */ -void bp_table::set_stop_flag (const char *who, const std::string& condition, - bool on_off) +void +bp_table::set_stop_flag (const char *who, const std::string& condition, + bool on_off) { interpreter& interp = m_evaluator.get_interpreter (); error_system& es = interp.get_error_system (); @@ -568,11 +574,12 @@ error ("%s: internal error in set_stop_flag", who); } -void bp_table::process_id_list (const char *who, - const std::string& condition, - const octave_value_list& args, - int nargin, int& pos, bool on_off, - std::set<std::string>& id_list) +void +bp_table::process_id_list (const char *who, + const std::string& condition, + const octave_value_list& args, + int nargin, int& pos, bool on_off, + std::set<std::string>& id_list) { pos++; @@ -609,9 +616,10 @@ // line number LINENO of the source file. // If END_LINE != 0, *END_LINE is set to last line of the returned function. -static octave_user_code * find_fcn_by_line (octave_user_code *main_fcn, - int lineno, - int *end_line = nullptr) +static octave_user_code * +find_fcn_by_line (octave_user_code *main_fcn, + int lineno, + int *end_line = nullptr) { octave_user_code *retval = nullptr; octave_user_code *next_fcn = nullptr; // 1st function starting after lineno @@ -671,9 +679,10 @@ // Given function identifier fcn_ident, find the subfunction at line and create // a breakpoint there. Put the system into debug_mode. -int bp_table::add_breakpoint_in_function (const std::string& fcn_ident, - int line, - const std::string& condition) +int +bp_table::add_breakpoint_in_function (const std::string& fcn_ident, + int line, + const std::string& condition) { bp_lines line_info; line_info.insert (line); @@ -692,7 +701,7 @@ { public: user_code_provider (const std::string& who, const std::string& fcn_ident, - octave_user_code* pfcn, bool silent = false) + octave_user_code *pfcn, bool silent = false) : m_fcn (nullptr), m_is_valid (false) { m_fcn = pfcn; @@ -837,9 +846,10 @@ return retval; } -int bp_table::add_breakpoint_in_file (const std::string& file, - int line, - const std::string& condition) +int +bp_table::add_breakpoint_in_file (const std::string& file, + int line, + const std::string& condition) { // Duplicates what the GUI was doing previously, but this action // should not be specific to the GUI. @@ -880,9 +890,10 @@ return add_breakpoints_in_function (fcn_ident, lines, condition); } -int bp_table::remove_breakpoint_1 (octave_user_code *fcn, - const std::string& fcn_ident, - const bp_table::bp_lines& lines) +int +bp_table::remove_breakpoint_1 (octave_user_code *fcn, + const std::string& fcn_ident, + const bp_table::bp_lines& lines) { int retval = 0; @@ -1096,7 +1107,8 @@ return remove_all_breakpoints_from_function (info.fcn (), silent); } -void bp_table::remove_all_breakpoints () +void +bp_table::remove_all_breakpoints () { // Odd loop structure required because delete will invalidate // m_bp_set iterators. @@ -1111,7 +1123,8 @@ m_evaluator.reset_debug_state (); } -std::string find_bkpt_list (octave_value_list slist, std::string match) +std::string +find_bkpt_list (octave_value_list slist, std::string match) { std::string retval; @@ -1158,7 +1171,7 @@ { const std::list<bp_type>& bp = cmds->breakpoints_and_conds (); - if(!bp.empty()) + if (!bp.empty()) it = all_bkpts.insert (it, bp.cbegin (), bp.cend ()); } @@ -1218,7 +1231,8 @@ // "errs" field will have a row per ID. If dbstop if error is false, there // is no "errs" field. The "warn" field is set similarly by dbstop if warning -octave_map bp_table::stop_on_err_warn_status (bool to_screen) +octave_map +bp_table::stop_on_err_warn_status (bool to_screen) { octave_map retval;
--- a/libinterp/parse-tree/oct-lvalue.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/parse-tree/oct-lvalue.cc Tue Dec 12 18:24:05 2023 -0800 @@ -42,24 +42,28 @@ return ! is_black_hole () && m_frame->is_defined (m_sym); } -bool octave_lvalue::is_undefined () const +bool +octave_lvalue::is_undefined () const { return ! is_defined (); } -void octave_lvalue::define (const octave_value& v) +void +octave_lvalue::define (const octave_value& v) { m_frame->assign (m_sym, v); } -void octave_lvalue::assign (octave_value::assign_op op, - const octave_value& rhs) +void +octave_lvalue::assign (octave_value::assign_op op, + const octave_value& rhs) { if (! is_black_hole ()) m_frame->assign (op, m_sym, m_type, m_idx, rhs); } -octave_idx_type octave_lvalue::numel () const +octave_idx_type +octave_lvalue::numel () const { // Return 1 if there is no index because without an index there // should be no way to have a cs-list here. Cs-lists may be passed @@ -168,8 +172,9 @@ } } -void octave_lvalue::set_index (const std::string& t, - const std::list<octave_value_list>& i) +void +octave_lvalue::set_index (const std::string& t, + const std::list<octave_value_list>& i) { if (! m_idx.empty ()) error ("invalid index expression in assignment"); @@ -178,7 +183,8 @@ m_idx = i; } -bool octave_lvalue::index_is_empty () const +bool +octave_lvalue::index_is_empty () const { bool retval = false; @@ -192,7 +198,8 @@ return retval; } -bool octave_lvalue::index_is_colon () const +bool +octave_lvalue::index_is_colon () const { bool retval = false; @@ -206,13 +213,15 @@ return retval; } -void octave_lvalue::unary_op (octave_value::unary_op op) +void +octave_lvalue::unary_op (octave_value::unary_op op) { if (! is_black_hole ()) m_frame->non_const_unary_op (op, m_sym, m_type, m_idx); } -octave_value octave_lvalue::value () const +octave_value +octave_lvalue::value () const { return (is_black_hole () ? octave_value () : m_frame->value (m_sym, m_type, m_idx));
--- a/libinterp/parse-tree/pt-classdef.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/parse-tree/pt-classdef.cc Tue Dec 12 18:24:05 2023 -0800 @@ -121,7 +121,8 @@ // Classdef property -std::string check_for_doc_string (comment_list *comments) +std::string +check_for_doc_string (comment_list *comments) { // If the comment list ends in a block comment or full-line comment, // then it is the doc string for this property. @@ -149,14 +150,16 @@ delete m_comments; } -tree_identifier *tree_classdef_property::ident () +tree_identifier * +tree_classdef_property::ident () { tree_expression *id_expr = m_av->identifier_expression (); return dynamic_cast<tree_identifier *> (id_expr); } -tree_expression *tree_classdef_property::expression () +tree_expression * +tree_classdef_property::expression () { return m_av->initializer_expression (); }
--- a/libinterp/parse-tree/pt-colon.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/parse-tree/pt-colon.cc Tue Dec 12 18:24:05 2023 -0800 @@ -51,7 +51,8 @@ return new_ce; } -octave_value tree_colon_expression::evaluate (tree_evaluator& tw, int) +octave_value +tree_colon_expression::evaluate (tree_evaluator& tw, int) { octave_value val;
--- a/libinterp/parse-tree/pt-eval.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/parse-tree/pt-eval.cc Tue Dec 12 18:24:05 2023 -0800 @@ -144,7 +144,8 @@ // with the corresponding tree_evaluator functions or do they need to // remain separate? They perform nearly the same functions. -int debugger::server_loop () +int +debugger::server_loop () { // Process events from the event queue. @@ -257,7 +258,8 @@ return exit_status; } -void debugger::repl (const std::string& prompt_arg) +void +debugger::repl (const std::string& prompt_arg) { unwind_protect frame; @@ -503,7 +505,8 @@ } } -bool debugger::quitting_debugger () const +bool +debugger::quitting_debugger () const { if (m_execution_mode == EX_QUIT) { @@ -531,7 +534,8 @@ return false; } -bool tree_evaluator::at_top_level () const +bool +tree_evaluator::at_top_level () const { return m_call_stack.at_top_level (); } @@ -572,8 +576,9 @@ return fname; } -void tree_evaluator::parse_and_execute (const std::string& input, - bool& incomplete_parse) +void +tree_evaluator::parse_and_execute (const std::string& input, + bool& incomplete_parse) { incomplete_parse = false; @@ -636,7 +641,8 @@ evmgr.pre_input_event (); } -void tree_evaluator::get_line_and_eval () +void +tree_evaluator::get_line_and_eval () { std::mutex mtx; std::unique_lock<std::mutex> lock (mtx); @@ -728,7 +734,8 @@ } } -int tree_evaluator::repl () +int +tree_evaluator::repl () { // The big loop. Read, Eval, Print, Loop. Normally user // interaction at the command line in a terminal session, but we may @@ -869,7 +876,8 @@ return exit_status; } -int tree_evaluator::server_loop () +int +tree_evaluator::server_loop () { // Process events from the event queue. @@ -977,8 +985,9 @@ return m_exit_status; } -void tree_evaluator::eval (std::shared_ptr<tree_statement_list>& stmt_list, - bool interactive) +void +tree_evaluator::eval (std::shared_ptr<tree_statement_list>& stmt_list, + bool interactive) { try { @@ -1082,8 +1091,9 @@ return retval; } -octave_value tree_evaluator::eval_string (const std::string& eval_str, - bool silent, int& parse_status) +octave_value +tree_evaluator::eval_string (const std::string& eval_str, + bool silent, int& parse_status) { octave_value retval; @@ -1095,26 +1105,29 @@ return retval; } -octave_value_list tree_evaluator::eval_string (const octave_value& arg, - bool silent, int& parse_status, - int nargout) +octave_value_list +tree_evaluator::eval_string (const octave_value& arg, + bool silent, int& parse_status, + int nargout) { std::string s = arg.xstring_value ("eval: expecting string argument"); return eval_string (s, silent, parse_status, nargout); } -octave_value_list tree_evaluator::eval (const std::string& try_code, - int nargout) +octave_value_list +tree_evaluator::eval (const std::string& try_code, + int nargout) { int parse_status = 0; return eval_string (try_code, nargout > 0, parse_status, nargout); } -octave_value_list tree_evaluator::eval (const std::string& try_code, - const std::string& catch_code, - int nargout) +octave_value_list +tree_evaluator::eval (const std::string& try_code, + const std::string& catch_code, + int nargout) { octave_value_list retval; @@ -1159,9 +1172,10 @@ return retval; } -octave_value_list tree_evaluator::evalin (const std::string& context, - const std::string& try_code, - int nargout) +octave_value_list +tree_evaluator::evalin (const std::string& context, + const std::string& try_code, + int nargout) { unwind_action act ([=] (std::size_t frm) { @@ -1180,10 +1194,11 @@ return eval_string (try_code, nargout > 0, parse_status, nargout); } -octave_value_list tree_evaluator::evalin (const std::string& context, - const std::string& try_code, - const std::string& catch_code, - int nargout) +octave_value_list +tree_evaluator::evalin (const std::string& context, + const std::string& try_code, + const std::string& catch_code, + int nargout) { octave_value_list retval; @@ -1908,7 +1923,8 @@ return frame->is_defined (sym); } -bool tree_evaluator::is_global (const std::string& name) const +bool +tree_evaluator::is_global (const std::string& name) const { std::shared_ptr<stack_frame> frame = m_call_stack.get_current_stack_frame (); @@ -1934,9 +1950,10 @@ return frame->varval (name); } -void tree_evaluator::install_variable (const std::string& name, - const octave_value& value, - bool global) +void +tree_evaluator::install_variable (const std::string& name, + const octave_value& value, + bool global) { std::shared_ptr<stack_frame> frame = m_call_stack.get_current_stack_frame (); @@ -2241,7 +2258,7 @@ // END is documented in op-kw-docs. DEFMETHOD (end, interp, args, , - doc: /* -*- texinfo -*- + doc: /* -*- texinfo -*- @deftypefn {} {} end Last element of an array or the end of any @code{for}, @code{parfor}, @code{if}, @code{do}, @code{while}, @code{function}, @code{switch}, @@ -2266,9 +2283,9 @@ @seealso{for, parfor, if, do, while, function, switch, try, unwind_protect} @end deftypefn */) { -tree_evaluator& tw = interp.get_evaluator (); - -return tw.evaluate_end_expression (args); + tree_evaluator& tw = interp.get_evaluator (); + + return tw.evaluate_end_expression (args); } /* @@ -2433,35 +2450,41 @@ return false; } -void tree_evaluator::push_stack_frame (const symbol_scope& scope) +void +tree_evaluator::push_stack_frame (const symbol_scope& scope) { m_call_stack.push (scope); } -void tree_evaluator::push_stack_frame (octave_user_function *fcn, - const std::shared_ptr<stack_frame>& closure_frames) +void +tree_evaluator::push_stack_frame (octave_user_function *fcn, + const std::shared_ptr<stack_frame>& closure_frames) { m_call_stack.push (fcn, closure_frames); } -void tree_evaluator::push_stack_frame (octave_user_function *fcn, - const stack_frame::local_vars_map& local_vars, - const std::shared_ptr<stack_frame>& closure_frames) +void +tree_evaluator::push_stack_frame (octave_user_function *fcn, + const stack_frame::local_vars_map& local_vars, + const std::shared_ptr<stack_frame>& closure_frames) { m_call_stack.push (fcn, local_vars, closure_frames); } -void tree_evaluator::push_stack_frame (octave_user_script *script) +void +tree_evaluator::push_stack_frame (octave_user_script *script) { m_call_stack.push (script); } -void tree_evaluator::push_stack_frame (octave_function *fcn) +void +tree_evaluator::push_stack_frame (octave_function *fcn) { m_call_stack.push (fcn); } -void tree_evaluator::pop_stack_frame () +void +tree_evaluator::pop_stack_frame () { m_call_stack.pop (); } @@ -2472,84 +2495,100 @@ return m_call_stack.pop_return (); } -int tree_evaluator::current_line () const +int +tree_evaluator::current_line () const { return m_call_stack.current_line (); } -int tree_evaluator::current_column () const +int +tree_evaluator::current_column () const { return m_call_stack.current_column (); } -int tree_evaluator::debug_user_code_line () const +int +tree_evaluator::debug_user_code_line () const { return m_call_stack.debug_user_code_line (); } -int tree_evaluator::debug_user_code_column () const +int +tree_evaluator::debug_user_code_column () const { return m_call_stack.debug_user_code_column (); } -void tree_evaluator::debug_where (std::ostream& os) const +void +tree_evaluator::debug_where (std::ostream& os) const { std::shared_ptr<stack_frame> frm = m_call_stack.current_user_frame (); frm->display_stopped_in_message (os); } -octave_user_code * tree_evaluator::current_user_code () const +octave_user_code * +tree_evaluator::current_user_code () const { return m_call_stack.current_user_code (); } -unwind_protect * tree_evaluator::curr_fcn_unwind_protect_frame () +unwind_protect * +tree_evaluator::curr_fcn_unwind_protect_frame () { return m_call_stack.curr_fcn_unwind_protect_frame (); } -octave_user_code * tree_evaluator::debug_user_code () const +octave_user_code * +tree_evaluator::debug_user_code () const { return m_call_stack.debug_user_code (); } -octave_function * tree_evaluator::current_function (bool skip_first) const +octave_function * +tree_evaluator::current_function (bool skip_first) const { return m_call_stack.current_function (skip_first); } -octave_function * tree_evaluator::caller_function () const +octave_function * +tree_evaluator::caller_function () const { return m_call_stack.current_function (true); } -bool tree_evaluator::goto_frame (std::size_t n, bool verbose) +bool +tree_evaluator::goto_frame (std::size_t n, bool verbose) { return m_call_stack.goto_frame (n, verbose); } -void tree_evaluator::goto_caller_frame () +void +tree_evaluator::goto_caller_frame () { m_call_stack.goto_caller_frame (); } -void tree_evaluator::goto_base_frame () +void +tree_evaluator::goto_base_frame () { m_call_stack.goto_base_frame (); } -void tree_evaluator::restore_frame (std::size_t n) +void +tree_evaluator::restore_frame (std::size_t n) { return m_call_stack.restore_frame (n); } -std::string tree_evaluator::get_dispatch_class () const +std::string +tree_evaluator::get_dispatch_class () const { return m_call_stack.get_dispatch_class (); } -void tree_evaluator::set_dispatch_class (const std::string& class_name) +void +tree_evaluator::set_dispatch_class (const std::string& class_name) { m_call_stack.set_dispatch_class (class_name); } @@ -2585,7 +2624,8 @@ return m_call_stack.backtrace_info (curr_user_frame, print_subfn); } -std::list<frame_info> tree_evaluator::backtrace_info () const +std::list<frame_info> +tree_evaluator::backtrace_info () const { return m_call_stack.backtrace_info (); } @@ -2597,17 +2637,20 @@ return m_call_stack.backtrace (curr_user_frame, print_subfn); } -octave_map tree_evaluator::backtrace () const +octave_map +tree_evaluator::backtrace () const { return m_call_stack.backtrace (); } -octave_map tree_evaluator::empty_backtrace () const +octave_map +tree_evaluator::empty_backtrace () const { return m_call_stack.empty_backtrace (); } -std::string tree_evaluator::backtrace_message () const +std::string +tree_evaluator::backtrace_message () const { std::list<frame_info> frames = backtrace_info (); @@ -2635,29 +2678,34 @@ return buf.str (); } -void tree_evaluator::push_dummy_scope (const std::string& name) +void +tree_evaluator::push_dummy_scope (const std::string& name) { symbol_scope dummy_scope (name + "$dummy"); m_call_stack.push (dummy_scope); } -void tree_evaluator::pop_scope () +void +tree_evaluator::pop_scope () { m_call_stack.pop (); } -symbol_scope tree_evaluator::get_top_scope () const +symbol_scope +tree_evaluator::get_top_scope () const { return m_call_stack.top_scope (); } -symbol_scope tree_evaluator::get_current_scope () const +symbol_scope +tree_evaluator::get_current_scope () const { return m_call_stack.current_scope (); } -void tree_evaluator::mlock (bool skip_first) const +void +tree_evaluator::mlock (bool skip_first) const { octave_function *fcn = m_call_stack.current_function (skip_first); @@ -2673,7 +2721,8 @@ fcn->lock (); } -void tree_evaluator::munlock (bool skip_first) const +void +tree_evaluator::munlock (bool skip_first) const { octave_function *fcn = m_call_stack.current_function (skip_first); @@ -2689,7 +2738,8 @@ fcn->unlock (); } -bool tree_evaluator::mislocked (bool skip_first) const +bool +tree_evaluator::mislocked (bool skip_first) const { octave_function *fcn = m_call_stack.current_function (skip_first); @@ -2705,12 +2755,14 @@ return m_call_stack.max_stack_depth (args, nargout); } -void tree_evaluator::display_call_stack () const +void +tree_evaluator::display_call_stack () const { m_call_stack.display (); } -octave_value tree_evaluator::find (const std::string& name) +octave_value +tree_evaluator::find (const std::string& name) { std::shared_ptr<stack_frame> frame = m_call_stack.get_current_stack_frame (); @@ -2734,7 +2786,8 @@ return symtab.fcn_table_find (name, ovl ()); } -void tree_evaluator::clear_objects () +void +tree_evaluator::clear_objects () { std::shared_ptr<stack_frame> frame = m_call_stack.get_current_stack_frame (); @@ -2742,7 +2795,8 @@ frame->clear_objects (); } -void tree_evaluator::clear_variable (const std::string& name) +void +tree_evaluator::clear_variable (const std::string& name) { std::shared_ptr<stack_frame> frame = m_call_stack.get_current_stack_frame (); @@ -2750,7 +2804,8 @@ frame->clear_variable (name); } -void tree_evaluator::clear_variable_pattern (const std::string& pattern) +void +tree_evaluator::clear_variable_pattern (const std::string& pattern) { std::shared_ptr<stack_frame> frame = m_call_stack.get_current_stack_frame (); @@ -2758,7 +2813,8 @@ frame->clear_variable_pattern (pattern); } -void tree_evaluator::clear_variable_regexp (const std::string& pattern) +void +tree_evaluator::clear_variable_regexp (const std::string& pattern) { std::shared_ptr<stack_frame> frame = m_call_stack.get_current_stack_frame (); @@ -2766,7 +2822,8 @@ frame->clear_variable_regexp (pattern); } -void tree_evaluator::clear_variables () +void +tree_evaluator::clear_variables () { std::shared_ptr<stack_frame> frame = m_call_stack.get_current_stack_frame (); @@ -2774,7 +2831,8 @@ frame->clear_variables (); } -void tree_evaluator::clear_global_variable (const std::string& name) +void +tree_evaluator::clear_global_variable (const std::string& name) { m_call_stack.clear_global_variable (name); } @@ -2785,17 +2843,20 @@ m_call_stack.clear_global_variable_pattern (pattern); } -void tree_evaluator::clear_global_variable_regexp(const std::string& pattern) +void +tree_evaluator::clear_global_variable_regexp(const std::string& pattern) { m_call_stack.clear_global_variable_regexp (pattern); } -void tree_evaluator::clear_global_variables () +void +tree_evaluator::clear_global_variables () { m_call_stack.clear_global_variables (); } -void tree_evaluator::clear_all (bool force) +void +tree_evaluator::clear_all (bool force) { // FIXME: should this also clear objects? @@ -2807,7 +2868,8 @@ symtab.clear_functions (force); } -void tree_evaluator::clear_symbol (const std::string& name) +void +tree_evaluator::clear_symbol (const std::string& name) { // FIXME: are we supposed to do both here? @@ -2818,7 +2880,8 @@ symtab.clear_function (name); } -void tree_evaluator::clear_symbol_pattern (const std::string& pattern) +void +tree_evaluator::clear_symbol_pattern (const std::string& pattern) { // FIXME: are we supposed to do both here? @@ -2829,7 +2892,8 @@ symtab.clear_function_pattern (pattern); } -void tree_evaluator::clear_symbol_regexp (const std::string& pattern) +void +tree_evaluator::clear_symbol_regexp (const std::string& pattern) { // FIXME: are we supposed to do both here? @@ -2840,17 +2904,20 @@ symtab.clear_function_regexp (pattern); } -std::list<std::string> tree_evaluator::global_variable_names () const +std::list<std::string> +tree_evaluator::global_variable_names () const { return m_call_stack.global_variable_names (); } -std::list<std::string> tree_evaluator::top_level_variable_names () const +std::list<std::string> +tree_evaluator::top_level_variable_names () const { return m_call_stack.top_level_variable_names (); } -std::list<std::string> tree_evaluator::variable_names () const +std::list<std::string> +tree_evaluator::variable_names () const { return m_call_stack.variable_names (); } @@ -3257,7 +3324,8 @@ } } -void tree_evaluator::visit_spmd_command (tree_spmd_command& cmd) +void +tree_evaluator::visit_spmd_command (tree_spmd_command& cmd) { // For now, we just execute the commands serially. @@ -4371,7 +4439,8 @@ panic_impossible (); } -void tree_evaluator::bind_ans (const octave_value& val, bool print) +void +tree_evaluator::bind_ans (const octave_value& val, bool print) { static std::string ans = "ans"; @@ -4536,7 +4605,8 @@ return m_call_stack.top_scope_symbol_info (); } -octave_map tree_evaluator::get_autoload_map () const +octave_map +tree_evaluator::get_autoload_map () const { Cell fcn_names (dim_vector (m_autoload_map.size (), 1)); Cell file_names (dim_vector (m_autoload_map.size (), 1)); @@ -4558,7 +4628,8 @@ return m; } -std::string tree_evaluator::lookup_autoload (const std::string& nm) const +std::string +tree_evaluator::lookup_autoload (const std::string& nm) const { std::string retval; @@ -4574,7 +4645,8 @@ return retval; } -std::list<std::string> tree_evaluator::autoloaded_functions () const +std::list<std::string> +tree_evaluator::autoloaded_functions () const { std::list<std::string> names; @@ -4596,14 +4668,16 @@ return names; } -void tree_evaluator::add_autoload (const std::string& fcn, - const std::string& nm) +void +tree_evaluator::add_autoload (const std::string& fcn, + const std::string& nm) { m_autoload_map[fcn] = check_autoload_file (nm); } -void tree_evaluator::remove_autoload (const std::string& fcn, - const std::string& nm) +void +tree_evaluator::remove_autoload (const std::string& fcn, + const std::string& nm) { check_autoload_file (nm); @@ -4640,8 +4714,9 @@ // variable being indexed, if any, then issue an error. (Will this also // be needed by pt-lvalue, which calls subsref?) -void tree_evaluator::final_index_error (index_exception& ie, - const tree_expression *expr) +void +tree_evaluator::final_index_error (index_exception& ie, + const tree_expression *expr) { std::string extra_message; @@ -4810,7 +4885,8 @@ m_echo_state, m_echo_file_name, m_echo_file_pos); } -bool tree_evaluator::maybe_push_echo_state_cleanup () +bool +tree_evaluator::maybe_push_echo_state_cleanup () { // This function is expected to be called from ECHO, which would be // the top of the call stack. If the caller of ECHO is a @@ -4957,19 +5033,22 @@ return octave_value (); } -bool tree_evaluator::in_debug_repl () const +bool +tree_evaluator::in_debug_repl () const { return (m_debugger_stack.empty () ? false : m_debugger_stack.top()->in_debug_repl ()); } -void tree_evaluator::dbcont () +void +tree_evaluator::dbcont () { if (! m_debugger_stack.empty ()) m_debugger_stack.top()->dbcont (); } -void tree_evaluator::dbquit (bool all) +void +tree_evaluator::dbquit (bool all) { if (! m_debugger_stack.empty ()) m_debugger_stack.top()->dbquit (all); @@ -5078,7 +5157,8 @@ return set_internal_variable (m_PS4, args, nargout, "PS4"); } -bool tree_evaluator::echo_this_file (const std::string& file, int type) const +bool +tree_evaluator::echo_this_file (const std::string& file, int type) const { if ((type & m_echo) == ECHO_SCRIPTS) { @@ -5111,7 +5191,8 @@ return false; } -void tree_evaluator::echo_code (int line) +void +tree_evaluator::echo_code (int line) { std::string prefix = command_editor::decode_prompt_string (m_PS4); @@ -5132,7 +5213,8 @@ } // Decide if it's time to quit a for or while loop. -bool tree_evaluator::quit_loop_now () +bool +tree_evaluator::quit_loop_now () { octave_quit (); @@ -5149,11 +5231,12 @@ return quit; } -void tree_evaluator::bind_auto_fcn_vars (const string_vector& arg_names, - const Matrix& ignored_outputs, - int nargin, int nargout, - bool takes_varargs, - const octave_value_list& va_args) +void +tree_evaluator::bind_auto_fcn_vars (const string_vector& arg_names, + const Matrix& ignored_outputs, + int nargin, int nargout, + bool takes_varargs, + const octave_value_list& va_args) { set_auto_fcn_var (stack_frame::ARG_NAMES, Cell (arg_names)); set_auto_fcn_var (stack_frame::IGNORED, ignored_outputs); @@ -5205,7 +5288,7 @@ } DEFMETHOD (max_recursion_depth, interp, args, nargout, - doc: /* -*- texinfo -*- + doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} max_recursion_depth () @deftypefnx {} {@var{old_val} =} max_recursion_depth (@var{new_val}) @deftypefnx {} {@var{old_val} =} max_recursion_depth (@var{new_val}, "local") @@ -5222,9 +5305,9 @@ @seealso{max_stack_depth} @end deftypefn */) { -tree_evaluator& tw = interp.get_evaluator (); - -return tw.max_recursion_depth (args, nargout); + tree_evaluator& tw = interp.get_evaluator (); + + return tw.max_recursion_depth (args, nargout); } /* @@ -5240,7 +5323,7 @@ */ DEFMETHOD (whos_line_format, interp, args, nargout, - doc: /* -*- texinfo -*- + doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} whos_line_format () @deftypefnx {} {@var{old_val} =} whos_line_format (@var{new_val}) @deftypefnx {} {@var{old_val} =} whos_line_format (@var{new_val}, "local") @@ -5315,13 +5398,13 @@ @seealso{whos} @end deftypefn */) { -tree_evaluator& tw = interp.get_evaluator (); - -return tw.whos_line_format (args, nargout); + tree_evaluator& tw = interp.get_evaluator (); + + return tw.whos_line_format (args, nargout); } DEFMETHOD (silent_functions, interp, args, nargout, - doc: /* -*- texinfo -*- + doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} silent_functions () @deftypefnx {} {@var{old_val} =} silent_functions (@var{new_val}) @deftypefnx {} {@var{old_val} =} silent_functions (@var{new_val}, "local") @@ -5337,9 +5420,9 @@ The original variable value is restored when exiting the function. @end deftypefn */) { -tree_evaluator& tw = interp.get_evaluator (); - -return tw.silent_functions (args, nargout); + tree_evaluator& tw = interp.get_evaluator (); + + return tw.silent_functions (args, nargout); } /* @@ -5355,7 +5438,7 @@ */ DEFMETHOD (string_fill_char, interp, args, nargout, - doc: /* -*- texinfo -*- + doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} string_fill_char () @deftypefnx {} {@var{old_val} =} string_fill_char (@var{new_val}) @deftypefnx {} {@var{old_val} =} string_fill_char (@var{new_val}, "local") @@ -5380,9 +5463,9 @@ The original variable value is restored when exiting the function. @end deftypefn */) { -tree_evaluator& tw = interp.get_evaluator (); - -return tw.string_fill_char (args, nargout); + tree_evaluator& tw = interp.get_evaluator (); + + return tw.string_fill_char (args, nargout); } /* @@ -5404,7 +5487,7 @@ */ DEFMETHOD (PS4, interp, args, nargout, - doc: /* -*- texinfo -*- + doc: /* -*- texinfo -*- @deftypefn {} {@var{val} =} PS4 () @deftypefnx {} {@var{old_val} =} PS4 (@var{new_val}) @deftypefnx {} {@var{old_val} =} PS4 (@var{new_val}, "local") @@ -5420,11 +5503,11 @@ @seealso{echo, PS1, PS2} @end deftypefn */) { -return interp.PS4 (args, nargout); + return interp.PS4 (args, nargout); } DEFMETHOD (echo, interp, args, nargout, - doc: /* -*- texinfo -*- + doc: /* -*- texinfo -*- @deftypefn {} {} echo @deftypefnx {} {} echo on @deftypefnx {} {} echo off @@ -5464,9 +5547,9 @@ @seealso{PS4} @end deftypefn */) { -tree_evaluator& tw = interp.get_evaluator (); - -return tw.echo (args, nargout); + tree_evaluator& tw = interp.get_evaluator (); + + return tw.echo (args, nargout); } /*
--- a/libinterp/parse-tree/pt-eval.h Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/parse-tree/pt-eval.h Tue Dec 12 18:24:05 2023 -0800 @@ -401,7 +401,7 @@ octave_value get_auto_fcn_var (stack_frame::auto_var_type avt) const; - void define_parameter_list_from_arg_vector + void define_parameter_list_from_arg_vector (tree_parameter_list *param_list, const octave_value_list& args); void undefine_parameter_list (tree_parameter_list *param_list); @@ -855,7 +855,7 @@ m_echo_file_pos = pos; } - private: +private: template <typename T> void execute_range_loop (const range<T>& rng, int line,
--- a/libinterp/parse-tree/pt-tm-const.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/parse-tree/pt-tm-const.cc Tue Dec 12 18:24:05 2023 -0800 @@ -103,7 +103,8 @@ } } -void tm_row_const::init_element (const octave_value& val, bool& first_elem) +void +tm_row_const::init_element (const octave_value& val, bool& first_elem) { std::string this_elt_class_name = val.isobject () ? "class" : val.class_name (); @@ -167,7 +168,8 @@ // The common parts should be factored out into a single function that // is used by the others. -void tm_row_const::init (const tree_argument_list& row, tree_evaluator& tw) +void +tm_row_const::init (const tree_argument_list& row, tree_evaluator& tw) { bool first_elem = true; @@ -222,7 +224,8 @@ } } -octave_value tm_const::concat (char string_fill_char) const +octave_value +tm_const::concat (char string_fill_char) const { if (m_tm_rows.empty ()) return Matrix (); @@ -313,7 +316,8 @@ // The common parts should be factored out into a single function that // is used by the others. -void tm_const::init (const tree_matrix& tm) +void +tm_const::init (const tree_matrix& tm) { bool first_elem = true; bool first_elem_is_struct = false; @@ -428,7 +432,8 @@ } } -octave_value tm_const::char_array_concat (char string_fill_char) const +octave_value +tm_const::char_array_concat (char string_fill_char) const { char type = (m_all_dq_strings ? '"' : '\''); @@ -439,7 +444,8 @@ return octave_value (result, type); } -octave_value tm_const::class_concat () const +octave_value +tm_const::class_concat () const { octave_value retval; @@ -472,7 +478,8 @@ return retval; } -octave_value tm_const::generic_concat () const +octave_value +tm_const::generic_concat () const { // The line below might seem crazy, since we take a copy of the // first argument, resize it to be empty and then resize it to be @@ -575,7 +582,8 @@ // character arrays just to handle string_fill_char. template <typename TYPE> -void tm_const::array_concat_internal (TYPE& result) const +void +tm_const::array_concat_internal (TYPE& result) const { octave_idx_type r = 0; octave_idx_type c = 0; @@ -608,7 +616,8 @@ } template <typename TYPE> -TYPE tm_const::array_concat () const +TYPE +tm_const::array_concat () const { typedef typename TYPE::element_type ELT_T; @@ -657,7 +666,8 @@ } template <typename TYPE> -TYPE tm_const::sparse_array_concat () const +TYPE +tm_const::sparse_array_concat () const { if (m_dv.any_zero ()) return TYPE (m_dv); @@ -691,7 +701,8 @@ } template <typename MAP> -octave_map tm_const::map_concat () const +octave_map +tm_const::map_concat () const { if (m_dv.any_zero ()) return octave_map (m_dv);
--- a/libinterp/parse-tree/pt-walk.cc Mon Dec 11 18:28:46 2023 -0500 +++ b/libinterp/parse-tree/pt-walk.cc Tue Dec 12 18:24:05 2023 -0800 @@ -44,7 +44,8 @@ expression->accept (*this); } -void tree_walker::visit_argument_list (tree_argument_list& lst) +void +tree_walker::visit_argument_list (tree_argument_list& lst) { auto p = lst.begin (); @@ -57,7 +58,8 @@ } } -void tree_walker::visit_arguments_block (tree_arguments_block& blk) +void +tree_walker::visit_arguments_block (tree_arguments_block& blk) { tree_args_block_attribute_list *attribute_list = blk.attribute_list (); @@ -70,7 +72,8 @@ validation_list->accept (*this); } -void tree_walker::visit_args_block_attribute_list (tree_args_block_attribute_list& lst) +void +tree_walker::visit_args_block_attribute_list (tree_args_block_attribute_list& lst) { tree_identifier *attribute = lst.attribute (); @@ -78,7 +81,8 @@ attribute->accept (*this); } -void tree_walker::visit_args_block_validation_list (tree_args_block_validation_list& lst) +void +tree_walker::visit_args_block_validation_list (tree_args_block_validation_list& lst) { for (auto *elt : lst) { @@ -87,7 +91,8 @@ } } -void tree_walker::visit_arg_validation (tree_arg_validation& val) +void +tree_walker::visit_arg_validation (tree_arg_validation& val) { tree_expression *arg_name = val.identifier_expression (); @@ -115,7 +120,8 @@ default_value->accept (*this); } -void tree_walker::visit_arg_size_spec (tree_arg_size_spec& spec) +void +tree_walker::visit_arg_size_spec (tree_arg_size_spec& spec) { tree_argument_list *size_args = spec.size_args (); @@ -123,7 +129,8 @@ size_args->accept (*this); } -void tree_walker::visit_arg_validation_fcns (tree_arg_validation_fcns& spec) +void +tree_walker::visit_arg_validation_fcns (tree_arg_validation_fcns& spec) { tree_argument_list *fcn_args = spec.fcn_args (); @@ -131,7 +138,8 @@ fcn_args->accept (*this); } -void tree_walker::visit_binary_expression (tree_binary_expression& expr) +void +tree_walker::visit_binary_expression (tree_binary_expression& expr) { tree_expression *op1 = expr.lhs (); @@ -144,22 +152,26 @@ op2->accept (*this); } -void tree_walker::visit_boolean_expression (tree_boolean_expression& expr) +void +tree_walker::visit_boolean_expression (tree_boolean_expression& expr) { visit_binary_expression (expr); } -void tree_walker::visit_compound_binary_expression (tree_compound_binary_expression& expr) +void +tree_walker::visit_compound_binary_expression (tree_compound_binary_expression& expr) { visit_binary_expression (expr); } -void tree_walker::visit_break_command (tree_break_command&) +void +tree_walker::visit_break_command (tree_break_command&) { // Nothing to do. } -void tree_walker::visit_colon_expression (tree_colon_expression& expr) +void +tree_walker::visit_colon_expression (tree_colon_expression& expr) { tree_expression *op1 = expr.base (); @@ -177,12 +189,14 @@ op2->accept (*this); } -void tree_walker::visit_continue_command (tree_continue_command&) +void +tree_walker::visit_continue_command (tree_continue_command&) { // Nothing to do. } -void tree_walker::visit_decl_command (tree_decl_command& cmd) +void +tree_walker::visit_decl_command (tree_decl_command& cmd) { tree_decl_init_list *init_list = cmd.initializer_list (); @@ -190,7 +204,8 @@ init_list->accept (*this); } -void tree_walker::visit_decl_elt (tree_decl_elt& cmd) +void +tree_walker::visit_decl_elt (tree_decl_elt& cmd) { tree_identifier *id = cmd.ident (); @@ -203,7 +218,8 @@ expr->accept (*this); } -void tree_walker::visit_decl_init_list (tree_decl_init_list& lst) +void +tree_walker::visit_decl_init_list (tree_decl_init_list& lst) { // FIXME: tree_decl_elt is not derived from tree, so should it // really have an accept method? @@ -215,7 +231,8 @@ } } -void tree_walker::visit_simple_for_command (tree_simple_for_command& cmd) +void +tree_walker::visit_simple_for_command (tree_simple_for_command& cmd) { tree_expression *lhs = cmd.left_hand_side (); @@ -238,7 +255,8 @@ list->accept (*this); } -void tree_walker::visit_complex_for_command (tree_complex_for_command& cmd) +void +tree_walker::visit_complex_for_command (tree_complex_for_command& cmd) { tree_argument_list *lhs = cmd.left_hand_side (); @@ -256,7 +274,8 @@ list->accept (*this); } -void tree_walker::visit_spmd_command (tree_spmd_command& cmd) +void +tree_walker::visit_spmd_command (tree_spmd_command& cmd) { tree_statement_list *body = cmd.body (); @@ -264,7 +283,8 @@ body->accept (*this); } -void tree_walker::visit_octave_user_script (octave_user_script& fcn) +void +tree_walker::visit_octave_user_script (octave_user_script& fcn) { tree_statement_list *cmd_list = fcn.body (); @@ -272,7 +292,8 @@ cmd_list->accept (*this); } -void tree_walker::visit_octave_user_function (octave_user_function& fcn) +void +tree_walker::visit_octave_user_function (octave_user_function& fcn) { tree_statement_list *cmd_list = fcn.body (); @@ -280,7 +301,8 @@ cmd_list->accept (*this); } -void tree_walker::visit_function_def (tree_function_def& fdef) +void +tree_walker::visit_function_def (tree_function_def& fdef) { octave_value fcn = fdef.function (); @@ -290,12 +312,14 @@ f->accept (*this); } -void tree_walker::visit_identifier (tree_identifier&) +void +tree_walker::visit_identifier (tree_identifier&) { // Nothing to do. } -void tree_walker::visit_if_clause (tree_if_clause& cmd) +void +tree_walker::visit_if_clause (tree_if_clause& cmd) { tree_expression *expr = cmd.condition (); @@ -308,7 +332,8 @@ list->accept (*this); } -void tree_walker::visit_if_command (tree_if_command& cmd) +void +tree_walker::visit_if_command (tree_if_command& cmd) { tree_if_command_list *list = cmd.cmd_list (); @@ -316,7 +341,8 @@ list->accept (*this); } -void tree_walker::visit_if_command_list (tree_if_command_list& lst) +void +tree_walker::visit_if_command_list (tree_if_command_list& lst) { auto p = lst.begin (); @@ -329,7 +355,8 @@ } } -void tree_walker::visit_switch_case (tree_switch_case& cs) +void +tree_walker::visit_switch_case (tree_switch_case& cs) { tree_expression *label = cs.case_label (); @@ -342,7 +369,8 @@ list->accept (*this); } -void tree_walker::visit_switch_case_list (tree_switch_case_list& lst) +void +tree_walker::visit_switch_case_list (tree_switch_case_list& lst) { auto p = lst.begin (); @@ -355,7 +383,8 @@ } } -void tree_walker::visit_switch_command (tree_switch_command& cmd) +void +tree_walker::visit_switch_command (tree_switch_command& cmd) { tree_expression *expr = cmd.switch_value (); @@ -368,7 +397,8 @@ list->accept (*this); } -void tree_walker::visit_index_expression (tree_index_expression& expr) +void +tree_walker::visit_index_expression (tree_index_expression& expr) { tree_expression *e = expr.expression (); @@ -421,7 +451,8 @@ } } -void tree_walker::visit_matrix (tree_matrix& lst) +void +tree_walker::visit_matrix (tree_matrix& lst) { auto p = lst.begin (); @@ -434,7 +465,8 @@ } } -void tree_walker::visit_cell (tree_cell& lst) +void +tree_walker::visit_cell (tree_cell& lst) { auto p = lst.begin (); @@ -447,7 +479,8 @@ } } -void tree_walker::visit_multi_assignment (tree_multi_assignment& expr) +void +tree_walker::visit_multi_assignment (tree_multi_assignment& expr) { tree_argument_list *lhs = expr.left_hand_side (); @@ -460,22 +493,26 @@ rhs->accept (*this); } -void tree_walker::visit_no_op_command (tree_no_op_command&) +void +tree_walker::visit_no_op_command (tree_no_op_command&) { // Nothing to do. } -void tree_walker::visit_constant (tree_constant&) +void +tree_walker::visit_constant (tree_constant&) { // Nothing to do. } -void tree_walker::visit_fcn_handle (tree_fcn_handle&) +void +tree_walker::visit_fcn_handle (tree_fcn_handle&) { // Nothing to do. } -void tree_walker::visit_parameter_list (tree_parameter_list& lst) +void +tree_walker::visit_parameter_list (tree_parameter_list& lst) { auto p = lst.begin (); @@ -488,7 +525,8 @@ } } -void tree_walker::visit_postfix_expression (tree_postfix_expression& expr) +void +tree_walker::visit_postfix_expression (tree_postfix_expression& expr) { tree_expression *e = expr.operand (); @@ -496,7 +534,8 @@ e->accept (*this); } -void tree_walker::visit_prefix_expression (tree_prefix_expression& expr) +void +tree_walker::visit_prefix_expression (tree_prefix_expression& expr) { tree_expression *e = expr.operand (); @@ -504,12 +543,14 @@ e->accept (*this); } -void tree_walker::visit_return_command (tree_return_command&) +void +tree_walker::visit_return_command (tree_return_command&) { // Nothing to do. } -void tree_walker::visit_simple_assignment (tree_simple_assignment& expr) +void +tree_walker::visit_simple_assignment (tree_simple_assignment& expr) { tree_expression *lhs = expr.left_hand_side (); @@ -522,7 +563,8 @@ rhs->accept (*this); } -void tree_walker::visit_statement (tree_statement& stmt) +void +tree_walker::visit_statement (tree_statement& stmt) { tree_command *cmd = stmt.command (); @@ -537,7 +579,8 @@ } } -void tree_walker::visit_statement_list (tree_statement_list& lst) +void +tree_walker::visit_statement_list (tree_statement_list& lst) { for (tree_statement *elt : lst) { @@ -546,7 +589,8 @@ } } -void tree_walker::visit_try_catch_command (tree_try_catch_command& cmd) +void +tree_walker::visit_try_catch_command (tree_try_catch_command& cmd) { tree_statement_list *try_code = cmd.body (); @@ -564,7 +608,8 @@ catch_code->accept (*this); } -void tree_walker::visit_unwind_protect_command (tree_unwind_protect_command& cmd) +void +tree_walker::visit_unwind_protect_command (tree_unwind_protect_command& cmd) { tree_statement_list *unwind_protect_code = cmd.body (); @@ -577,7 +622,8 @@ cleanup_code->accept (*this); } -void tree_walker::visit_while_command (tree_while_command& cmd) +void +tree_walker::visit_while_command (tree_while_command& cmd) { tree_expression *expr = cmd.condition (); @@ -590,7 +636,8 @@ list->accept (*this); } -void tree_walker::visit_do_until_command (tree_do_until_command& cmd) +void +tree_walker::visit_do_until_command (tree_do_until_command& cmd) { tree_statement_list *list = cmd.body (); @@ -603,17 +650,20 @@ expr->accept (*this); } -void tree_walker::visit_superclass_ref (tree_superclass_ref&) +void +tree_walker::visit_superclass_ref (tree_superclass_ref&) { // Nothing to do. } -void tree_walker::visit_metaclass_query (tree_metaclass_query&) +void +tree_walker::visit_metaclass_query (tree_metaclass_query&) { // Nothing to do. } -void tree_walker::visit_classdef_attribute (tree_classdef_attribute& attr) +void +tree_walker::visit_classdef_attribute (tree_classdef_attribute& attr) { tree_identifier *id = attr.ident (); @@ -626,7 +676,8 @@ expr->accept (*this); } -void tree_walker::visit_classdef_attribute_list (tree_classdef_attribute_list& lst) +void +tree_walker::visit_classdef_attribute_list (tree_classdef_attribute_list& lst) { for (auto *elt : lst) { @@ -635,12 +686,14 @@ } } -void tree_walker::visit_classdef_superclass (tree_classdef_superclass&) +void +tree_walker::visit_classdef_superclass (tree_classdef_superclass&) { // Nothing to do. } -void tree_walker::visit_classdef_superclass_list (tree_classdef_superclass_list& lst) +void +tree_walker::visit_classdef_superclass_list (tree_classdef_superclass_list& lst) { for (auto *elt : lst) { @@ -649,13 +702,15 @@ } } -void tree_walker::visit_classdef_property (tree_classdef_property&) +void +tree_walker::visit_classdef_property (tree_classdef_property&) { // FIXME: Should we operate on the tree_arg_validation object or the // identifier and expression parts separately? } -void tree_walker::visit_classdef_property_list (tree_classdef_property_list& lst) +void +tree_walker::visit_classdef_property_list (tree_classdef_property_list& lst) { for (auto *elt : lst) { @@ -664,7 +719,8 @@ } } -void tree_walker::visit_classdef_properties_block (tree_classdef_properties_block& blk) +void +tree_walker::visit_classdef_properties_block (tree_classdef_properties_block& blk) { tree_classdef_property_list *property_list = blk.element_list (); @@ -672,7 +728,8 @@ property_list->accept (*this); } -void tree_walker::visit_classdef_methods_list (tree_classdef_methods_list& lst) +void +tree_walker::visit_classdef_methods_list (tree_classdef_methods_list& lst) { for (auto ov_meth : lst) { @@ -683,7 +740,8 @@ } } -void tree_walker::visit_classdef_methods_block (tree_classdef_methods_block& blk) +void +tree_walker::visit_classdef_methods_block (tree_classdef_methods_block& blk) { tree_classdef_methods_list *methods_list = blk.element_list (); @@ -691,12 +749,14 @@ methods_list->accept (*this); } -void tree_walker::visit_classdef_event (tree_classdef_event&) +void +tree_walker::visit_classdef_event (tree_classdef_event&) { // Nothing to do. } -void tree_walker::visit_classdef_events_list (tree_classdef_events_list& lst) +void +tree_walker::visit_classdef_events_list (tree_classdef_events_list& lst) { for (auto *elt : lst) { @@ -705,7 +765,8 @@ } } -void tree_walker::visit_classdef_events_block (tree_classdef_events_block& blk) +void +tree_walker::visit_classdef_events_block (tree_classdef_events_block& blk) { tree_classdef_events_list *events_list = blk.element_list (); @@ -713,12 +774,14 @@ events_list->accept (*this); } -void tree_walker::visit_classdef_enum (tree_classdef_enum&) +void +tree_walker::visit_classdef_enum (tree_classdef_enum&) { // Nothing to do. } -void tree_walker::visit_classdef_enum_list (tree_classdef_enum_list& lst) +void +tree_walker::visit_classdef_enum_list (tree_classdef_enum_list& lst) { for (auto *elt : lst) { @@ -727,7 +790,8 @@ } } -void tree_walker::visit_classdef_enum_block (tree_classdef_enum_block& blk) +void +tree_walker::visit_classdef_enum_block (tree_classdef_enum_block& blk) { tree_classdef_enum_list *enum_list = blk.element_list (); @@ -735,7 +799,8 @@ enum_list->accept (*this); } -void tree_walker::visit_classdef_body (tree_classdef_body& body) +void +tree_walker::visit_classdef_body (tree_classdef_body& body) { for (auto *elt : body.properties_list ()) { @@ -763,7 +828,8 @@ } } -void tree_walker::visit_classdef (tree_classdef& cdef) +void +tree_walker::visit_classdef (tree_classdef& cdef) { tree_classdef_attribute_list *attribute_list = cdef.attribute_list ();