Changeset 5644069


Ignore:
Timestamp:
Dec 31, 2013, 12:24:44 AM (10 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, pitchshift, sampler, timestretch, yinfft+
Children:
78c21cf
Parents:
c21acb9
Message:

src/mathutils.c: improve build with -Wdeclaration-after-statement

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mathutils.c

    rc21acb9 r5644069  
    418418
    419419smpl_t fvec_quadratic_peak_pos (fvec_t * x, uint_t pos) {
    420   smpl_t s0, s1, s2;
     420  smpl_t s0, s1, s2; uint_t x0, x2;
    421421  if (pos == 0 || pos == x->length - 1) return pos;
    422   uint_t x0 = (pos < 1) ? pos : pos - 1;
    423   uint_t x2 = (pos + 1 < x->length) ? pos + 1 : pos;
     422  x0 = (pos < 1) ? pos : pos - 1;
     423  x2 = (pos + 1 < x->length) ? pos + 1 : pos;
    424424  if (x0 == pos) return (x->data[pos] <= x->data[x2]) ? pos : x2;
    425425  if (x2 == pos) return (x->data[pos] <= x->data[x0]) ? pos : x0;
     
    449449aubio_freqtomidi (smpl_t freq)
    450450{
     451  smpl_t midi;
    451452  if (freq < 2. || freq > 100000.) return 0.; // avoid nans and infs
    452453  /* log(freq/A-2)/log(2) */
    453   smpl_t midi = freq / 6.875;
     454  midi = freq / 6.875;
    454455  midi = LOG (midi) / 0.69314718055995;
    455456  midi *= 12;
     
    461462aubio_miditofreq (smpl_t midi)
    462463{
     464  smpl_t freq;
    463465  if (midi > 140.) return 0.; // avoid infs
    464   smpl_t freq = (midi + 3.) / 12.;
     466  freq = (midi + 3.) / 12.;
    465467  freq = EXP (freq * 0.69314718055995);
    466468  freq *= 6.875;
Note: See TracChangeset for help on using the changeset viewer.