Mercurial > hg > octave-avbm
changeset 3871:b747adc02286
[project @ 2002-02-23 02:48:52 by jwe]
author | jwe |
---|---|
date | Sat, 23 Feb 2002 02:48:52 +0000 |
parents | a9baa340ea51 |
children | 57d51184b669 |
files | src/ChangeLog src/ov-scalar.cc src/ov-usr-fcn.cc |
diffstat | 3 files changed, 21 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,13 @@ 2002-02-22 John W. Eaton <jwe@bevo.che.wisc.edu> + * ov-usr-fcn.cc (octave_user_function::do_multi_index_op): + Handle define_all_return_values after function is evaluated. + From Paul Kienzle <pkienzle@jazz.ncnr.nist.gov>. + + * ov-scalar.cc (convert_to_str): Use octave_value (std::string) + constructor instead of octave_value (char *) constructor so that + setstr (0) will work. + * pager.cc (octave_pager_buf::sync): Set pointer to beginning of buffer after calling flush_currnt_contents_to_diary. (octave_diary_buf::sync): Call eback only once.
--- a/src/ov-scalar.cc +++ b/src/ov-scalar.cc @@ -98,12 +98,8 @@ else { // XXX FIXME XXX -- warn about out of range conversions? - - int i = NINT (scalar); - char s[2]; - s[0] = (char) i; - s[1] = '\0'; - retval = octave_value (s); + + retval = octave_value (std::string (1, char (NINT (scalar)))); } return retval;
--- a/src/ov-usr-fcn.cc +++ b/src/ov-usr-fcn.cc @@ -355,14 +355,6 @@ unwind_protect::add (clear_param_list, param_list); - if (ret_list && Vdefine_all_return_values) - { - octave_value tmp = builtin_any_variable ("default_return_value"); - - if (tmp.is_defined ()) - ret_list->initialize_undefined_elements (tmp); - } - // Force return list to be undefined when this function exits. // Doing so decrements the reference counts on the values of local // variables that are also named values returned by this function. @@ -411,7 +403,17 @@ // Copy return values out. if (ret_list) - retval = ret_list->convert_to_const_vector (vr_list); + { + if (Vdefine_all_return_values) + { + octave_value tmp = builtin_any_variable ("default_return_value"); + + if (tmp.is_defined ()) + ret_list->initialize_undefined_elements (tmp); + } + + retval = ret_list->convert_to_const_vector (vr_list); + } else if (Vreturn_last_computed_value) retval(0) = last_computed_value; }