diff options
author | Katja <katjav@users.sourceforge.net> | 2011-11-06 15:38:24 +0000 |
---|---|---|
committer | Katja <katjav@users.sourceforge.net> | 2011-11-06 15:38:24 +0000 |
commit | 7d41c2213b5070d444fa17cdb04eeb9fdc955309 (patch) | |
tree | 930e28f8ef74a6343d1cf3962e21048447651420 /hist.c | |
parent | 2e5402b354317ba36480d00de4f1aced6755b7cf (diff) |
made smlib compliant with double precision
svn path=/trunk/externals/smlib/; revision=15707
Diffstat (limited to 'hist.c')
-rw-r--r-- | hist.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -8,12 +8,12 @@ static t_class *hist_class; typedef struct _hist
{
t_object x_obj;
- float m_lo;
- float m_hi;
- float m_scale;
+ t_float m_lo;
+ t_float m_hi;
+ t_float m_scale;
int m_nbins;
int m_n_observations;
- float *m_hist;
+ t_float *m_hist;
} t_hist;
@@ -41,7 +41,7 @@ static void hist_perform_list(t_hist *x, t_symbol *s, int argc, t_atom *argv) static void hist_bang(t_hist *x)
{
int i,n;
- float *f;
+ t_float *f;
t_atom *ap,*app;
n=x->m_nbins;
@@ -63,8 +63,8 @@ static void hist_bang(t_hist *x) static void hist_relative(t_hist *x)
{
int i,n;
- float *f;
- float invn;
+ t_float *f;
+ t_float invn;
t_atom *ap,*app;
n=x->m_nbins;
ap = (t_atom *)getbytes(sizeof(t_atom)*n);
@@ -87,7 +87,7 @@ static void hist_relative(t_hist *x) static void hist_clear(t_hist *x)
{
int i;
- float *f;
+ t_float *f;
f=x->m_hist;
for (i=0;i<x->m_nbins;i++)
*f++=0.0f;
@@ -114,8 +114,8 @@ static void hist_set(t_hist *x, t_float lo, t_float hi, t_float nbins) x->m_hi=hi;
x->m_lo=lo;
x->m_nbins=(int)nbins;
- x->m_scale=(float)x->m_nbins/(hi-lo);
- x->m_hist = (float*)getbytes(sizeof(float)*x->m_nbins);
+ x->m_scale=(t_float)x->m_nbins/(hi-lo);
+ x->m_hist = (t_float*)getbytes(sizeof(t_float)*x->m_nbins);
hist_clear(x);
}
|