Changeset 8d38841 for src/spectral


Ignore:
Timestamp:
Oct 3, 2016, 8:58:22 PM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, sampler, yinfft+
Children:
cf894b1
Parents:
54eba9d
Message:

src/spectral/ooura_fft8g.c: add cast to avoid conversion warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/spectral/ooura_fft8g.c

    r54eba9d r8d38841  
    33//  - include "aubio_priv.h" (for config.h and types.h)
    44//  - add missing prototypes
    5 //  - use COS and SIN macros
     5//  - use COS, SIN, and ATAN macros
     6//  - add cast to (smpl_t) to avoid float conversion warnings
    67//  - declare initialization as static
    78//  - prefix public function with aubio_ooura_
     
    364365        a[1] = xi;
    365366    } else {
    366         a[1] = 0.5 * (a[0] - a[1]);
     367        a[1] = (smpl_t)0.5 * (a[0] - a[1]);
    367368        a[0] -= a[1];
    368369        if (n > 4) {
     
    693694    if (nw > 2) {
    694695        nwh = nw >> 1;
    695         delta = atan(1.0) / nwh;
     696        delta = ATAN(1.0) / nwh;
    696697        w[0] = 1;
    697698        w[1] = 0;
     
    727728    if (nc > 1) {
    728729        nch = nc >> 1;
    729         delta = atan(1.0) / nch;
    730         c[0] = cos(delta * nch);
    731         c[nch] = 0.5 * c[0];
     730        delta = ATAN(1.0) / nch;
     731        c[0] = COS(delta * nch);
     732        c[nch] = (smpl_t)0.5 * c[0];
    732733        for (j = 1; j < nch; j++) {
    733             c[j] = 0.5 * cos(delta * j);
    734             c[nc - j] = 0.5 * sin(delta * j);
     734            c[j] = (smpl_t)0.5 * COS(delta * j);
     735            c[nc - j] = (smpl_t)0.5 * SIN(delta * j);
    735736        }
    736737    }
     
    15881589        k = n - j;
    15891590        kk += ks;
    1590         wkr = 0.5 - c[nc - kk];
     1591        wkr = (smpl_t)0.5 - c[nc - kk];
    15911592        wki = c[kk];
    15921593        xr = a[j] - a[k];
     
    16141615        k = n - j;
    16151616        kk += ks;
    1616         wkr = 0.5 - c[nc - kk];
     1617        wkr = (smpl_t)0.5 - c[nc - kk];
    16171618        wki = c[kk];
    16181619        xr = a[j] - a[k];
Note: See TracChangeset for help on using the changeset viewer.