Mercurial > hg > octave-terminal
changeset 9389:0f85d9564057
fix result class calculation in pt-mat.cc
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Wed, 24 Jun 2009 18:51:33 +0200 |
parents | 5556563c6551 |
children | 288d5794eac8 |
files | src/ChangeLog src/pt-mat.cc |
diffstat | 2 files changed, 13 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2009-06-24 Jaroslav Hajek <highegg@gmail.com> + + * pt-mat.cc (get_concat_class): Use empty string as zero value. + (tm_row_const_rep::tm_row_const_rep): Initialize class_nm to empty + string. + (tm_const::tm_const): Ditto. + 2009-06-24 John W. Eaton <jwe@octave.org> * pt-assign.cc (former_built_in_variables): Remove "ans" from the list.
--- a/src/pt-mat.cc +++ b/src/pt-mat.cc @@ -68,14 +68,14 @@ all_sq_str (false), all_dq_str (false), some_str (false), all_real (false), all_cmplx (false), all_mt (true), any_sparse (false), any_class (false), - class_nm (octave_base_value::static_class_name ()), ok (false) + class_nm (), ok (false) { } tm_row_const_rep (const tree_argument_list& row) : count (1), dv (0, 0), all_str (false), all_sq_str (false), some_str (false), all_real (false), all_cmplx (false), all_mt (true), any_sparse (false), any_class (false), - class_nm (octave_base_value::static_class_name ()), ok (false) + class_nm (), ok (false) { init (row); } ~tm_row_const_rep (void) { } @@ -195,8 +195,10 @@ if (c1 == c2) retval = c1; - else if (c1 == retval) + else if (c1.empty ()) retval = c2; + else if (c2.empty ()) + retval = c1; else { bool c1_is_int = (c1 == "int8" || c1 == "uint8" @@ -448,7 +450,7 @@ : dv (0, 0), all_str (false), all_sq_str (false), all_dq_str (false), some_str (false), all_real (false), all_cmplx (false), all_mt (true), any_sparse (false), any_class (false), - class_nm (octave_base_value::static_class_name ()), ok (false) + class_nm (), ok (false) { init (tm); } ~tm_const (void) { }