From 04f532cbafb61361711acb8d3f327eabf2068c44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 22 Feb 2012 11:26:39 +0000 Subject: fixes to make it compile on MSVC svn path=/trunk/externals/iem/iemmatrix/; revision=16023 --- src/iemmatrix.c | 1 - src/iemmatrix.h | 11 +++++++++++ src/mtx_dispersive_dline.c | 6 ++++-- src/mtx_spherical_harmonics.c | 6 ++++-- src/mtx_spherical_harmonics/chebyshev12.c | 2 +- src/mtx_spherical_harmonics/legendre_a.c | 4 ++-- src/mtx_spherical_harmonics/sharmonics.c | 8 ++++---- src/mtx_spherical_harmonics/sharmonics_normalization.c | 2 +- src/mtx_spherical_harmonics/sph_radial.c | 1 + src/mtx_spherical_radial.c | 2 +- 10 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/iemmatrix.c b/src/iemmatrix.c index ea8f20c..af1e3a3 100644 --- a/src/iemmatrix.c +++ b/src/iemmatrix.c @@ -12,7 +12,6 @@ * */ #include "iemmatrix.h" - void iemmatrix_sources_setup(void); void iemmatrix_setup(){ diff --git a/src/iemmatrix.h b/src/iemmatrix.h index d03b611..87f68d2 100644 --- a/src/iemmatrix.h +++ b/src/iemmatrix.h @@ -53,6 +53,9 @@ #include "m_pd.h" +#ifndef M_PI + +#endif #ifdef HAVE_CONFIG_H # include "config.h" @@ -71,11 +74,19 @@ #include #ifdef __WIN32__ +#ifndef fabsf # define fabsf fabs +#endif +#ifndef sqrtf # define sqrtf sqrt +#endif +#ifndef powf # define powf pow +#endif +#ifndef atanf # define atanf atan #endif +#endif #ifdef __APPLE__ # include diff --git a/src/mtx_dispersive_dline.c b/src/mtx_dispersive_dline.c index e180075..a016336 100644 --- a/src/mtx_dispersive_dline.c +++ b/src/mtx_dispersive_dline.c @@ -153,7 +153,7 @@ static allpass_chain_cycle (t_float x, t_float *y, t_float *z, int n, t_float a) } } -static mtx_dispersive_dline_matrix(t_mtx_dispersive_dline *x, t_symbol *s, +static void mtx_dispersive_dline_matrix(t_mtx_dispersive_dline *x, t_symbol *s, int argc, t_atom *argv) { int channels=(int)atom_getfloat(argv); @@ -194,10 +194,12 @@ static void mtx_dispersive_dline_helper(void) static void *mtx_dispersive_dline_new(t_symbol *s, int argc, t_atom *argv) { t_mtx_dispersive_dline *x = (t_mtx_dispersive_dline *)pd_new(mtx_dispersive_dline_class); - x->list_outlet = outlet_new(&x->x_obj, &s_list); t_float length=1; t_float lambda=0; t_atom resize_msg[2]; + + x->list_outlet = outlet_new(&x->x_obj, &s_list); + switch ((argc>2)?2:argc) { case 2: diff --git a/src/mtx_spherical_harmonics.c b/src/mtx_spherical_harmonics.c index 8ecc9a4..cec8629 100644 --- a/src/mtx_spherical_harmonics.c +++ b/src/mtx_spherical_harmonics.c @@ -105,7 +105,7 @@ static void mTXShMatrix (MTXSh *x, t_symbol *s, int columns = atom_getint (argv++); int size = rows * columns; int in_size = argc-2; - int n; + unsigned int n; /* size check */ @@ -127,6 +127,7 @@ static void mTXShMatrix (MTXSh *x, t_symbol *s, } if (x->ws!=0) { + int n; sharmonics(x->phi, x->theta, x->ws); in_size=x->l*(x->nmax+1)*(x->nmax+1); SETFLOAT(x->list_sh,(float)x->l); @@ -192,7 +193,7 @@ static void mTXChMatrix (MTXCh *x, t_symbol *s, int columns = atom_getint (argv++); int size = rows * columns; int in_size = argc-2; - int n; + unsigned int n; /* size check */ @@ -213,6 +214,7 @@ static void mTXChMatrix (MTXCh *x, t_symbol *s, } if (x->wc!=0) { + int n; chebyshev12(x->phi, x->wc); in_size=x->l*(2*x->nmax+1); SETFLOAT(x->list_ch,(float)x->l); diff --git a/src/mtx_spherical_harmonics/chebyshev12.c b/src/mtx_spherical_harmonics/chebyshev12.c index 64af232..c713bad 100644 --- a/src/mtx_spherical_harmonics/chebyshev12.c +++ b/src/mtx_spherical_harmonics/chebyshev12.c @@ -38,7 +38,7 @@ void chebyshev12_free(Cheby12WorkSpace *wc) { } void chebyshev12(double *phi, Cheby12WorkSpace *wc) { - int l,l0,n; + unsigned int l,l0,n; const int incr=2*wc->nmax+1; double *cosphi; double *sinphi; diff --git a/src/mtx_spherical_harmonics/legendre_a.c b/src/mtx_spherical_harmonics/legendre_a.c index a0762b1..a6c2aa5 100644 --- a/src/mtx_spherical_harmonics/legendre_a.c +++ b/src/mtx_spherical_harmonics/legendre_a.c @@ -34,7 +34,7 @@ static void legendre_first_recurrence (double *sintheta, LegendreWorkSpace *wl) } static void legendre_second_recurrence (double *costheta, LegendreWorkSpace *wl) { - int m,n,l,l0; + unsigned int m,n,l,l0; int nmt0=-1; int nmo0=0; int n0=1; @@ -88,7 +88,7 @@ void legendre_a_free(LegendreWorkSpace *wl) { } void legendre_a(double *theta, LegendreWorkSpace *wl) { - int l,l0; + unsigned int l,l0; const int incr=(wl->nmax+1)*(wl->nmax+2)/2; double *costheta; double *sintheta; diff --git a/src/mtx_spherical_harmonics/sharmonics.c b/src/mtx_spherical_harmonics/sharmonics.c index dbfcb18..e3416e5 100644 --- a/src/mtx_spherical_harmonics/sharmonics.c +++ b/src/mtx_spherical_harmonics/sharmonics.c @@ -22,8 +22,8 @@ // ly0 and lp0 denote the starting position for one vertex in the arrays // see below to find out how the data is arranged static void sharmonics_initlegendrenormlzd(SHWorkSpace *ws) { - int n,m,ny0,np0; - int l,ly0,lp0; + unsigned int n,m,ny0,np0; + unsigned int l,ly0,lp0; const int pincr=(ws->nmax+1)*(ws->nmax+2)/2; const int yincr=(ws->nmax+1)*(ws->nmax+1); @@ -49,9 +49,9 @@ static void sharmonics_initlegendrenormlzd(SHWorkSpace *ws) { // ly0 and lt0 denote the starting position for one vertex in the arrays // see below to find out how the data is arranged static void sharmonics_multcheby12(SHWorkSpace *ws) { - int n,m,ny0; + unsigned int n,m,ny0; const int nt0=ws->nmax; - int l,ly0,lt0; + unsigned int l,ly0,lt0; const int tincr=2*ws->nmax+1; const int yincr=(ws->nmax+1)*(ws->nmax+1); diff --git a/src/mtx_spherical_harmonics/sharmonics_normalization.c b/src/mtx_spherical_harmonics/sharmonics_normalization.c index d7fe00a..0db0531 100644 --- a/src/mtx_spherical_harmonics/sharmonics_normalization.c +++ b/src/mtx_spherical_harmonics/sharmonics_normalization.c @@ -16,7 +16,7 @@ SHNorml *sharmonics_normalization_new (const size_t nmax) { SHNorml *wn; - int n,n0,m; + unsigned int n,n0,m; const double oneoversqrt2 = 1.0/sqrt(2); // memory allocation diff --git a/src/mtx_spherical_harmonics/sph_radial.c b/src/mtx_spherical_harmonics/sph_radial.c index 32e86bb..aaba2d9 100644 --- a/src/mtx_spherical_harmonics/sph_radial.c +++ b/src/mtx_spherical_harmonics/sph_radial.c @@ -13,6 +13,7 @@ */ #include +#include #include "sph_radial.h" diff --git a/src/mtx_spherical_radial.c b/src/mtx_spherical_radial.c index 9f3fd6d..e47adc0 100644 --- a/src/mtx_spherical_radial.c +++ b/src/mtx_spherical_radial.c @@ -118,7 +118,7 @@ static void mTXSphMatrix (MTXSph *x, t_symbol *s, int columns = atom_getint (argv++); int size = rows * columns; int in_size = argc-2; - int n,ofs; + unsigned int n,ofs; /* size check */ -- cgit v1.2.1