Mercurial > octave
changeset 21333:c4690d9ff566
avoid warnings about overloading virtual functions from a base class
* pt-id.h (tree_black_hole::dup): Fix decl.
* pt.h (tree::set_breakpoint): Fix decl.
* audiodevinfo.cc (audioplayer::print, audiorecorder::print):
Fix decl.
* gl2ps-print.cc, ov-base-mat.h, ov-base-sparse.h, pt-array-list.h:
Import virtual functions from base class that are overloaded in the
derived class.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 24 Feb 2016 11:08:45 -0500 |
parents | db574711df78 |
children | 36e75e013849 |
files | libinterp/corefcn/gl2ps-print.cc libinterp/dldfcn/audiodevinfo.cc libinterp/octave-value/ov-base-mat.h libinterp/octave-value/ov-base-sparse.h libinterp/parse-tree/pt-array-list.h libinterp/parse-tree/pt-id.h libinterp/parse-tree/pt.h |
diffstat | 7 files changed, 38 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/gl2ps-print.cc Wed Feb 24 09:52:27 2016 -0500 +++ b/libinterp/corefcn/gl2ps-print.cc Wed Feb 24 11:08:45 2016 -0500 @@ -56,6 +56,13 @@ ~gl2ps_renderer (void) { } + // FIXME: should we import the functions from the base class and + // overload them here, or should we use a different name so we don't + // have to do this? Without the using declaration or a name change, + // the base class functions will be hidden. That may be OK, but it + // can also cause some confusion. + using opengl_renderer::draw; + void draw (const graphics_object& go, const std::string& print_cmd); protected:
--- a/libinterp/dldfcn/audiodevinfo.cc Wed Feb 24 09:52:27 2016 -0500 +++ b/libinterp/dldfcn/audiodevinfo.cc Wed Feb 24 11:08:45 2016 -0500 @@ -460,7 +460,7 @@ // Overloaded base functions double player_value (void) const { return 0; } virtual double scalar_value (bool = false) const { return 0; } - void print (std::ostream& os, bool pr_as_read_syntax = false) const; + void print (std::ostream& os, bool pr_as_read_syntax = false); void print_raw (std::ostream& os, bool pr_as_read_syntax) const; // Properties @@ -832,7 +832,7 @@ } void -audioplayer::print (std::ostream& os, bool pr_as_read_syntax) const +audioplayer::print (std::ostream& os, bool pr_as_read_syntax) { print_raw (os, pr_as_read_syntax); newline (os); @@ -1219,7 +1219,7 @@ // Overloaded base functions double player_value (void) const { return 0; } virtual double scalar_value (bool = false) const { return 0; } - void print (std::ostream& os, bool pr_as_read_syntax = false) const; + void print (std::ostream& os, bool pr_as_read_syntax = false); void print_raw (std::ostream& os, bool pr_as_read_syntax) const; // Properties @@ -1467,7 +1467,7 @@ } void -audiorecorder::print (std::ostream& os, bool pr_as_read_syntax) const +audiorecorder::print (std::ostream& os, bool pr_as_read_syntax) { print_raw (os, pr_as_read_syntax); newline (os);
--- a/libinterp/octave-value/ov-base-mat.h Wed Feb 24 09:52:27 2016 -0500 +++ b/libinterp/octave-value/ov-base-mat.h Wed Feb 24 11:08:45 2016 -0500 @@ -94,6 +94,13 @@ octave_value_list do_multi_index_op (int, const octave_value_list& idx) { return do_index_op (idx); } + // FIXME: should we import the functions from the base class and + // overload them here, or should we use a different name so we don't + // have to do this? Without the using declaration or a name change, + // the base class functions will be hidden. That may be OK, but it + // can also cause some confusion. + using octave_base_value::assign; + void assign (const octave_value_list& idx, const MT& rhs); void assign (const octave_value_list& idx, typename MT::element_type rhs);
--- a/libinterp/octave-value/ov-base-sparse.h Wed Feb 24 09:52:27 2016 -0500 +++ b/libinterp/octave-value/ov-base-sparse.h Wed Feb 24 11:08:45 2016 -0500 @@ -97,6 +97,13 @@ const std::list<octave_value_list>& idx, const octave_value& rhs); + // FIXME: should we import the functions from the base class and + // overload them here, or should we use a different name so we don't + // have to do this? Without the using declaration or a name change, + // the base class functions will be hidden. That may be OK, but it + // can also cause some confusion. + using octave_base_value::assign; + void assign (const octave_value_list& idx, const T& rhs); void delete_elements (const octave_value_list& idx);
--- a/libinterp/parse-tree/pt-array-list.h Wed Feb 24 09:52:27 2016 -0500 +++ b/libinterp/parse-tree/pt-array-list.h Wed Feb 24 11:08:45 2016 -0500 @@ -54,6 +54,13 @@ bool has_magic_end (void) const; + // FIXME: should we import the functions from the base class and + // overload them here, or should we use a different name so we don't + // have to do this? Without the using declaration or a name change, + // the base class functions will be hidden. That may be OK, but it + // can also cause some confusion. + using tree_expression::copy_base; + void copy_base (const tree_array_list& array_list); void copy_base (const tree_array_list& array_list,
--- a/libinterp/parse-tree/pt-id.h Wed Feb 24 09:52:27 2016 -0500 +++ b/libinterp/parse-tree/pt-id.h Wed Feb 24 11:08:45 2016 -0500 @@ -158,8 +158,11 @@ bool is_black_hole (void) { return true; } - tree_black_hole *dup (void) const - { return new tree_black_hole; } + tree_black_hole *dup (symbol_table::scope_id, + symbol_table::context_id) const + { + return new tree_black_hole; + } octave_lvalue lvalue (void) {
--- a/libinterp/parse-tree/pt.h Wed Feb 24 09:52:27 2016 -0500 +++ b/libinterp/parse-tree/pt.h Wed Feb 24 11:08:45 2016 -0500 @@ -60,7 +60,7 @@ column_num = c; } - virtual void set_breakpoint (std::string condition) + virtual void set_breakpoint (const std::string& condition) { if (bp) *bp = condition; else