Mercurial > octave-nkf
changeset 3661:1d8d6429396a
[project @ 2000-04-23 08:23:08 by jwe]
author | jwe |
---|---|
date | Sun, 23 Apr 2000 08:23:09 +0000 |
parents | 2dc265765850 |
children | 74dc2917b75f |
files | src/ChangeLog src/pt-mat.cc |
diffstat | 2 files changed, 25 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Thu Apr 20 08:23:47 2000 +0000 +++ b/src/ChangeLog Sun Apr 23 08:23:09 2000 +0000 @@ -1,3 +1,10 @@ +2000-04-23 etienne grossmann <etienne@anonimo.isr.ist.utl.pt> + + * pt-mat.cc (tm_row_const::tm_row_const_rep::eval_error): + New args x and y, for dimension mismatch info. + Change callers where appropriate. + (tm_const::init): Report mismatched column dimensions. + 2000-04-11 John W. Eaton <jwe@bevo.che.wisc.edu> * sysdep.cc (kbhit): Also clear cin if at EOF.
--- a/src/pt-mat.cc Thu Apr 20 08:23:47 2000 +0000 +++ b/src/pt-mat.cc Sun Apr 23 08:23:09 2000 +0000 @@ -103,7 +103,8 @@ tm_row_const_rep& operator = (const tm_row_const_rep&); - void eval_error (const char *msg, int l, int c) const; + void eval_error (const char *msg, int l, int c, + int x = -1, int y = -1) const; void eval_warning (const char *msg, int l, int c) const; }; @@ -213,7 +214,7 @@ else if (this_elt_nr != nr) { eval_error ("number of rows must match", - elt->line (), elt->column ()); + elt->line (), elt->column (), this_elt_nr, nr); break; } @@ -238,12 +239,22 @@ void tm_row_const::tm_row_const_rep::eval_error (const char *msg, int l, - int c) const + int c, int x, int y) const { if (l == -1 && c == -1) - ::error ("%s", msg); + { + if (x == -1 || y == -1) + ::error ("%s", msg); + else + ::error ("%s (%d != %d)", msg, x, y); + } else - ::error ("%s near line %d, column %d", msg, l, c); + { + if (x == -1 || y == -1) + ::error ("%s near line %d, column %d", msg, l, c); + else + ::error ("%s (%d != %d) near line %d, column %d", msg, x, y, l, c); + } } void @@ -380,7 +391,8 @@ } else if (this_elt_nc != nc) { - ::error ("number of columns must match"); + ::error ("number of columns must match (%d != %d)", + this_elt_nc, nc); break; }