Mercurial > octave
changeset 31813:73fdf7f8381b
maint: Use consistent coding style when calling Ffunction().
* __ichol__.cc, call-stack.cc, dot.cc, error.cc, interpreter.cc,
__init_fltk__.cc, ov-cell.cc, ov-java.cc, ov-struct.cc:
Use consistent coding style when calling Ffunction() by wrapping
arguments in "ovl (...)".
author | Rik <rik@octave.org> |
---|---|
date | Thu, 02 Feb 2023 17:33:17 -0800 |
parents | 174a224a85ab |
children | 53c10d69a9be |
files | libinterp/corefcn/__ichol__.cc libinterp/corefcn/call-stack.cc libinterp/corefcn/dot.cc libinterp/corefcn/error.cc libinterp/corefcn/interpreter.cc libinterp/dldfcn/__init_fltk__.cc libinterp/octave-value/ov-cell.cc libinterp/octave-value/ov-java.cc libinterp/octave-value/ov-struct.cc |
diffstat | 9 files changed, 38 insertions(+), 37 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/__ichol__.cc Thu Feb 02 17:31:55 2023 -0800 +++ b/libinterp/corefcn/__ichol__.cc Thu Feb 02 17:33:17 2023 -0800 @@ -201,7 +201,7 @@ // matrix is used to build the output matrix due to that fact. if (! args(0).iscomplex ()) { - SparseMatrix sm = Ftril (args(0))(0).sparse_matrix_value (); + SparseMatrix sm = Ftril (ovl (args(0)))(0).sparse_matrix_value (); ichol_0 <SparseMatrix, double, ichol_mult_real, ichol_checkpivot_real> (sm, michol); return ovl (sm); @@ -209,7 +209,7 @@ else { SparseComplexMatrix sm - = Ftril (args(0))(0).sparse_complex_matrix_value (); + = Ftril (ovl (args(0)))(0).sparse_complex_matrix_value (); ichol_0 <SparseComplexMatrix, Complex, ichol_mult_complex, ichol_checkpivot_complex> (sm, michol); return ovl (sm); @@ -434,7 +434,7 @@ if (! args(0).iscomplex ()) { SparseMatrix L; - SparseMatrix sm_l = Ftril (args(0))(0).sparse_matrix_value (); + SparseMatrix sm_l = Ftril (ovl (args(0)))(0).sparse_matrix_value (); RowVector sm_col_norms = xcolnorms (sm_l, 1); ichol_t <SparseMatrix, double, ichol_mult_real, ichol_checkpivot_real> @@ -446,7 +446,7 @@ { SparseComplexMatrix L; SparseComplexMatrix sm_l - = Ftril (args(0))(0).sparse_complex_matrix_value (); + = Ftril (ovl (args(0)))(0).sparse_complex_matrix_value (); Array <Complex> cols_norm = xcolnorms (sm_l, 1); ichol_t <SparseComplexMatrix, Complex, ichol_mult_complex, ichol_checkpivot_complex>
--- a/libinterp/corefcn/call-stack.cc Thu Feb 02 17:31:55 2023 -0800 +++ b/libinterp/corefcn/call-stack.cc Thu Feb 02 17:33:17 2023 -0800 @@ -984,7 +984,7 @@ interpreter& interp = m_evaluator.get_interpreter (); - Fload (interp, ovl (octave_value (file_name))); + Fload (interp, ovl (file_name)); std::string newmsg = "Variables in the file " + file_name + ":\n";
--- a/libinterp/corefcn/dot.cc Thu Feb 02 17:31:55 2023 -0800 +++ b/libinterp/corefcn/dot.cc Thu Feb 02 17:33:17 2023 -0800 @@ -193,9 +193,9 @@ // of calculating possibly garbage results. // Think of the dot product of two int8 vectors where the multiplications // exceed intmax. - octave_value_list tmp; + octave_value_list tmp (2); + tmp(0) = binary_op (octave_value::op_el_mul, argx, argy); tmp(1) = dim + 1; - tmp(0) = binary_op (octave_value::op_el_mul, argx, argy); tmp = Fsum (tmp, 1); if (! tmp.empty ())
--- a/libinterp/corefcn/error.cc Thu Feb 02 17:31:55 2023 -0800 +++ b/libinterp/corefcn/error.cc Thu Feb 02 17:33:17 2023 -0800 @@ -1802,10 +1802,10 @@ octave_value_list set_warning_state (const std::string& id, const std::string& state) { - octave_value_list args; + octave_value_list args (2); + args(0) = state; args(1) = id; - args(0) = state; interpreter& interp = __get_interpreter__ ();
--- a/libinterp/corefcn/interpreter.cc Thu Feb 02 17:31:55 2023 -0800 +++ b/libinterp/corefcn/interpreter.cc Thu Feb 02 17:33:17 2023 -0800 @@ -341,14 +341,14 @@ static void initialize_version_info () { - octave_value_list args; - - args(3) = OCTAVE_RELEASE_DATE; + octave_value_list args (4); + + args(0) = "GNU Octave"; + args(1) = OCTAVE_VERSION; args(2) = config::release (); - args(1) = OCTAVE_VERSION; - args(0) = "GNU Octave"; - - F__version_info__ (args, 0); + args(3) = OCTAVE_RELEASE_DATE; + + F__version_info__ (args); } static void xerbla_abort () @@ -575,23 +575,23 @@ std::string docstrings_file = options.docstrings_file (); if (! docstrings_file.empty ()) - Fbuilt_in_docstrings_file (*this, octave_value (docstrings_file)); + Fbuilt_in_docstrings_file (*this, ovl (docstrings_file)); std::string doc_cache_file = options.doc_cache_file (); if (! doc_cache_file.empty ()) - Fdoc_cache_file (*this, octave_value (doc_cache_file)); + Fdoc_cache_file (*this, ovl (doc_cache_file)); std::string info_file = options.info_file (); if (! info_file.empty ()) - Finfo_file (*this, octave_value (info_file)); + Finfo_file (*this, ovl (info_file)); std::string info_program = options.info_program (); if (! info_program.empty ()) - Finfo_program (*this, octave_value (info_program)); + Finfo_program (*this, ovl (info_program)); std::string texi_macros_file = options.texi_macros_file (); if (! texi_macros_file.empty ()) - Ftexi_macros_file (*this, octave_value (texi_macros_file)); + Ftexi_macros_file (*this, ovl (texi_macros_file)); } // FIXME: we defer creation of the gh_manager object because it @@ -2076,14 +2076,14 @@ m_error_system.beep_on_error (true); - Fconfirm_recursive_rmdir (octave_value (false)); - Foptimize_diagonal_matrix (octave_value (false)); - Foptimize_permutation_matrix (octave_value (false)); - Foptimize_range (octave_value (false)); - Ffixed_point_format (octave_value (true)); - Fprint_empty_dimensions (octave_value (false)); - Fprint_struct_array_contents (octave_value (true)); - Fstruct_levels_to_print (octave_value (0)); + Fconfirm_recursive_rmdir (ovl (false)); + Foptimize_diagonal_matrix (ovl (false)); + Foptimize_permutation_matrix (ovl (false)); + Foptimize_range (ovl (false)); + Ffixed_point_format (ovl (true)); + Fprint_empty_dimensions (ovl (false)); + Fprint_struct_array_contents (ovl (true)); + Fstruct_levels_to_print (ovl (0)); m_error_system.disable_warning ("Octave:abbreviated-property-match"); m_error_system.disable_warning ("Octave:colon-nonscalar-argument");
--- a/libinterp/dldfcn/__init_fltk__.cc Thu Feb 02 17:31:55 2023 -0800 +++ b/libinterp/dldfcn/__init_fltk__.cc Thu Feb 02 17:33:17 2023 -0800 @@ -2474,7 +2474,7 @@ octave_value_list args = input_event_hook_fcn_id; args.append (false); - Fremove_input_event_hook (m_interpreter, args, 0); + Fremove_input_event_hook (m_interpreter, args); input_event_hook_fcn_id = octave_value_list (); figure_manager::close_all (); @@ -2542,7 +2542,8 @@ octave_value fcn (new octave_builtin (F__fltk_check__)); octave_value fcn_handle (new octave_fcn_handle (fcn)); - octave_value_list id = Fadd_input_event_hook (interp, fcn_handle, 1); + octave_value_list id = Fadd_input_event_hook (interp, + ovl (fcn_handle), 1); fltk->set_input_event_hook_id (id); }
--- a/libinterp/octave-value/ov-cell.cc Thu Feb 02 17:31:55 2023 -0800 +++ b/libinterp/octave-value/ov-cell.cc Thu Feb 02 17:33:17 2023 -0800 @@ -1339,7 +1339,7 @@ string_vector s = args(0).xstring_vector_value ("cellstr: argument STRING must be a 2-D character array"); return ovl (s.isempty () ? Cell (octave_value ("")) - : Cell (s, true)); + : Cell (s, true)); } }
--- a/libinterp/octave-value/ov-java.cc Thu Feb 02 17:31:55 2023 -0800 +++ b/libinterp/octave-value/ov-java.cc Thu Feb 02 17:33:17 2023 -0800 @@ -2203,10 +2203,10 @@ case '.': if (type.length () > 1 && type[1] == '(') { - octave_value_list ovl; + octave_value_list ovl (2); count++; + ovl(0) = (idx.front ())(0); ovl(1) = octave_value (this); - ovl(0) = (idx.front ())(0); auto it = idx.begin (); ovl.append (*++it); retval = octave::FjavaMethod (ovl, 1); @@ -2214,7 +2214,7 @@ } else { - octave_value_list ovl; + octave_value_list ovl (2); count++; ovl(0) = octave_value (this); ovl(1) = (idx.front ())(0); @@ -2269,7 +2269,7 @@ if (type.length () == 1) { // field assignment - octave_value_list ovl; + octave_value_list ovl (3); count++; ovl(0) = octave_value (this); ovl(1) = (idx.front ())(0);
--- a/libinterp/octave-value/ov-struct.cc Thu Feb 02 17:31:55 2023 -0800 +++ b/libinterp/octave-value/ov-struct.cc Thu Feb 02 17:33:17 2023 -0800 @@ -2181,7 +2181,7 @@ octave_map m = args(0).xmap_value ("rmfield: first argument must be a struct"); - octave_value_list fval = Fcellstr (args(1), 1); + octave_value_list fval = Fcellstr (ovl (args(1)), 1); Cell fcell = fval(0).cell_value ();