Update of /cvsroot/pure-data/externals/iem/iemmatrix/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5884
Modified Files: mtx_concat.c Log Message: code cleanup
Index: mtx_concat.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_concat.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mtx_concat.c 29 Mar 2006 12:07:52 -0000 1.2 --- mtx_concat.c 29 Mar 2006 12:53:36 -0000 1.3 *************** *** 21,32 **** struct _MTXconcat_ { ! t_object x_obj; ! int size; ! t_symbol *concat_mode; ! t_matrix mtx_in1; ! t_matrix mtx_in2; ! t_matrix mtx_out; ! ! t_outlet *outl; };
--- 21,32 ---- struct _MTXconcat_ { ! t_object x_obj; ! int size; ! int concat_mode; ! t_matrix mtx_in1; ! t_matrix mtx_in2; ! t_matrix mtx_out; ! ! t_outlet *outl; };
*************** *** 39,43 **** static void mTXSetConcatMode (MTXconcat *mtx_concat_obj, t_symbol *c_mode) { ! mtx_concat_obj->concat_mode = c_mode; }
--- 39,54 ---- static void mTXSetConcatMode (MTXconcat *mtx_concat_obj, t_symbol *c_mode) { ! char c=*c_mode->s_name; ! switch(c){ ! case 'c': case 'C': case ':': /* "column" */ ! mtx_concat_obj->concat_mode = 1; ! break; ! case 'r': case 'R': /* "row" */ ! mtx_concat_obj->concat_mode = 0; ! break; ! default: ! error("mtx_concat: invalid mode '%s'", c_mode->s_name); ! break; ! } }
*************** *** 45,52 **** { MTXconcat *mtx_concat_obj = (MTXconcat *) pd_new (mtx_concat_class); ! ! mTXSetConcatMode (mtx_concat_obj, gensym(":")); ! if ((argc>=1)) ! mTXSetConcatMode (mtx_concat_obj, atom_getsymbol(argv));
mtx_concat_obj->outl = mtx_concat_obj->mtx_out.x_outlet = outlet_new (&mtx_concat_obj->x_obj, gensym("matrix")); --- 56,63 ---- { MTXconcat *mtx_concat_obj = (MTXconcat *) pd_new (mtx_concat_class); ! if(argc&&(A_SYMBOL==argv->a_type)) ! mTXSetConcatMode (mtx_concat_obj, atom_getsymbol (argv)); ! else ! mTXSetConcatMode (mtx_concat_obj, gensym(":"));
mtx_concat_obj->outl = mtx_concat_obj->mtx_out.x_outlet = outlet_new (&mtx_concat_obj->x_obj, gensym("matrix")); *************** *** 154,158 **** // matrix_matrix2 (mtx_in1, s, argc, argv);
! if (mtx_concat_obj->concat_mode == row_sym) { mTXConcatDoRowConcatenation(mtx_concat_obj, mtx_in1, mtx_in2, mtx_out); } --- 165,169 ---- // matrix_matrix2 (mtx_in1, s, argc, argv);
! if (mtx_concat_obj->concat_mode == 0) { mTXConcatDoRowConcatenation(mtx_concat_obj, mtx_in1, mtx_in2, mtx_out); }