Mercurial > hg > octave-lyh
diff src/pt-const.h @ 399:e3228e053d06
[project @ 1994-04-09 23:01:20 by jwe]
author | jwe |
---|---|
date | Sat, 09 Apr 1994 23:01:28 +0000 |
parents | 0b52c68ec81f |
children | fa0453b25410 |
line wrap: on
line diff
--- a/src/pt-const.h +++ b/src/pt-const.h @@ -77,7 +77,8 @@ // the tree_constant_rep class #define REP_RHS_MATRIX(tc,m,cm,nr,nc) \ - int nr, nc; \ + int nr = 0; \ + int nc = 0; \ Matrix m; \ ComplexMatrix cm; \ if ((tc).const_type () == tree_constant_rep::complex_matrix_constant) \ @@ -86,12 +87,14 @@ nr = (cm).rows (); \ nc = (cm).columns (); \ } \ - else \ + else if ((tc).const_type () == tree_constant_rep::matrix_constant) \ { \ m = (tc).matrix_value (); \ nr = (m).rows (); \ nc = (m).columns (); \ - } + } \ + else \ + abort (); // Assign a real or complex value to a tree_constant. // @@ -129,17 +132,11 @@ Matrix m; \ ComplexMatrix cm; \ if (type_tag == tree_constant_rep::matrix_constant) \ - { \ - (m).resize ((nr), (nc)); \ - } \ + (m).resize ((nr), (nc)); \ else if (type_tag == complex_matrix_constant) \ - { \ - (cm).resize ((nr), (nc)); \ - } \ + (cm).resize ((nr), (nc)); \ else \ - { \ - abort (); \ - } + abort (); \ // Assign a real or complex matrix to a tree constant.