Update of /cvsroot/pure-data/externals/iem/iemmatrix/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4281
Modified Files:
mtx_abs.c mtx_cholesky.c mtx_conv.c mtx_cos.c mtx_cumsum.c
mtx_dbtorms.c mtx_diff.c mtx_exp.c mtx_find.c mtx_gauss.c
mtx_index.c mtx_int.c mtx_log.c mtx_minmax.c mtx_not.c
mtx_repmat.c mtx_reverse.c mtx_rmstodb.c mtx_rowrfft.c
mtx_rowrifft.c mtx_sin.c mtx_slice.c mtx_sort.c
Log Message:
ran with "-Wall" and fixed naughtinesses
shut up warnings and errors on vc7
Index: mtx_sort.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_sort.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mtx_sort.c 22 Sep 2005 09:28:55 -0000 1.2
--- mtx_sort.c 23 Oct 2005 19:50:45 -0000 1.3
***************
*** 76,84 ****
if (argv[0].a_type == A_SYMBOL) {
mTXSetSortMode (mtx_sort_obj, atom_getsymbol (argv));
! if (argc>=2)
if (argv[1].a_type != A_SYMBOL)
mTXSetSortDirection (mtx_sort_obj, atom_getfloat (argv+1));
else
post("mtx_sort: 2nd arg ignored. supposed to be float");
}
else {
--- 76,85 ----
if (argv[0].a_type == A_SYMBOL) {
mTXSetSortMode (mtx_sort_obj, atom_getsymbol (argv));
! if (argc>=2) {
if (argv[1].a_type != A_SYMBOL)
mTXSetSortDirection (mtx_sort_obj, atom_getfloat (argv+1));
else
post("mtx_sort: 2nd arg ignored. supposed to be float");
+ }
}
else {
Index: mtx_cholesky.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_cholesky.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mtx_cholesky.c 27 Apr 2005 16:51:59 -0000 1.1
--- mtx_cholesky.c 23 Oct 2005 19:50:45 -0000 1.2
***************
*** 31,37 ****
t_matrixfloat *original, *cholesky;
- t_matrixfloat *a1, *b1; // dummy pointers
-
- int ok = 0;
if(row*col+2>argc){
--- 31,34 ----
Index: mtx_minmax.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_minmax.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** mtx_minmax.c 26 Sep 2005 07:57:02 -0000 1.3
--- mtx_minmax.c 23 Oct 2005 19:50:45 -0000 1.4
***************
*** 180,184 ****
t_atom *list_in = argv;
t_atom *list_out = mtx_minmax_obj->list_out;
- int count;
int rows_out;
int columns_out;
--- 180,183 ----
Index: mtx_conv.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_conv.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mtx_conv.c 14 Oct 2005 10:02:44 -0000 1.2
--- mtx_conv.c 23 Oct 2005 19:50:45 -0000 1.3
***************
*** 71,75 ****
{
t_float **mtx = old;
! int count1, count2;
post("resizing from %dx%d to %dx%d", rows_old, columns_old, rows_new, columns_new);
--- 71,75 ----
{
t_float **mtx = old;
! int count1;
post("resizing from %dx%d to %dx%d", rows_old, columns_old, rows_new, columns_new);
***************
*** 77,81 ****
deleteTFloatMatrix (old, rows_old, columns_old);
old = 0;
! return;
}
// 1. if rows_old>rows_new: old row disposal
--- 77,81 ----
deleteTFloatMatrix (old, rows_old, columns_old);
old = 0;
! return old;
}
// 1. if rows_old>rows_new: old row disposal
***************
*** 99,103 ****
*mtx = (t_float *) getbytes (sizeof(t_float) * columns_new);
}
! post("return resize");
return old;
}
--- 99,103 ----
*mtx = (t_float *) getbytes (sizeof(t_float) * columns_new);
}
! /* post("return resize"); */
return old;
}
***************
*** 105,109 ****
static void deleteMTXConv (MTXConv *mtx_conv_obj)
{
- int count = mtx_conv_obj->rows;
deleteTFloatMatrix (mtx_conv_obj->k, mtx_conv_obj->rows_k, mtx_conv_obj->columns_k);
deleteTFloatMatrix (mtx_conv_obj->x, mtx_conv_obj->rows, mtx_conv_obj->columns);
--- 105,108 ----
***************
*** 162,175 ****
*f++ = atom_getfloat (l++);
}
- static void scaleVector (int n, t_float *x, t_float *y, t_float k)
- {
- while (n--)
- *y++ = k * *x++;
- }
- static void addWeightedVector (int n, t_float *x, t_float *y, t_float k)
- {
- while (n--)
- *y++ += k * *y++;
- }
static void readMatrixFromList (int rows, int columns, t_atom *l, t_float **mtx)
{
--- 161,164 ----
***************
*** 250,259 ****
t_float **y = mtx_conv_obj->y;
t_float **k = mtx_conv_obj->k;
- t_float *ptr1;
- t_float *ptr2;
- int row_count;
- int offset1;
- int offset2;
- int count;
// fftsize check
--- 239,242 ----
Index: mtx_log.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_log.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mtx_log.c 14 Jun 2005 10:35:30 -0000 1.1
--- mtx_log.c 23 Oct 2005 19:50:45 -0000 1.2
***************
*** 45,49 ****
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
--- 45,48 ----
Index: mtx_rowrfft.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_rowrfft.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mtx_rowrfft.c 17 Oct 2005 16:17:05 -0000 1.2
--- mtx_rowrfft.c 23 Oct 2005 19:50:45 -0000 1.3
***************
*** 14,17 ****
--- 14,18 ----
#include "iemmatrix.h"
+ #include <stdlib.h>
static t_class *mtx_rowrfft_class;
Index: mtx_not.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_not.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mtx_not.c 19 Sep 2005 14:47:49 -0000 1.1
--- mtx_not.c 23 Oct 2005 19:50:45 -0000 1.2
***************
*** 47,51 ****
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
--- 47,50 ----
***************
*** 53,58 ****
while(n--){
- m->a_type = A_FLOAT;
t_float f = atom_getfloat(argv++);
(m++)->a_w.w_float = (t_float)(f<MTX_ALMOSTZERO&&f>-MTX_ALMOSTZERO);
}
--- 52,57 ----
while(n--){
t_float f = atom_getfloat(argv++);
+ m->a_type = A_FLOAT;
(m++)->a_w.w_float = (t_float)(f<MTX_ALMOSTZERO&&f>-MTX_ALMOSTZERO);
}
Index: mtx_abs.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_abs.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** mtx_abs.c 19 Sep 2005 13:40:36 -0000 1.3
--- mtx_abs.c 23 Oct 2005 19:50:45 -0000 1.4
***************
*** 45,49 ****
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
--- 45,48 ----
Index: mtx_int.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_int.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mtx_int.c 19 Sep 2005 12:51:27 -0000 1.1
--- mtx_int.c 23 Oct 2005 19:50:45 -0000 1.2
***************
*** 45,49 ****
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
--- 45,48 ----
Index: mtx_slice.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_slice.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mtx_slice.c 20 Sep 2005 08:12:38 -0000 1.1
--- mtx_slice.c 23 Oct 2005 19:50:45 -0000 1.2
***************
*** 46,50 ****
int stoprow;
t_symbol *endsym = gensym("end");
- t_atom *list_out = mtx_slice_obj->list_out;
if (argc<4) {
--- 46,49 ----
Index: mtx_dbtorms.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_dbtorms.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mtx_dbtorms.c 27 Jun 2005 15:57:49 -0000 1.1
--- mtx_dbtorms.c 23 Oct 2005 19:50:45 -0000 1.2
***************
*** 50,54 ****
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
--- 50,53 ----
Index: mtx_index.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_index.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mtx_index.c 19 Sep 2005 14:47:49 -0000 1.1
--- mtx_index.c 23 Oct 2005 19:50:45 -0000 1.2
***************
*** 54,58 ****
--- 54,62 ----
}
if (atom_getsymbol(&fill_atom) == gensym("nan"))
+ #ifdef __WIN32__
+ mtx_index_obj->fill_value = 0.0f;
+ #else
mtx_index_obj->fill_value = 0.0f/0.0f;
+ #endif
else
mtx_index_obj->fill_value = atom_getfloat(&fill_atom);
***************
*** 160,164 ****
t_atom *list_in = argv;
t_atom *list_out = mtx_index_obj->list_out;
- int count;
int index_rows = mtx_index_obj->index_rows;
int index_columns = mtx_index_obj->index_columns;
--- 164,167 ----
Index: mtx_sin.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_sin.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mtx_sin.c 19 Sep 2005 12:51:27 -0000 1.1
--- mtx_sin.c 23 Oct 2005 19:50:45 -0000 1.2
***************
*** 45,49 ****
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
--- 45,48 ----
Index: mtx_diff.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_diff.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mtx_diff.c 22 Sep 2005 09:28:55 -0000 1.2
--- mtx_diff.c 23 Oct 2005 19:50:45 -0000 1.3
***************
*** 65,73 ****
if (argv[0].a_type == A_SYMBOL) {
mTXSetdiffMode (mtx_diff_obj, atom_getsymbol (argv));
! if (argc>=2)
if (argv[1].a_type != A_SYMBOL)
mTXSetdiffDirection (mtx_diff_obj, atom_getfloat (argv+1));
else
post("mtx_diff: 2nd arg ignored. supposed to be float");
}
else {
--- 65,74 ----
if (argv[0].a_type == A_SYMBOL) {
mTXSetdiffMode (mtx_diff_obj, atom_getsymbol (argv));
! if (argc>=2) {
if (argv[1].a_type != A_SYMBOL)
mTXSetdiffDirection (mtx_diff_obj, atom_getfloat (argv+1));
else
post("mtx_diff: 2nd arg ignored. supposed to be float");
+ }
}
else {
Index: mtx_gauss.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_gauss.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mtx_gauss.c 16 Jun 2005 12:43:07 -0000 1.2
--- mtx_gauss.c 23 Oct 2005 19:50:45 -0000 1.3
***************
*** 42,53 ****
int row=atom_getfloat(argv);
int col=atom_getfloat(argv+1);
! int i, j, k, row2=row*row;
const t_matrixfloat singrange = 1.0e-10;
! t_matrixfloat *original, *gaussed;
! t_matrixfloat *a1, *a2, *b1, *b2; // dummy pointers
- int ok = 0;
- int I;
if(row*col+2>argc){
--- 42,51 ----
int row=atom_getfloat(argv);
int col=atom_getfloat(argv+1);
! int i, j;
const t_matrixfloat singrange = 1.0e-10;
! t_matrixfloat *original;
! t_matrixfloat *a1, *a2; // dummy pointers
if(row*col+2>argc){
Index: mtx_repmat.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_repmat.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mtx_repmat.c 19 Sep 2005 14:47:49 -0000 1.1
--- mtx_repmat.c 23 Oct 2005 19:50:45 -0000 1.2
***************
*** 78,82 ****
int row_cnt;
int col_cnt;
- int idx = 0;
int new_col = columns * repeat_cols;
t_atom *ptr = y;
--- 78,81 ----
Index: mtx_cumsum.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_cumsum.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mtx_cumsum.c 22 Sep 2005 09:28:55 -0000 1.2
--- mtx_cumsum.c 23 Oct 2005 19:50:45 -0000 1.3
***************
*** 68,76 ****
if (argv[0].a_type == A_SYMBOL) {
mTXSetCumsumMode (mtx_cumsum_obj, atom_getsymbol (argv));
! if (argc>=2)
if (argv[1].a_type != A_SYMBOL)
mTXSetCumsumDirection (mtx_cumsum_obj, atom_getfloat (argv+1));
else
post("mtx_cumsum: 2nd arg ignored. supposed to be float");
}
else {
--- 68,77 ----
if (argv[0].a_type == A_SYMBOL) {
mTXSetCumsumMode (mtx_cumsum_obj, atom_getsymbol (argv));
! if (argc>=2) {
if (argv[1].a_type != A_SYMBOL)
mTXSetCumsumDirection (mtx_cumsum_obj, atom_getfloat (argv+1));
else
post("mtx_cumsum: 2nd arg ignored. supposed to be float");
+ }
}
else {
Index: mtx_rowrifft.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_rowrifft.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mtx_rowrifft.c 17 Oct 2005 16:17:05 -0000 1.2
--- mtx_rowrifft.c 23 Oct 2005 19:50:45 -0000 1.3
***************
*** 14,17 ****
--- 14,18 ----
#include "iemmatrix.h"
+ #include <stdlib.h>
static t_class *mtx_rowrifft_class;
Index: mtx_find.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_find.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mtx_find.c 26 Sep 2005 07:57:02 -0000 1.2
--- mtx_find.c 23 Oct 2005 19:50:45 -0000 1.3
***************
*** 77,85 ****
if (argv[0].a_type == A_SYMBOL) {
mTXSetFindMode (mtx_find_obj, atom_getsymbol (argv));
! if (argc>=2)
if (argv[1].a_type != A_SYMBOL)
mTXSetFindDirection (mtx_find_obj, atom_getfloat (argv+1));
else
post("mtx_find: 2nd arg ignored. supposed to be float");
}
else {
--- 77,86 ----
if (argv[0].a_type == A_SYMBOL) {
mTXSetFindMode (mtx_find_obj, atom_getsymbol (argv));
! if (argc>=2) {
if (argv[1].a_type != A_SYMBOL)
mTXSetFindDirection (mtx_find_obj, atom_getfloat (argv+1));
else
post("mtx_find: 2nd arg ignored. supposed to be float");
+ }
}
else {
***************
*** 234,238 ****
t_atom *list_in = argv;
t_atom *list_out = mtx_find_obj->list_out;
- int count;
int rows_out;
int columns_out;
--- 235,238 ----
Index: mtx_rmstodb.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_rmstodb.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mtx_rmstodb.c 27 Jun 2005 15:57:49 -0000 1.1
--- mtx_rmstodb.c 23 Oct 2005 19:50:45 -0000 1.2
***************
*** 48,52 ****
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
--- 48,51 ----
Index: mtx_cos.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_cos.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mtx_cos.c 19 Sep 2005 12:51:27 -0000 1.1
--- mtx_cos.c 23 Oct 2005 19:50:45 -0000 1.2
***************
*** 45,49 ****
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
--- 45,48 ----
Index: mtx_reverse.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_reverse.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** mtx_reverse.c 26 Sep 2005 07:57:02 -0000 1.2
--- mtx_reverse.c 23 Oct 2005 19:50:45 -0000 1.3
***************
*** 121,125 ****
int size = rows * columns;
int list_size = argc - 2;
- t_atom *list_in = argv;
t_atom *list_out = mtx_reverse_obj->list_out;
int count;
--- 121,124 ----
Index: mtx_exp.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/iemmatrix/src/mtx_exp.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** mtx_exp.c 14 Jun 2005 10:35:30 -0000 1.1
--- mtx_exp.c 23 Oct 2005 19:50:45 -0000 1.2
***************
*** 45,49 ****
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
--- 45,48 ----