# HG changeset patch # User jwe # Date 1130427809 0 # Node ID e0011660696ceb5e1955974f8e21d702dc242897 # Parent 843fa0a80229c6ee892278dd8182578bf9f005e6 [project @ 2005-10-27 15:43:29 by jwe] diff -r 843fa0a80229 -r e0011660696c src/ChangeLog --- a/src/ChangeLog Thu Oct 27 02:44:43 2005 +0000 +++ b/src/ChangeLog Thu Oct 27 15:43:29 2005 +0000 @@ -1,3 +1,11 @@ +2005-10-27 John W. Eaton + + * pt-mat.cc (tm_row_const::tm_row_const_rep::tm_row_const_rep): + Ensure that we always have at least two dimensions here. + (tm_const::tm_const): Likewise. + (tm_const::rows, tm_const::columns): Simplify. + (tm_row_const::rows, tm_row_const::columns)): Simplify. + 2005-10-26 John W. Eaton * oct-procbuf.cc (octave_procbuf::open): Cast 0 to void * to avoid diff -r 843fa0a80229 -r e0011660696c src/pt-mat.cc --- a/src/pt-mat.cc Thu Oct 27 02:44:43 2005 +0000 +++ b/src/pt-mat.cc Thu Oct 27 15:43:29 2005 +0000 @@ -67,13 +67,13 @@ public: tm_row_const_rep (void) - : count (1), dv (), all_str (false), + : count (1), 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), ok (false) { } tm_row_const_rep (const tree_argument_list& row) - : count (1), dv (), all_str (false), all_sq_str (false), + : count (1), dv (0, 0), all_str (false), all_sq_str (false), some_str (false), all_real (false), all_cmplx (false), all_mt (true), ok (false) { init (row); } @@ -150,11 +150,8 @@ delete rep; } - octave_idx_type rows (void) - { return (rep->dv.length () > 0 ? rep->dv(0) : 0); } - - octave_idx_type cols (void) - { return (rep->dv.length () > 1 ? rep->dv(1) : 0); } + octave_idx_type rows (void) { return rep->dv(0); } + octave_idx_type cols (void) { return rep->dv(1); } dim_vector dims (void) { return rep->dv; } @@ -357,15 +354,15 @@ public: tm_const (const tree_matrix& tm) - : dv (), all_str (false), all_sq_str (false), all_dq_str (false), + : 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), ok (false) { init (tm); } ~tm_const (void) { } - octave_idx_type rows (void) const { return (dv.length () > 0 ? dv.elem (0) : 0); } - octave_idx_type cols (void) const { return (dv.length () > 1 ? dv.elem (1) : 0); } + octave_idx_type rows (void) const { return dv.elem (0); } + octave_idx_type cols (void) const { return dv.elem (1); } dim_vector dims (void) const { return dv; }