Mercurial > hg > octave-terminal
changeset 10754:92eb5fb58ebc
fix resize with structs
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 25 Jun 2010 10:19:26 +0200 |
parents | bee1b1a2e29a |
children | 6ba7937a6fa4 |
files | src/ChangeLog src/ov-struct.cc src/ov-struct.h src/ov.cc |
diffstat | 4 files changed, 13 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-06-25 Jaroslav Hajek <highegg@gmail.com> + + * ov-struct.h (octave_scalar_struct::resize, octave_struct::resize): + Don't ignore fill argument. + 2010-06-25 Jaroslav Hajek <highegg@gmail.com> * oct-map.h (octave_map::octave_map (const dim_vector&, const
--- a/src/ov-struct.cc +++ b/src/ov-struct.cc @@ -555,6 +555,8 @@ else gripe_failed_assignment (); + retval.maybe_mutate (); + return retval; }
--- a/src/ov-struct.h +++ b/src/ov-struct.h @@ -115,8 +115,8 @@ octave_value reshape (const dim_vector& new_dims) const { return map.reshape (new_dims); } - octave_value resize (const dim_vector& dv, bool = false) const - { octave_map tmap = map; tmap.resize (dv); return tmap; } + octave_value resize (const dim_vector& dv, bool fill = false) const + { octave_map tmap = map; tmap.resize (dv, fill); return tmap; } bool is_defined (void) const { return true; } @@ -228,8 +228,8 @@ octave_value reshape (const dim_vector& new_dims) const { return octave_map (map).reshape (new_dims); } - octave_value resize (const dim_vector& dv, bool = false) const - { octave_map tmap = map; tmap.resize (dv); return tmap; } + octave_value resize (const dim_vector& dv, bool fill = false) const + { octave_map tmap = map; tmap.resize (dv, fill); return tmap; } bool is_defined (void) const { return true; }
--- a/src/ov.cc +++ b/src/ov.cc @@ -2593,7 +2593,7 @@ case '(': { if (type.length () > 1 && type[1] == '.') - retval = Octave_map (); + retval = octave_map (); else retval = octave_value (rhs.empty_clone ()); } @@ -2604,7 +2604,7 @@ break; case '.': - retval = Octave_map (); + retval = octave_scalar_map (); break; default: