Mercurial > octave
changeset 32511:0cafa72d1408 stable
maint: Eliminate "(void)" in C++ function prototypes/declarations.
* stack-frame.cc, stack-frame.h, ov-base-diag.h, ov-base-int.h, ov-base-mat.h,
ov-base-scalar.h, ov-base-sparse.h, ov-base.cc, ov-base.h, ov-cell.h,
ov-classdef.h, ov-colon.h, ov-fcn-handle.cc, ov-fcn-handle.h, ov-fcn.h,
ov-magic-int.h, ov-null-mat.h, ov-range.h, ov-ref.h, ov-scalar.cc, ov-scalar.h,
ov.h, pt-bytecode-walk.h, sparse-chol.cc: Eliminate "(void)" in C++ function
prototypes/declarations.
line wrap: on
line diff
--- a/libinterp/corefcn/stack-frame.cc Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/corefcn/stack-frame.cc Sat Nov 25 16:47:19 2023 +0100 @@ -75,7 +75,7 @@ DATA_NLOCALS = 2, }; - bytecode_fcn_stack_frame (void) = delete; + bytecode_fcn_stack_frame () = delete; bytecode_fcn_stack_frame (tree_evaluator& tw, octave_user_code *fcn, @@ -324,13 +324,13 @@ m_stack_start = m_lazy_data->m_stack_cpy; } - std::size_t size (void) const + std::size_t size () const { return m_orig_size + (m_lazy_data ? m_lazy_data->m_extra_slots.size () : 0); } - std::size_t internal_size (void) const + std::size_t internal_size () const { return m_size + (m_lazy_data ? m_lazy_data->m_extra_slots.size () : 0); @@ -1071,7 +1071,7 @@ } } - bool is_bytecode_fcn_frame (void) const { return true; } + bool is_bytecode_fcn_frame () const { return true; } // E.g. script_stack_frame::get_access_link() need to think the bytecode frame is a user script frame // if it executes a script. @@ -1191,7 +1191,7 @@ return sym; } - symbol_scope get_scope (void) const + symbol_scope get_scope () const { return m_fcn->scope (); }
--- a/libinterp/corefcn/stack-frame.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/corefcn/stack-frame.h Sat Nov 25 16:47:19 2023 +0100 @@ -226,7 +226,7 @@ virtual bool is_user_script_frame () const { return false; } virtual bool is_user_fcn_frame () const { return false; } virtual bool is_scope_frame () const { return false; } - virtual bool is_bytecode_fcn_frame (void) const { return false; } + virtual bool is_bytecode_fcn_frame () const { return false; } virtual void clear_values ();
--- a/libinterp/octave-value/ov-base-diag.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-base-diag.h Sat Nov 25 16:47:19 2023 +0100 @@ -247,7 +247,7 @@ OCTINTERP_API octave_value fast_elem_extract (octave_idx_type n) const; - octave_base_value::vm_call_dispatch_type vm_dispatch_call (void) + octave_base_value::vm_call_dispatch_type vm_dispatch_call () { return vm_call_dispatch_type::OCT_SUBSREF; }
--- a/libinterp/octave-value/ov-base-int.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-base-int.h Sat Nov 25 16:47:19 2023 +0100 @@ -136,7 +136,7 @@ octave_base_value * try_narrowing_conversion () { return nullptr; } - bool is_maybe_function (void) const { return false; } + bool is_maybe_function () const { return false; } bool isreal () const { return true; }
--- a/libinterp/octave-value/ov-base-mat.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-base-mat.h Sat Nov 25 16:47:19 2023 +0100 @@ -80,8 +80,10 @@ octave_value full_value () const { return m_matrix; } void maybe_economize () { m_matrix.maybe_economize (); } - bool vm_need_storable_call (void) const { return true; } - bool is_maybe_function (void) const { return false; } + + bool vm_need_storable_call () const { return true; } + + bool is_maybe_function () const { return false; } // We don't need to override all three forms of subsref. The using // declaration will avoid warnings about partially-overloaded virtual @@ -219,7 +221,7 @@ octave_value checked_full_matrix_elem (octave_idx_type i, octave_idx_type j) const; - octave_base_value::vm_call_dispatch_type vm_dispatch_call (void) + octave_base_value::vm_call_dispatch_type vm_dispatch_call () { return vm_call_dispatch_type::OCT_SUBSREF; }
--- a/libinterp/octave-value/ov-base-scalar.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-base-scalar.h Sat Nov 25 16:47:19 2023 +0100 @@ -135,7 +135,7 @@ MatrixType matrix_type (const MatrixType&) const { return matrix_type (); } - bool is_maybe_function (void) const { return false; } + bool is_maybe_function () const { return false; } bool is_scalar_type () const { return true; } @@ -175,11 +175,13 @@ OCTINTERP_API bool fast_elem_insert_self (void *where, builtin_type_t btyp) const; - bool vm_need_dispatch_assign_rhs (void) { return false; } - bool vm_need_dispatch_assign_lhs (void) { return false; } - bool vm_need_dispatch_push (void) { return false; } + bool vm_need_dispatch_assign_rhs () { return false; } + + bool vm_need_dispatch_assign_lhs () { return false; } - octave_base_value::vm_call_dispatch_type vm_dispatch_call (void) + bool vm_need_dispatch_push () { return false; } + + octave_base_value::vm_call_dispatch_type vm_dispatch_call () { return vm_call_dispatch_type::OCT_SUBSREF; }
--- a/libinterp/octave-value/ov-base-sparse.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-base-sparse.h Sat Nov 25 16:47:19 2023 +0100 @@ -242,7 +242,7 @@ OCTINTERP_API octave_value fast_elem_extract (octave_idx_type n) const; - octave_base_value::vm_call_dispatch_type vm_dispatch_call (void) + octave_base_value::vm_call_dispatch_type vm_dispatch_call () { return vm_call_dispatch_type::OCT_SUBSREF; }
--- a/libinterp/octave-value/ov-base.cc Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-base.cc Sat Nov 25 16:47:19 2023 +0100 @@ -127,13 +127,13 @@ // here are not used by the corresponding octave_value functions. This // inconsistency is likely to cause some confusion. octave_value -octave_base_value::storable_value (void) +octave_base_value::storable_value () { return octave_value_factory::make_copy (this); } octave_base_value * -octave_base_value::make_storable_value (void) +octave_base_value::make_storable_value () { return this; } @@ -158,7 +158,7 @@ } octave_value -octave_base_value::as_double_or_copy (void) +octave_base_value::as_double_or_copy () { const octave_base_value * cthis = this; return cthis->as_double (); @@ -963,7 +963,7 @@ } octave_base_value::vm_call_dispatch_type -octave_base_value::vm_dispatch_call (void) +octave_base_value::vm_dispatch_call () { // This is the fallback way to determine the dispatch type // for octave_base_value classes that does not implement vm_dispatch_call ()
--- a/libinterp/octave-value/ov-base.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-base.h Sat Nov 25 16:47:19 2023 +0100 @@ -303,7 +303,7 @@ // Will return a copy of it-self when the representation // allready is a scalar (.i.e. double). The const variant // as_double () would allocate a new octave value. - virtual octave_value as_double_or_copy (void); + virtual octave_value as_double_or_copy (); virtual octave_value as_double () const; virtual octave_value as_single () const; @@ -540,14 +540,14 @@ virtual bool is_mex_function () const { return false; } - virtual bool is_function_cache (void) const { return false; } + virtual bool is_function_cache () const { return false; } // Checks if the ov could be a function. If it is undefined, // the name associated with the ov could be a function to call. - virtual bool is_maybe_function (void) const + virtual bool is_maybe_function () const { return !is_defined () || is_function (); } - virtual bool has_function_cache (void) const { return false; } + virtual bool has_function_cache () const { return false; } virtual octave_function * get_cached_fcn (const octave_value_list&) { return nullptr; } @@ -804,17 +804,17 @@ virtual octave_value dump () const; - virtual octave_value storable_value (void); + virtual octave_value storable_value (); - virtual octave_base_value * make_storable_value (void); + virtual octave_base_value * make_storable_value (); - virtual bool vm_need_storable_call (void) const { return false; } + virtual bool vm_need_storable_call () const { return false; } - virtual bool vm_need_dispatch_assign_rhs (void) { return true; } + virtual bool vm_need_dispatch_assign_rhs () { return true; } - virtual bool vm_need_dispatch_assign_lhs (void) { return true; } + virtual bool vm_need_dispatch_assign_lhs () { return true; } - virtual bool vm_need_dispatch_push (void) { return true; } + virtual bool vm_need_dispatch_push () { return true; } enum class vm_call_dispatch_type { OCT_SUBSREF, @@ -824,7 +824,7 @@ OCT_OBJECT, }; - virtual vm_call_dispatch_type vm_dispatch_call (void); + virtual vm_call_dispatch_type vm_dispatch_call (); virtual bool is_ref () const { return false; }
--- a/libinterp/octave-value/ov-cell.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-cell.h Sat Nov 25 16:47:19 2023 +0100 @@ -178,7 +178,7 @@ // You should not use it anywhere else. const void * mex_get_data () const; - octave_base_value::vm_call_dispatch_type vm_dispatch_call (void) + octave_base_value::vm_call_dispatch_type vm_dispatch_call () { return vm_call_dispatch_type::OCT_SUBSREF; }
--- a/libinterp/octave-value/ov-classdef.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-classdef.h Sat Nov 25 16:47:19 2023 +0100 @@ -230,7 +230,7 @@ OCTINTERP_API std::string file_name () const; - vm_call_dispatch_type vm_dispatch_call (void) + vm_call_dispatch_type vm_dispatch_call () { return vm_call_dispatch_type::OCT_SUBSREF; }
--- a/libinterp/octave-value/ov-colon.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-colon.h Sat Nov 25 16:47:19 2023 +0100 @@ -76,7 +76,7 @@ OCTINTERP_API void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; - octave_base_value::vm_call_dispatch_type vm_dispatch_call (void) + octave_base_value::vm_call_dispatch_type vm_dispatch_call () { return vm_call_dispatch_type::OCT_SUBSREF; }
--- a/libinterp/octave-value/ov-fcn-handle.cc Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-fcn-handle.cc Sat Nov 25 16:47:19 2023 +0100 @@ -236,7 +236,7 @@ octave_function * get_cached_fcn (void *beg, void *end); - bool has_function_cache (void) const; + bool has_function_cache () const; private: @@ -321,7 +321,7 @@ get_cached_fcn (const octave_value_list&) { return m_fcn.function_value (); } bool - has_function_cache (void) const { return true; } + has_function_cache () const { return true; } protected: @@ -714,7 +714,7 @@ get_cached_fcn (void *, void *) { return m_fcn.function_value (); } // TODO: This is a hack to get uncompiled anonymous functions to be subsrefed in the VM - bool has_function_cache (void) const + bool has_function_cache () const { octave_function *fn = m_fcn.function_value (); return fn ? fn->is_compiled () : false;
--- a/libinterp/octave-value/ov-fcn-handle.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-fcn-handle.h Sat Nov 25 16:47:19 2023 +0100 @@ -161,7 +161,7 @@ get_cached_fcn (const octave_value_list&) { return nullptr; } virtual bool - has_function_cache (void) const { return false; } + has_function_cache () const { return false; } virtual void compile () {} @@ -383,9 +383,9 @@ octave_function * get_cached_fcn (const octave_value_list& args) { return m_rep->get_cached_fcn (args); } - bool has_function_cache (void) const { return m_rep->has_function_cache (); } + bool has_function_cache () const { return m_rep->has_function_cache (); } - vm_call_dispatch_type vm_dispatch_call (void) + vm_call_dispatch_type vm_dispatch_call () { if (m_rep->has_function_cache ()) return vm_call_dispatch_type::OCT_CALL;
--- a/libinterp/octave-value/ov-fcn.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-fcn.h Sat Nov 25 16:47:19 2023 +0100 @@ -61,11 +61,11 @@ octave_base_value * clone () const { return new octave_fcn_cache (*this); } - bool is_function_cache (void) const { return true; } + bool is_function_cache () const { return true; } - bool has_function_cache (void) const { return true; } + bool has_function_cache () const { return true; } - vm_call_dispatch_type vm_dispatch_call (void) + vm_call_dispatch_type vm_dispatch_call () { return vm_call_dispatch_type::OCT_CALL; } @@ -322,7 +322,7 @@ execute (octave::tree_evaluator& tw, int nargout = 0, const octave_value_list& args = octave_value_list ()) = 0; - vm_call_dispatch_type vm_dispatch_call (void) + vm_call_dispatch_type vm_dispatch_call () { return vm_call_dispatch_type::OCT_CALL; } @@ -333,7 +333,7 @@ octave_function * get_cached_fcn (const octave_value_list&) { return function_value (); } - bool has_function_cache (void) const { return true; } + bool has_function_cache () const { return true; } protected:
--- a/libinterp/octave-value/ov-magic-int.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-magic-int.h Sat Nov 25 16:47:19 2023 +0100 @@ -85,7 +85,8 @@ bool is_storable () const { return false; } bool is_magic_int () const { return true; } - bool vm_need_storable_call (void) const { return true; } + + bool vm_need_storable_call () const { return true; } bool is_real_scalar () const { return true; }
--- a/libinterp/octave-value/ov-null-mat.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-null-mat.h Sat Nov 25 16:47:19 2023 +0100 @@ -52,7 +52,7 @@ static const octave_value instance; bool isnull () const { return true; } - bool vm_need_storable_call (void) const { return true; } + bool vm_need_storable_call () const { return true; } type_conv_info numeric_conversion_function () const; @@ -76,7 +76,7 @@ bool is_storable () const { return false; } bool isnull () const { return true; } - bool vm_need_storable_call (void) const { return true; } + bool vm_need_storable_call () const { return true; } type_conv_info numeric_conversion_function () const; @@ -100,7 +100,8 @@ bool is_storable () const { return false; } bool isnull () const { return true; } - bool vm_need_storable_call (void) const { return true; } + + bool vm_need_storable_call () const { return true; } type_conv_info numeric_conversion_function () const;
--- a/libinterp/octave-value/ov-range.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-range.h Sat Nov 25 16:47:19 2023 +0100 @@ -210,7 +210,8 @@ bool is_constant () const { return true; } bool is_range () const { return true; } - bool vm_need_storable_call (void) const { return true; } + + bool vm_need_storable_call () const { return true; } bool is_double_type () const { return builtin_type () == btyp_double; }
--- a/libinterp/octave-value/ov-ref.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-ref.h Sat Nov 25 16:47:19 2023 +0100 @@ -74,7 +74,7 @@ octave_value subsasgn (const std::string& type, const std::list<octave_value_list>& idx, const octave_value& rhs); octave_base_value * unique_clone (); bool is_defined () const; - bool is_maybe_function (void) const; + bool is_maybe_function () const; }; class OCTINTERP_API
--- a/libinterp/octave-value/ov-scalar.cc Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-scalar.cc Sat Nov 25 16:47:19 2023 +0100 @@ -126,13 +126,13 @@ } octave_value -octave_scalar::as_double_or_copy (void) +octave_scalar::as_double_or_copy () { return octave_value_factory::make_copy (this); } octave_value -octave_scalar::as_double (void) const +octave_scalar::as_double () const { return scalar; }
--- a/libinterp/octave-value/ov-scalar.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-scalar.h Sat Nov 25 16:47:19 2023 +0100 @@ -223,7 +223,7 @@ return boolNDArray (dim_vector (1, 1), scalar); } - octave_value as_double_or_copy (void); + octave_value as_double_or_copy (); bool maybe_update_double (double d) {
--- a/libinterp/octave-value/ov-struct.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov-struct.h Sat Nov 25 16:47:19 2023 +0100 @@ -165,7 +165,7 @@ bool fast_elem_insert (octave_idx_type n, const octave_value& x); - octave_base_value::vm_call_dispatch_type vm_dispatch_call (void) + octave_base_value::vm_call_dispatch_type vm_dispatch_call () { return vm_call_dispatch_type::OCT_SUBSREF; } @@ -295,7 +295,7 @@ bool fast_elem_insert_self (void *where, builtin_type_t btyp) const; - octave_base_value::vm_call_dispatch_type vm_dispatch_call (void) + octave_base_value::vm_call_dispatch_type vm_dispatch_call () { return vm_call_dispatch_type::OCT_SUBSREF; }
--- a/libinterp/octave-value/ov.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/octave-value/ov.h Sat Nov 25 16:47:19 2023 +0100 @@ -441,7 +441,7 @@ // Returns a copy of a scalar (double), or makes a scalar // for other types. - octave_value as_double_or_copy (void) const + octave_value as_double_or_copy () const { return m_rep->as_double_or_copy (); } octave_value as_double () const { return m_rep->as_double (); } @@ -1558,17 +1558,17 @@ octave_value_ref * ref_rep () { return m_rep->ref_rep (); } - bool is_nil (void) const { return m_rep == nil_rep (); } + bool is_nil () const { return m_rep == nil_rep (); } // True for the types based on ov-base-mat bool is_full_num_matrix () const { return m_rep->is_full_num_matrix (); } - bool is_function_cache (void) const + bool is_function_cache () const { return m_rep->is_function_cache (); } // function handles might have a function cache embedded - bool has_function_cache (void) const + bool has_function_cache () const { return m_rep->has_function_cache (); } octave_function * get_cached_fcn (const octave_value_list& args) @@ -1581,7 +1581,7 @@ // Returns true if the octave_value is either undefined or // or a function. - bool is_maybe_function (void) const + bool is_maybe_function () const { return m_rep->is_maybe_function (); } bool vm_need_storable_call () const
--- a/libinterp/parse-tree/pt-bytecode-walk.h Sat Nov 25 16:09:28 2023 +0100 +++ b/libinterp/parse-tree/pt-bytecode-walk.h Sat Nov 25 16:47:19 2023 +0100 @@ -143,9 +143,9 @@ ONE_OV_ON_STACK, }; - bytecode_walker (void) { } + bytecode_walker () { } - virtual ~bytecode_walker (void) = default; + virtual ~bytecode_walker () = default; // The bytecode will be put in this container bytecode m_code;
--- a/liboctave/numeric/sparse-chol.cc Sat Nov 25 16:09:28 2023 +0100 +++ b/liboctave/numeric/sparse-chol.cc Sat Nov 25 16:47:19 2023 +0100 @@ -94,7 +94,7 @@ return m_L; } - cholmod_common *cc (void) const + cholmod_common *cc () const { cholmod_common *ret = const_cast<cholmod_common *> (&m_common); return ret;