Update of /cvsroot/pure-data/externals/iem/iemmatrix/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19022
Modified Files: mtx_element.c mtx_fill.c mtx_inverse.c mtx_matrix.c mtx_mul~.c mtx_resize.c Log Message: make errors findable with "last error"
Index: mtx_matrix.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_matrix.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mtx_matrix.c 11 May 2005 13:05:29 -0000 1.3 --- mtx_matrix.c 24 Oct 2005 17:06:37 -0000 1.4 *************** *** 443,447 ****
if (binbuf_read_via_path(bbuf, filename->s_name, canvas_getdir(x->x_canvas)->s_name, 0)) ! error("matrix: failed to read %s", filename->s_name);
ap=binbuf_getvec(bbuf); --- 443,447 ----
if (binbuf_read_via_path(bbuf, filename->s_name, canvas_getdir(x->x_canvas)->s_name, 0)) ! pd_error(x,"matrix: failed to read %s", filename->s_name);
ap=binbuf_getvec(bbuf); *************** *** 466,470 **** /* open file */ if (!(f = fopen(filnam, "w"))) { ! error("matrix : failed to open %s", filnam); } else { char *text=(char *)getbytes(sizeof(char)*MAXPDSTRING); --- 466,470 ---- /* open file */ if (!(f = fopen(filnam, "w"))) { ! pd_error(x,"matrix : failed to open %s", filnam); } else { char *text=(char *)getbytes(sizeof(char)*MAXPDSTRING); *************** *** 479,483 **** textlen = strlen(text); if (fwrite(text, textlen*sizeof(char), 1, f) < 1) { ! error("matrix : failed to write %s", filnam); goto end; }
--- 479,483 ---- textlen = strlen(text); if (fwrite(text, textlen*sizeof(char), 1, f) < 1) { ! pd_error(x,"matrix : failed to write %s", filnam); goto end; }
*************** *** 489,497 **** textlen=strlen(text); if (fwrite(text, textlen*sizeof(char), 1, f) < 1) { ! error("matrix : failed to write %s", filnam); goto end; } } if (fwrite("\n", sizeof(char), 1, f) < 1) { ! error("matrix : failed to write %s", filnam); goto end; } } --- 489,497 ---- textlen=strlen(text); if (fwrite(text, textlen*sizeof(char), 1, f) < 1) { ! pd_error(x,"matrix : failed to write %s", filnam); goto end; } } if (fwrite("\n", sizeof(char), 1, f) < 1) { ! pd_error(x, "matrix : failed to write %s", filnam); goto end; } }
Index: mtx_element.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_element.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mtx_element.c 11 May 2005 13:05:29 -0000 1.3 --- mtx_element.c 24 Oct 2005 17:06:37 -0000 1.4 *************** *** 40,44 **** { if(x->current_col>x->col || x->current_row>x->row){ ! error("mtx_element: element position exceeds matrix dimensions"); return; } --- 40,44 ---- { if(x->current_col>x->col || x->current_row>x->row){ ! pd_error(x,"mtx_element: element position exceeds matrix dimensions"); return; }
Index: mtx_inverse.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_inverse.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mtx_inverse.c 11 May 2005 14:31:27 -0000 1.5 --- mtx_inverse.c 24 Oct 2005 17:06:37 -0000 1.6 *************** *** 78,82 **** } } - if (ok)post("mtx_inverse: couldn't really invert the matrix !!! %d error%c", ok, (ok-1)?'s':0); if(error!=0)*error=ok;
--- 78,81 ---- *************** *** 135,139 **** freebytes(original, sizeof(t_matrixfloat)*row*col);
! if(error)outlet_bang(x->x_outlet);
/* 3c output the atombuf; */ --- 134,141 ---- freebytes(original, sizeof(t_matrixfloat)*row*col);
! if(error){ ! outlet_bang(x->x_outlet); ! pd_error(x, "mtx_inverse: couldn't really invert the matrix !!! %d error%c", error, (error-1)?'s':0); ! }
/* 3c output the atombuf; */
Index: mtx_resize.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_resize.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mtx_resize.c 12 Apr 2005 09:01:36 -0000 1.2 --- mtx_resize.c 24 Oct 2005 17:06:37 -0000 1.3 *************** *** 21,25 **** int r, c; if (argc<1)return; ! if (argc>2)error("mtx_resize : only rows & cols are needed, skipping the rest"); if (argc==1)r=c=atom_getfloat(argv++); else{ --- 21,25 ---- int r, c; if (argc<1)return; ! if (argc>2)pd_error(x, "mtx_resize : only rows & cols are needed, skipping the rest"); if (argc==1)r=c=atom_getfloat(argv++); else{
Index: mtx_fill.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_fill.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mtx_fill.c 14 Oct 2005 10:01:34 -0000 1.3 --- mtx_fill.c 24 Oct 2005 17:06:37 -0000 1.4 *************** *** 163,167 **** mTXFillIndexMatrix (mtx_fill_obj, s, argc-1, argv+1); else ! post("mtx_fill: creation argument must be 'matrix <startrow> <startcol>' for submatrix filling or 'matrix rows columns [...]' for indexed filling with scalar/matrices"); }
--- 163,167 ---- mTXFillIndexMatrix (mtx_fill_obj, s, argc-1, argv+1); else ! pd_error(mtx_fill_obj, "mtx_fill: creation argument must be 'matrix <startrow> <startcol>' for submatrix filling or 'matrix rows columns [...]' for indexed filling with scalar/matrices"); }
Index: mtx_mul~.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_mul~.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mtx_mul~.c 19 Sep 2005 13:08:53 -0000 1.3 --- mtx_mul~.c 24 Oct 2005 17:06:37 -0000 1.4 *************** *** 827,835 ****
if(s==gensym("matrix~")){ ! error("[matrix~] is deprecated! use [mtx_*~] instead!!"); x->x_compat=2; } else if (s==gensym("matrix_mul_line~")){ ! error("[matrix_mul_line~] is deprecated! use [mtx_*~] instead!!"); x->x_compat=1; } --- 827,835 ----
if(s==gensym("matrix~")){ ! pd_error(x,"[matrix~] is deprecated! use [mtx_*~] instead!!"); x->x_compat=2; } else if (s==gensym("matrix_mul_line~")){ ! pd_error(x,"[matrix_mul_line~] is deprecated! use [mtx_*~] instead!!"); x->x_compat=1; }