aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mtx_abs.c1
-rw-r--r--src/mtx_cholesky.c3
-rw-r--r--src/mtx_conv.c23
-rw-r--r--src/mtx_cos.c1
-rw-r--r--src/mtx_cumsum.c3
-rw-r--r--src/mtx_dbtorms.c1
-rw-r--r--src/mtx_diff.c3
-rw-r--r--src/mtx_exp.c1
-rw-r--r--src/mtx_find.c4
-rw-r--r--src/mtx_gauss.c8
-rw-r--r--src/mtx_index.c5
-rw-r--r--src/mtx_int.c1
-rw-r--r--src/mtx_log.c1
-rw-r--r--src/mtx_minmax.c1
-rw-r--r--src/mtx_not.c3
-rw-r--r--src/mtx_repmat.c1
-rw-r--r--src/mtx_reverse.c1
-rw-r--r--src/mtx_rmstodb.c1
-rw-r--r--src/mtx_rowrfft.c1
-rw-r--r--src/mtx_rowrifft.c1
-rw-r--r--src/mtx_sin.c1
-rw-r--r--src/mtx_slice.c1
-rw-r--r--src/mtx_sort.c3
23 files changed, 21 insertions, 48 deletions
diff --git a/src/mtx_abs.c b/src/mtx_abs.c
index 22c4824..22d701b 100644
--- a/src/mtx_abs.c
+++ b/src/mtx_abs.c
@@ -44,7 +44,6 @@ static void mtx_abs_list(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv
{
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
m = x->m.atombuffer;
diff --git a/src/mtx_cholesky.c b/src/mtx_cholesky.c
index b9e97b8..442c654 100644
--- a/src/mtx_cholesky.c
+++ b/src/mtx_cholesky.c
@@ -30,9 +30,6 @@ static void mtx_cholesky_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv
int i, j, k, row2=row*row;
t_matrixfloat *original, *cholesky;
- t_matrixfloat *a1, *b1; // dummy pointers
-
- int ok = 0;
if(row*col+2>argc){
post("mtx_print : sparse matrices not yet supported : use \"mtx_check\"");
diff --git a/src/mtx_conv.c b/src/mtx_conv.c
index bfb38bb..a34b9d2 100644
--- a/src/mtx_conv.c
+++ b/src/mtx_conv.c
@@ -70,13 +70,13 @@ static t_float **resizeTFloatMatrix (t_float **old, int rows_old, int columns_ol
int rows_new, int columns_new)
{
t_float **mtx = old;
- int count1, count2;
+ int count1;
post("resizing from %dx%d to %dx%d", rows_old, columns_old, rows_new, columns_new);
if ((rows_new == 0)||(columns_new == 0)) {
deleteTFloatMatrix (old, rows_old, columns_old);
old = 0;
- return;
+ return old;
}
// 1. if rows_old>rows_new: old row disposal
if (rows_old>rows_new)
@@ -98,13 +98,12 @@ static t_float **resizeTFloatMatrix (t_float **old, int rows_old, int columns_ol
for (count1 = (rows_new - rows_old); count1--; mtx++)
*mtx = (t_float *) getbytes (sizeof(t_float) * columns_new);
}
- post("return resize");
+ /* post("return resize"); */
return old;
}
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);
deleteTFloatMatrix (mtx_conv_obj->y, mtx_conv_obj->rows_y, mtx_conv_obj->columns_y);
@@ -161,16 +160,6 @@ static void readFloatFromList (int n, t_atom *l, t_float *f)
while (n--)
*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)
{
for (;rows--; l+=columns)
@@ -249,12 +238,6 @@ static void mTXConvMatrix (MTXConv *mtx_conv_obj, t_symbol *s,
t_float **x = mtx_conv_obj->x;
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
if (!size){
diff --git a/src/mtx_cos.c b/src/mtx_cos.c
index da112ab..d18ea28 100644
--- a/src/mtx_cos.c
+++ b/src/mtx_cos.c
@@ -44,7 +44,6 @@ static void mtx_cos_list(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv
{
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
m = x->m.atombuffer;
diff --git a/src/mtx_cumsum.c b/src/mtx_cumsum.c
index da6b148..2cd329e 100644
--- a/src/mtx_cumsum.c
+++ b/src/mtx_cumsum.c
@@ -67,11 +67,12 @@ static void *newMTXCumsum (t_symbol *s, int argc, t_atom *argv)
if (argc>=1) {
if (argv[0].a_type == A_SYMBOL) {
mTXSetCumsumMode (mtx_cumsum_obj, atom_getsymbol (argv));
- if (argc>=2)
+ 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 {
mTXSetCumsumDirection (mtx_cumsum_obj, atom_getfloat (argv));
diff --git a/src/mtx_dbtorms.c b/src/mtx_dbtorms.c
index 4768078..cb1bfd6 100644
--- a/src/mtx_dbtorms.c
+++ b/src/mtx_dbtorms.c
@@ -49,7 +49,6 @@ static void mtx_dbtorms_list(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *
{
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
m = x->m.atombuffer;
diff --git a/src/mtx_diff.c b/src/mtx_diff.c
index cf58ead..28005cb 100644
--- a/src/mtx_diff.c
+++ b/src/mtx_diff.c
@@ -64,11 +64,12 @@ static void *newMTXdiff (t_symbol *s, int argc, t_atom *argv)
if (argc>=1) {
if (argv[0].a_type == A_SYMBOL) {
mTXSetdiffMode (mtx_diff_obj, atom_getsymbol (argv));
- if (argc>=2)
+ 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 {
mTXSetdiffDirection (mtx_diff_obj, atom_getfloat (argv));
diff --git a/src/mtx_exp.c b/src/mtx_exp.c
index 3ad021e..1f26edc 100644
--- a/src/mtx_exp.c
+++ b/src/mtx_exp.c
@@ -44,7 +44,6 @@ static void mtx_exp_list(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv
{
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
m = x->m.atombuffer;
diff --git a/src/mtx_find.c b/src/mtx_find.c
index ca16060..face3a6 100644
--- a/src/mtx_find.c
+++ b/src/mtx_find.c
@@ -76,11 +76,12 @@ static void *newMTXFind (t_symbol *s, int argc, t_atom *argv)
if (argc>=1) {
if (argv[0].a_type == A_SYMBOL) {
mTXSetFindMode (mtx_find_obj, atom_getsymbol (argv));
- if (argc>=2)
+ 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 {
mTXSetFindDirection (mtx_find_obj, atom_getfloat (argv));
@@ -233,7 +234,6 @@ static void mTXFindMatrix (MTXfind *mtx_find_obj, t_symbol *s,
int list_size = argc - 2;
t_atom *list_in = argv;
t_atom *list_out = mtx_find_obj->list_out;
- int count;
int rows_out;
int columns_out;
diff --git a/src/mtx_gauss.c b/src/mtx_gauss.c
index c6d9a3f..c2a627c 100644
--- a/src/mtx_gauss.c
+++ b/src/mtx_gauss.c
@@ -41,14 +41,12 @@ static void mtx_gauss_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv)
/* maybe we should do this in double or long double ? */
int row=atom_getfloat(argv);
int col=atom_getfloat(argv+1);
- int i, j, k, row2=row*row;
+ int i, j;
const t_matrixfloat singrange = 1.0e-10;
- t_matrixfloat *original, *gaussed;
- t_matrixfloat *a1, *a2, *b1, *b2; // dummy pointers
+ t_matrixfloat *original;
+ t_matrixfloat *a1, *a2; // dummy pointers
- int ok = 0;
- int I;
if(row*col+2>argc){
post("mtx_print : sparse matrices not yet supported : use \"mtx_check\"");
diff --git a/src/mtx_index.c b/src/mtx_index.c
index 1bf65ae..a9eda02 100644
--- a/src/mtx_index.c
+++ b/src/mtx_index.c
@@ -53,7 +53,11 @@ static void *newMTXIndex (t_symbol *s, int argc, t_atom *argv)
fill_atom = *argv;
}
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);
@@ -159,7 +163,6 @@ static void mTXIndexMatrix (MTXindex *mtx_index_obj, t_symbol *s,
int list_size = argc - 2;
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;
int *index = mtx_index_obj->index_in;
diff --git a/src/mtx_int.c b/src/mtx_int.c
index 38b2796..516a25d 100644
--- a/src/mtx_int.c
+++ b/src/mtx_int.c
@@ -44,7 +44,6 @@ static void mtx_int_list(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv
{
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
m = x->m.atombuffer;
diff --git a/src/mtx_log.c b/src/mtx_log.c
index 90b609d..f9ca96e 100644
--- a/src/mtx_log.c
+++ b/src/mtx_log.c
@@ -44,7 +44,6 @@ static void mtx_log_list(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv
{
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
m = x->m.atombuffer;
diff --git a/src/mtx_minmax.c b/src/mtx_minmax.c
index 03b81be..3886546 100644
--- a/src/mtx_minmax.c
+++ b/src/mtx_minmax.c
@@ -179,7 +179,6 @@ static void mTXMinMaxMatrix (MTXminmax *mtx_minmax_obj, t_symbol *s,
int list_size = argc - 2;
t_atom *list_in = argv;
t_atom *list_out = mtx_minmax_obj->list_out;
- int count;
int rows_out;
int columns_out;
diff --git a/src/mtx_not.c b/src/mtx_not.c
index e73307a..1f04209 100644
--- a/src/mtx_not.c
+++ b/src/mtx_not.c
@@ -46,14 +46,13 @@ static void mtx_not_list(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv
{
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
m = x->m.atombuffer;
while(n--){
- m->a_type = A_FLOAT;
t_float f = atom_getfloat(argv++);
+ m->a_type = A_FLOAT;
(m++)->a_w.w_float = (t_float)(f<MTX_ALMOSTZERO&&f>-MTX_ALMOSTZERO);
}
diff --git a/src/mtx_repmat.c b/src/mtx_repmat.c
index 3ab686f..9b92cd8 100644
--- a/src/mtx_repmat.c
+++ b/src/mtx_repmat.c
@@ -77,7 +77,6 @@ static void writeRepeatIntoMatrix (int repeat_rows, int repeat_cols, int rows, i
{
int row_cnt;
int col_cnt;
- int idx = 0;
int new_col = columns * repeat_cols;
t_atom *ptr = y;
diff --git a/src/mtx_reverse.c b/src/mtx_reverse.c
index 825a3b2..e08a48e 100644
--- a/src/mtx_reverse.c
+++ b/src/mtx_reverse.c
@@ -120,7 +120,6 @@ static void mTXreverseMatrix (MTXreverse *mtx_reverse_obj, t_symbol *s,
int columns = atom_getint (argv++);
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;
diff --git a/src/mtx_rmstodb.c b/src/mtx_rmstodb.c
index f5f6a65..672858d 100644
--- a/src/mtx_rmstodb.c
+++ b/src/mtx_rmstodb.c
@@ -47,7 +47,6 @@ static void mtx_rmstodb_list(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *
{
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
m = x->m.atombuffer;
diff --git a/src/mtx_rowrfft.c b/src/mtx_rowrfft.c
index 763003c..3475a8b 100644
--- a/src/mtx_rowrfft.c
+++ b/src/mtx_rowrfft.c
@@ -13,6 +13,7 @@
*/
#include "iemmatrix.h"
+#include <stdlib.h>
static t_class *mtx_rowrfft_class;
diff --git a/src/mtx_rowrifft.c b/src/mtx_rowrifft.c
index 8776246..45678a0 100644
--- a/src/mtx_rowrifft.c
+++ b/src/mtx_rowrifft.c
@@ -13,6 +13,7 @@
*/
#include "iemmatrix.h"
+#include <stdlib.h>
static t_class *mtx_rowrifft_class;
diff --git a/src/mtx_sin.c b/src/mtx_sin.c
index 290338c..a897532 100644
--- a/src/mtx_sin.c
+++ b/src/mtx_sin.c
@@ -44,7 +44,6 @@ static void mtx_sin_list(t_mtx_binscalar *x, t_symbol *s, int argc, t_atom *argv
{
int n=argc;
t_atom *m;
- t_float factor = x->f;
adjustsize(&x->m, 1, argc);
m = x->m.atombuffer;
diff --git a/src/mtx_slice.c b/src/mtx_slice.c
index 7dc1042..58e6db2 100644
--- a/src/mtx_slice.c
+++ b/src/mtx_slice.c
@@ -45,7 +45,6 @@ static void mTXSliceIndexList (MTXslice *mtx_slice_obj, t_symbol *s,
int stopcol;
int stoprow;
t_symbol *endsym = gensym("end");
- t_atom *list_out = mtx_slice_obj->list_out;
if (argc<4) {
post("mtx_slice: invalid index vector: <startrow><startcol><stoprow><stopcol>");
diff --git a/src/mtx_sort.c b/src/mtx_sort.c
index f2cf81e..e745ae5 100644
--- a/src/mtx_sort.c
+++ b/src/mtx_sort.c
@@ -75,11 +75,12 @@ static void *newMTXSort (t_symbol *s, int argc, t_atom *argv)
if (argc>=1) {
if (argv[0].a_type == A_SYMBOL) {
mTXSetSortMode (mtx_sort_obj, atom_getsymbol (argv));
- if (argc>=2)
+ 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 {
mTXSetSortDirection (mtx_sort_obj, atom_getfloat (argv));