# HG changeset patch # User Jaroslav Hajek # Date 1245904584 -7200 # Node ID e1695d65a5ca24cff9bdb1d765daf02d39be562c # Parent d6ddf4f33b1c333646605dd4663ffb80b843171e fix result class calculation in pt-mat.cc diff -r d6ddf4f33b1c -r e1695d65a5ca src/ChangeLog --- a/src/ChangeLog Thu Jun 25 06:36:19 2009 +0200 +++ b/src/ChangeLog Thu Jun 25 06:36:24 2009 +0200 @@ -1,3 +1,10 @@ +2009-06-24 Jaroslav Hajek + + * 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 * pt-assign.cc (former_built_in_variables): Remove "ans" from the list. diff -r d6ddf4f33b1c -r e1695d65a5ca src/pt-mat.cc --- a/src/pt-mat.cc Thu Jun 25 06:36:19 2009 +0200 +++ b/src/pt-mat.cc Thu Jun 25 06:36:24 2009 +0200 @@ -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) { }