Changeset c21acb9


Ignore:
Timestamp:
Dec 31, 2013, 12:20:28 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:
5644069
Parents:
fe87823
Message:

src/: improve build with -Wdeclaration-after-statement

Location:
src
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • src/cvec.c

    rfe87823 rc21acb9  
    2323
    2424cvec_t * new_cvec( uint_t length) {
     25  cvec_t * s;
    2526  if ((sint_t)length <= 0) {
    2627    return NULL;
    2728  }
    28   cvec_t * s = AUBIO_NEW(cvec_t);
     29  s = AUBIO_NEW(cvec_t);
    2930  s->length = length/2 + 1;
    3031  s->norm = AUBIO_ARRAY(smpl_t,s->length);
  • src/fmat.c

    rfe87823 rc21acb9  
    2323
    2424fmat_t * new_fmat (uint_t height, uint_t length) {
     25  fmat_t * s;
     26  uint_t i,j;
    2527  if ((sint_t)length <= 0 || (sint_t)height <= 0 ) {
    2628    return NULL;
    2729  }
    28   fmat_t * s = AUBIO_NEW(fmat_t);
    29   uint_t i,j;
     30  s = AUBIO_NEW(fmat_t);
    3031  s->height = height;
    3132  s->length = length;
     
    127128
    128129void fmat_copy(fmat_t *s, fmat_t *t) {
     130  uint_t i;
     131#if !HAVE_MEMCPY_HACKS
     132  uint_t i,j;
     133#endif
    129134  if (s->height != t->height) {
    130135    AUBIO_ERR("trying to copy %d rows to %d rows \n",
     
    138143  }
    139144#if HAVE_MEMCPY_HACKS
    140   uint_t i;
    141145  for (i=0; i< s->height; i++) {
    142146    memcpy(t->data[i], s->data[i], t->length * sizeof(smpl_t));
    143147  }
    144148#else
    145   uint_t i,j;
    146149  for (i=0; i< t->height; i++) {
    147150    for (j=0; j< t->length; j++) {
  • src/fvec.c

    rfe87823 rc21acb9  
    2323
    2424fvec_t * new_fvec( uint_t length) {
     25  fvec_t * s;
    2526  if ((sint_t)length <= 0) {
    2627    return NULL;
    2728  }
    28   fvec_t * s = AUBIO_NEW(fvec_t);
     29  s = AUBIO_NEW(fvec_t);
    2930  s->length = length;
    3031  s->data = AUBIO_ARRAY(smpl_t, s->length);
  • src/io/sink_sndfile.c

    rfe87823 rc21acb9  
    4747aubio_sink_sndfile_t * new_aubio_sink_sndfile(char_t * path, uint_t samplerate) {
    4848  aubio_sink_sndfile_t * s = AUBIO_NEW(aubio_sink_sndfile_t);
     49  SF_INFO sfinfo;
    4950
    5051  if (path == NULL) {
     
    5960
    6061  /* set output format */
    61   SF_INFO sfinfo;
    6262  AUBIO_MEMSET(&sfinfo, 0, sizeof (sfinfo));
    6363  sfinfo.samplerate = s->samplerate;
     
    9292  int nsamples = channels*write;
    9393  smpl_t *pwrite;
     94  sf_count_t written_frames;
    9495
    9596  if (write > s->max_size) {
     
    107108  }
    108109
    109   sf_count_t written_frames = sf_write_float (s->handle, s->scratch_data, nsamples);
     110  written_frames = sf_write_float (s->handle, s->scratch_data, nsamples);
    110111  if (written_frames/channels != write) {
    111112    AUBIO_WRN("trying to write %d frames to %s, but only %d could be written",
  • src/lvec.c

    rfe87823 rc21acb9  
    2323
    2424lvec_t * new_lvec( uint_t length) {
     25  lvec_t * s;
    2526  if ((sint_t)length <= 0) {
    2627    return NULL;
    2728  }
    28   lvec_t * s = AUBIO_NEW(lvec_t);
     29  s = AUBIO_NEW(lvec_t);
    2930  s->length = length;
    3031  s->data = AUBIO_ARRAY(lsmp_t, s->length);
  • src/mathutils.c

    rfe87823 rc21acb9  
    5050{
    5151  fvec_t * win = new_fvec (length);
     52  uint_t err;
    5253  if (win == NULL) {
    5354    return NULL;
    5455  }
    55   uint_t err = fvec_set_window (win, window_type);
     56  err = fvec_set_window (win, window_type);
    5657  if (err != 0) {
    5758    del_fvec(win);
  • src/pitch/pitch.c

    rfe87823 rc21acb9  
    367367aubio_pitch_do_specacf (aubio_pitch_t * p, fvec_t * ibuf, fvec_t * out)
    368368{
     369  smpl_t pitch = 0., period;
    369370  aubio_pitch_slideblock (p, ibuf);
    370371  aubio_pitchspecacf_do (p->p_object, p->buf, out);
    371372  //out->data[0] = aubio_bintofreq (out->data[0], p->samplerate, p->bufsize);
    372   smpl_t pitch = 0., period = out->data[0];
     373  period = out->data[0];
    373374  if (period > 0) {
    374375    pitch = p->samplerate / period;
  • src/pitch/pitchspecacf.c

    rfe87823 rc21acb9  
    5757aubio_pitchspecacf_do (aubio_pitchspecacf_t * p, fvec_t * input, fvec_t * output)
    5858{
    59   uint_t l;
     59  uint_t l, tau;
    6060  fvec_t *fftout = p->fftout;
    6161  // window the input
     
    7575  }
    7676  // get the minimum
    77   uint_t tau = fvec_min_elem (p->acf);
     77  tau = fvec_min_elem (p->acf);
    7878  // get the interpolated minimum
    7979  output->data[0] = fvec_quadratic_peak_pos (p->acf, tau) * 2.;
  • src/pitch/pitchyinfft.c

    rfe87823 rc21acb9  
    5858new_aubio_pitchyinfft (uint_t samplerate, uint_t bufsize)
    5959{
     60  uint_t i = 0, j = 1;
     61  smpl_t freq = 0, a0 = 0, a1 = 0, f0 = 0, f1 = 0;
    6062  aubio_pitchyinfft_t *p = AUBIO_NEW (aubio_pitchyinfft_t);
    6163  p->winput = new_fvec (bufsize);
     
    6769  p->win = new_aubio_window ("hanningz", bufsize);
    6870  p->weight = new_fvec (bufsize / 2 + 1);
    69   uint_t i = 0, j = 1;
    70   smpl_t freq = 0, a0 = 0, a1 = 0, f0 = 0, f1 = 0;
    7171  for (i = 0; i < p->weight->length; i++) {
    7272    freq = (smpl_t) i / (smpl_t) bufsize *(smpl_t) samplerate;
  • src/synth/wavetable.c

    rfe87823 rc21acb9  
    4343aubio_wavetable_t *new_aubio_wavetable(uint_t samplerate, uint_t blocksize)
    4444{
     45  uint_t i = 0;
    4546  aubio_wavetable_t *s = AUBIO_NEW(aubio_wavetable_t);
    4647  if ((sint_t)samplerate <= 0) {
     
    4849    goto beach;
    4950  }
    50   uint_t i = 0;
    5151  s->samplerate = samplerate;
    5252  s->blocksize = blocksize;
     
    115115    for (j = 0; j < output->length; j++) {
    116116      smpl_t inc = aubio_parameter_get_next_value( s->freq );
     117      smpl_t amp = aubio_parameter_get_next_value ( s->amp );
    117118      inc *= (smpl_t)(s->wavetable_length) / (smpl_t) (s->samplerate);
    118119      pos += inc;
     
    120121        pos -= s->wavetable_length;
    121122      }
    122       smpl_t amp = aubio_parameter_get_next_value ( s->amp );
    123123      for (i = 0; i < output->height; i++) {
    124124        output->data[i][j] = amp * interp_2(s->wavetable, pos);
  • src/tempo/beattracking.c

    rfe87823 rc21acb9  
    6262  aubio_beattracking_t *p = AUBIO_NEW (aubio_beattracking_t);
    6363  uint_t i = 0;
    64   p->hop_size = hop_size;
    65   p->samplerate = samplerate;
    6664  /* default value for rayleigh weighting - sets preferred tempo to 120bpm */
    6765  smpl_t rayparam = 60. * samplerate / 120. / hop_size;
     
    7371  uint_t step = winlen / 4;     /* 1.5 seconds */
    7472
     73  p->hop_size = hop_size;
     74  p->samplerate = samplerate;
    7575  p->lastbeat = 0;
    7676  p->counter = 0;
  • src/temporal/a_weighting.c

    rfe87823 rc21acb9  
    2929aubio_filter_set_a_weighting (aubio_filter_t * f, uint_t samplerate)
    3030{
     31  uint_t order; lsmp_t *a, *b; lvec_t *as, *bs;
    3132  aubio_filter_set_samplerate (f, samplerate);
    32   lvec_t *bs = aubio_filter_get_feedforward (f);
    33   lvec_t *as = aubio_filter_get_feedback (f);
    34   lsmp_t *b = bs->data, *a = as->data;
    35   uint_t order = aubio_filter_get_order (f);
     33  bs = aubio_filter_get_feedforward (f);
     34  as = aubio_filter_get_feedback (f);
     35  b = bs->data, a = as->data;
     36  order = aubio_filter_get_order (f);
    3637
    3738  if (order != 7) {
  • src/temporal/c_weighting.c

    rfe87823 rc21acb9  
    2929aubio_filter_set_c_weighting (aubio_filter_t * f, uint_t samplerate)
    3030{
     31  uint_t order; lsmp_t *a, *b; lvec_t *as, *bs;
    3132  aubio_filter_set_samplerate (f, samplerate);
    32   lvec_t *bs = aubio_filter_get_feedforward (f);
    33   lvec_t *as = aubio_filter_get_feedback (f);
    34   lsmp_t *b = bs->data, *a = as->data;
    35   uint_t order = aubio_filter_get_order (f);
     33  bs = aubio_filter_get_feedforward (f);
     34  as = aubio_filter_get_feedback (f);
     35  b = bs->data, a = as->data;
     36  order = aubio_filter_get_order (f);
    3637
    3738  if ( order != 5 ) {
Note: See TracChangeset for help on using the changeset viewer.