Update of /cvsroot/pure-data/externals/iem/iemmatrix/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21046
Modified Files:
mtx_max2.c mtx_min2.c mtx_rowrfft.c mtx_rowrifft.c
Log Message:
corrected malfunction in mtx_max2 and mtx_min2 and added some security to mtx_rowr(i)fft
Index: mtx_min2.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_min2.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mtx_min2.c 29 Mar 2006 12:07:52 -0000 1.2
--- mtx_min2.c 25 Aug 2007 09:27:45 -0000 1.3
***************
*** 37,41 ****
while(n--){
buf->a_type = A_FLOAT;
! buf++->a_w.w_float = atom_getfloat(ap++) + offset;
}
outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer);
--- 37,42 ----
while(n--){
buf->a_type = A_FLOAT;
! buf++->a_w.w_float = (atom_getfloat(ap)<offset)?atom_getfloat(ap):offset;
! ap++;
}
outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer);
***************
*** 51,55 ****
while(n--){
m->a_type = A_FLOAT;
! (m++)->a_w.w_float = atom_getfloat(argv++) + offset;
}
outlet_list(x->x_obj.ob_outlet, gensym("list"), argc, x->m.atombuffer);
--- 52,57 ----
while(n--){
m->a_type = A_FLOAT;
! (m++)->a_w.w_float = (atom_getfloat(argv)<offset)?atom_getfloat(argv):offset;
! argv++;
}
outlet_list(x->x_obj.ob_outlet, gensym("list"), argc, x->m.atombuffer);
Index: mtx_rowrifft.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_rowrifft.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** mtx_rowrifft.c 25 Jul 2006 14:15:22 -0000 1.7
--- mtx_rowrifft.c 25 Aug 2007 09:27:45 -0000 1.8
***************
*** 201,208 ****
static void deleteMTXRowrifft (MTXRowrifft *x)
{
! free(x->f_re);
! free(x->f_im);
! free(x->list_re);
! free(x->list_im);
}
--- 201,212 ----
static void deleteMTXRowrifft (MTXRowrifft *x)
{
! if (x->f_re)
! free(x->f_re);
! if (x->f_im)
! free(x->f_im);
! if (x->list_re)
! free(x->list_re);
! if (x->list_im)
! free(x->list_im);
}
Index: mtx_max2.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_max2.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mtx_max2.c 29 Mar 2006 12:07:52 -0000 1.2
--- mtx_max2.c 25 Aug 2007 09:27:45 -0000 1.3
***************
*** 37,41 ****
while(n--){
buf->a_type = A_FLOAT;
! buf++->a_w.w_float = atom_getfloat(ap++) + offset;
}
outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer);
--- 37,42 ----
while(n--){
buf->a_type = A_FLOAT;
! buf++->a_w.w_float = (atom_getfloat(ap)<offset)?:offset:atom_getfloat(ap);
! ap++;
}
outlet_anything(x->x_obj.ob_outlet, gensym("matrix"), argc, x->m.atombuffer);
***************
*** 51,55 ****
while(n--){
m->a_type = A_FLOAT;
! (m++)->a_w.w_float = atom_getfloat(argv++) + offset;
}
outlet_list(x->x_obj.ob_outlet, gensym("list"), argc, x->m.atombuffer);
--- 52,57 ----
while(n--){
m->a_type = A_FLOAT;
! (m++)->a_w.w_float = (atom_getfloat(argv)<offset)?:offset:atom_getfloat(argv);
! argv++;
}
outlet_list(x->x_obj.ob_outlet, gensym("list"), argc, x->m.atombuffer);
Index: mtx_rowrfft.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_rowrfft.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** mtx_rowrfft.c 25 Jul 2006 14:15:22 -0000 1.7
--- mtx_rowrfft.c 25 Aug 2007 09:27:45 -0000 1.8
***************
*** 37,44 ****
static void deleteMTXRowrfft (MTXRowrfft *x)
{
! free (x->f_re);
! free (x->f_im);
! free (x->list_re);
! free (x->list_im);
}
--- 37,48 ----
static void deleteMTXRowrfft (MTXRowrfft *x)
{
! if (x->f_re)
! free (x->f_re);
! if (x->f_im)
! free (x->f_im);
! if (x->list_re)
! free (x->list_re);
! if (x->list_im)
! free (x->list_im);
}