From acf7d3045a0f9ce6157b2ddfa26224f5e4a17460 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 2 Oct 2009 02:10:25 +0200 Subject: [PATCH] src/mathutils.c and co: use 0.0, not 0.0f --- src/aubio_priv.h | 4 ++-- src/mathutils.c | 10 +++++----- src/onset/onsetdetection.c | 12 ++++++------ src/utils/hist.c | 2 +- src/utils/scale.c | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/aubio_priv.h b/src/aubio_priv.h index 14facc27..683056fc 100644 --- a/src/aubio_priv.h +++ b/src/aubio_priv.h @@ -182,8 +182,8 @@ typedef enum { #endif /* handy shortcuts */ -#define DB2LIN(g) (POW(10.0f,(g)*0.05f)) -#define LIN2DB(v) (20.0f*LOG10(v)) +#define DB2LIN(g) (POW(10.0,(g)*0.05f)) +#define LIN2DB(v) (20.0*LOG10(v)) #define SQR(_a) (_a*_a) #define MAX(a,b) ( a > b ? a : b) diff --git a/src/mathutils.c b/src/mathutils.c index 8e2a65a5..26deb9dc 100644 --- a/src/mathutils.c +++ b/src/mathutils.c @@ -85,7 +85,7 @@ smpl_t aubio_unwrap2pi(smpl_t phase) { smpl_t fvec_mean(fvec_t *s) { uint_t i,j; - smpl_t tmp = 0.0f; + smpl_t tmp = 0.0; for (i=0; i < s->channels; i++) for (j=0; j < s->length; j++) tmp += s->data[i][j]; @@ -94,7 +94,7 @@ smpl_t fvec_mean(fvec_t *s) { smpl_t fvec_sum(fvec_t *s) { uint_t i,j; - smpl_t tmp = 0.0f; + smpl_t tmp = 0.0; for (i=0; i < s->channels; i++) for (j=0; j < s->length; j++) tmp += s->data[i][j]; @@ -103,7 +103,7 @@ smpl_t fvec_sum(fvec_t *s) { smpl_t fvec_max(fvec_t *s) { uint_t i,j; - smpl_t tmp = 0.0f; + smpl_t tmp = 0.0; for (i=0; i < s->channels; i++) for (j=0; j < s->length; j++) tmp = (tmp > s->data[i][j])? tmp : s->data[i][j]; @@ -132,7 +132,7 @@ uint_t fvec_min_elem(fvec_t *s) { uint_t fvec_max_elem(fvec_t *s) { uint_t i,j=0, pos=0.; - smpl_t tmp = 0.0f; + smpl_t tmp = 0.0; for (i=0; i < s->channels; i++) for (j=0; j < s->length; j++) { pos = (tmp > s->data[i][j])? pos : j; @@ -143,7 +143,7 @@ uint_t fvec_max_elem(fvec_t *s) { void fvec_shift(fvec_t *s) { uint_t i,j; - //smpl_t tmp = 0.0f; + //smpl_t tmp = 0.0; for (i=0; i < s->channels; i++) for (j=0; j < s->length / 2 ; j++) { //tmp = s->data[i][j]; diff --git a/src/onset/onsetdetection.c b/src/onset/onsetdetection.c index ffcc0312..b52c94ef 100644 --- a/src/onset/onsetdetection.c +++ b/src/onset/onsetdetection.c @@ -97,7 +97,7 @@ void aubio_onsetdetection_phase(aubio_onsetdetection_t *o, uint_t i, j; uint_t nbins = fftgrain->length; for (i=0;ichannels; i++) { - onset->data[i][0] = 0.0f; + onset->data[i][0] = 0.0; o->dev1->data[i][0]=0.; for ( j=0;jdev1->data[i][j] = @@ -108,7 +108,7 @@ void aubio_onsetdetection_phase(aubio_onsetdetection_t *o, if ( o->threshold < fftgrain->norm[i][j] ) o->dev1->data[i][j] = ABS(o->dev1->data[i][j]); else - o->dev1->data[i][j] = 0.0f; + o->dev1->data[i][j] = 0.0; /* keep a track of the past frames */ o->theta2->data[i][j] = o->theta1->data[i][j]; o->theta1->data[i][j] = fftgrain->phas[i][j]; @@ -129,7 +129,7 @@ void aubio_onsetdetection_specdiff(aubio_onsetdetection_t *o, uint_t i, j; uint_t nbins = fftgrain->length; for (i=0;ichannels; i++) { - onset->data[i][0] = 0.0f; + onset->data[i][0] = 0.0; for (j=0;jdev1->data[i][j] = SQRT( ABS(SQR( fftgrain->norm[i][j]) @@ -137,7 +137,7 @@ void aubio_onsetdetection_specdiff(aubio_onsetdetection_t *o, if (o->threshold < fftgrain->norm[i][j] ) o->dev1->data[i][j] = ABS(o->dev1->data[i][j]); else - o->dev1->data[i][j] = 0.0f; + o->dev1->data[i][j] = 0.0; o->oldmag->data[i][j] = fftgrain->norm[i][j]; } @@ -229,13 +229,13 @@ new_aubio_onsetdetection (aubio_onsetdetection_type type, o->dev1 = new_fvec(rsize,channels); o->theta1 = new_fvec(rsize,channels); o->theta2 = new_fvec(rsize,channels); - o->histog = new_aubio_hist(0.0f, PI, 10, channels); + o->histog = new_aubio_hist(0.0, PI, 10, channels); o->threshold = 0.1; break; case aubio_onset_specdiff: o->oldmag = new_fvec(rsize,channels); o->dev1 = new_fvec(rsize,channels); - o->histog = new_aubio_hist(0.0f, PI, 10, channels); + o->histog = new_aubio_hist(0.0, PI, 10, channels); o->threshold = 0.1; break; case aubio_onset_kl: diff --git a/src/utils/hist.c b/src/utils/hist.c index 50ee9705..19fced80 100644 --- a/src/utils/hist.c +++ b/src/utils/hist.c @@ -148,7 +148,7 @@ void aubio_hist_weight (aubio_hist_t *s) { smpl_t aubio_hist_mean (aubio_hist_t *s) { uint_t i,j; - smpl_t tmp = 0.0f; + smpl_t tmp = 0.0; for (i=0; i < s->channels; i++) for (j=0; j < s->nelems; j++) tmp += s->hist->data[i][j]; diff --git a/src/utils/scale.c b/src/utils/scale.c index bb64bd34..8db9007f 100644 --- a/src/utils/scale.c +++ b/src/utils/scale.c @@ -56,7 +56,7 @@ void aubio_scale_set (aubio_scale_t *s, smpl_t ilow, smpl_t ihig, s->olow = olow; s->ohig = ohig; if (inputrange == 0) { - s->scaler = 0.0f; + s->scaler = 0.0; } else { s->scaler = outputrange/inputrange; if (inputrange < 0) { -- 2.26.2