changeset 12019:e1695d65a5ca release-3-2-x

fix result class calculation in pt-mat.cc
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 25 Jun 2009 06:36:24 +0200
parents d6ddf4f33b1c
children ec3e48253503
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) { }