Mercurial > hg > octave-avbm
changeset 663:9293c023dd2d
[project @ 1994-08-30 22:19:28 by jwe]
author | jwe |
---|---|
date | Tue, 30 Aug 1994 22:19:28 +0000 |
parents | fdf4ce2d855e |
children | 7d86cace6e7f |
files | src/pt-exp-base.cc |
diffstat | 1 files changed, 19 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/src/pt-exp-base.cc +++ b/src/pt-exp-base.cc @@ -36,6 +36,7 @@ #include <iostream.h> #include <strstream.h> +#include <string.h> #include <limits.h> #include <ctype.h> #include <stdio.h> @@ -487,13 +488,10 @@ { cm (put_row, put_col) = tmp.double_value (); } - else if (tmp.is_string ()) + else if (tmp.is_string () && all_strings && str_ptr) { - if (all_strings && str_ptr) - { - memcpy (str_ptr, tmp.string_value (), nc); - str_ptr += nc; - } + memcpy (str_ptr, tmp.string_value (), nc); + str_ptr += nc; } else if (tmp.is_real_matrix () || tmp.is_range ()) { @@ -503,13 +501,14 @@ { cm (put_row, put_col) = tmp.complex_value (); } - else if (tmp.is_complex_matrix ()) - { - cm.insert (tmp.complex_matrix_value (), put_row, put_col); - } else { - panic_impossible (); + ComplexMatrix cm_tmp = tmp.complex_matrix_value (); + + if (error_state) + goto done; + + cm.insert (cm_tmp, put_row, put_col); } } else @@ -518,21 +517,19 @@ { m (put_row, put_col) = tmp.double_value (); } - else if (tmp.is_string ()) + else if (tmp.is_string () && all_strings && str_ptr) { - if (all_strings && str_ptr) - { - memcpy (str_ptr, tmp.string_value (), nc); - str_ptr += nc; - } - } - else if (tmp.is_real_matrix () || tmp.is_range ()) - { - m.insert (tmp.matrix_value (), put_row, put_col); + memcpy (str_ptr, tmp.string_value (), nc); + str_ptr += nc; } else { - panic_impossible (); + Matrix m_tmp = tmp.matrix_value (); + + if (error_state) + goto done; + + m.insert (m_tmp, put_row, put_col); } }