To support this change, turn on lots more compiler warnings, and fix all the warnings generated.
Showing the changes to src/stretch.c (1 of 93 files). Show all
Unified · Split
| @@ -55,36 +55,24 @@ typedef struct · 54 unmodified lines | ||
| 55 | 55 | */ |
| 56 | 56 | stretch_status_t state; /* automaton status */ |
| 57 | 57 | |
| 58 | − int size; /* buffer size */ | |
| 59 | − int index; /* next available element */ | |
| 58 | + st_size_t size; /* buffer size */ | |
| 59 | + st_size_t index; /* next available element */ | |
| 60 | 60 | st_sample_t *ibuf; /* input buffer */ |
| 61 | 61 | int ishift; /* input shift */ |
| 62 | 62 | |
| 63 | − int oindex; /* next evailable element */ | |
| 63 | + st_size_t oindex; /* next evailable element */ | |
| 64 | 64 | double * obuf; /* output buffer */ |
| 65 | − int oshift; /* output shift */ | |
| 65 | + st_size_t oshift; /* output shift */ | |
| 66 | 66 | |
| 67 | − int fsize; /* fading size */ | |
| 67 | + st_size_t fsize; /* fading size */ | |
| 68 | 68 | double * fbuf; /* fading, 1.0 -> 0.0 */ |
| 69 | 69 | |
| 70 | 70 | } * stretch_t; |
| 71 | 71 | |
| 72 | −/* | |
| 73 | −static void debug(stretch_t s, char * where) | |
| 74 | −{ | |
| 75 | − st_debug( | |
| 76 | − "%s: (f=%.2f w=%.2f r=%.2f f=%.2f)" | |
| 77 | − " st=%d s=%d ii=%d is=%d oi=%d os=%d fs=%d\n", | |
| 78 | − where, s->factor, s->window, s->shift, s->fading, | |
| 79 | − s->state, s->size, s->index, s->ishift, | |
| 80 | − s->oindex, s->oshift, s->fsize); | |
| 81 | −} | |
| 82 | −*/ | |
| 83 | − | |
| 84 | 72 | /* |
| 85 | 73 | * Process options |
| 86 | 74 | */ |
| 87 | −int st_stretch_getopts(eff_t effp, int n, char **argv) | |
| 75 | +static int st_stretch_getopts(eff_t effp, int n, char **argv) | |
| 88 | 76 | { |
| 89 | 77 | char usage[1024]; |
| 90 | 78 | stretch_t stretch = (stretch_t) effp->priv; |
| @@ -170,10 +158,10 @@ int st_stretch_getopts(eff_t effp, int n, char **argv) · 79 unmodified lines | ||
| 170 | 158 | /* |
| 171 | 159 | * Start processing |
| 172 | 160 | */ |
| 173 | −int st_stretch_start(eff_t effp) | |
| 161 | +static int st_stretch_start(eff_t effp) | |
| 174 | 162 | { |
| 175 | 163 | stretch_t stretch = (stretch_t) effp->priv; |
| 176 | − register int i; | |
| 164 | + st_size_t i; | |
| 177 | 165 | |
| 178 | 166 | /* not necessary. taken care by effect processing? */ |
| 179 | 167 | if (effp->outinfo.channels != effp->ininfo.channels) |
| @@ -199,7 +187,7 @@ int st_stretch_start(eff_t effp) · 19 unmodified lines | ||
| 199 | 187 | sizeof(st_sample_t)); |
| 200 | 188 | |
| 201 | 189 | /* the shift ratio deal with the longest of ishift/oshift |
| 202 | − hence ishift<=size and oshift<=size. should be asserted. | |
| 190 | + hence ishift<=size and oshift<=size. FIXME: should be asserted. | |
| 203 | 191 | */ |
| 204 | 192 | if (stretch->factor < 1.0) |
| 205 | 193 | { |
| @@ -246,7 +234,11 @@ int st_stretch_start(eff_t effp) · 40 unmodified lines | ||
| 246 | 234 | } else if (stretch->fsize==1) |
| 247 | 235 | stretch->fbuf[0] = 1.0; |
| 248 | 236 | |
| 249 | − /* debug(stretch, "start"); */ | |
| 237 | + st_debug("start: (f=%.2f w=%.2f r=%.2f f=%.2f)" | |
| 238 | + " st=%d s=%d ii=%d is=%d oi=%d os=%d fs=%d\n", | |
| 239 | + stretch->factor, stretch->window, stretch->shift, stretch->fading, | |
| 240 | + stretch->state, stretch->size, stretch->index, stretch->ishift, | |
| 241 | + stretch->oindex, stretch->oshift, stretch->fsize); | |
| 250 | 242 | |
| 251 | 243 | return ST_SUCCESS; |
| 252 | 244 | } |
| @@ -276,12 +268,12 @@ static void combine(stretch_t stretch) · 23 unmodified lines | ||
| 276 | 268 | /* |
| 277 | 269 | * Processes flow. |
| 278 | 270 | */ |
| 279 | −int st_stretch_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf, | |
| 271 | +static int st_stretch_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf, | |
| 280 | 272 | st_size_t *isamp, st_size_t *osamp) |
| 281 | 273 | { |
| 282 | 274 | stretch_t stretch = (stretch_t) effp->priv; |
| 283 | 275 | st_size_t iindex, oindex; |
| 284 | − int i; | |
| 276 | + st_size_t i; | |
| 285 | 277 | |
| 286 | 278 | iindex = 0; |
| 287 | 279 | oindex = 0; |
| @@ -353,10 +345,10 @@ int st_stretch_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf, · 65 unmodified lines | ||
| 353 | 345 | * Drain buffer at the end |
| 354 | 346 | * maybe not correct ? end might be artificially faded? |
| 355 | 347 | */ |
| 356 | −int st_stretch_drain(eff_t effp, st_sample_t *obuf, st_size_t *osamp) | |
| 348 | +static int st_stretch_drain(eff_t effp, st_sample_t *obuf, st_size_t *osamp) | |
| 357 | 349 | { |
| 358 | 350 | stretch_t stretch = (stretch_t) effp->priv; |
| 359 | − register int i; | |
| 351 | + st_size_t i; | |
| 360 | 352 | st_size_t oindex; |
| 361 | 353 | |
| 362 | 354 | oindex = 0; |
| @@ -393,7 +385,7 @@ int st_stretch_drain(eff_t effp, st_sample_t *obuf, st_size_t *osamp) · 30 unmodified lines | ||
| 393 | 385 | * Do anything required when you stop reading samples. |
| 394 | 386 | * Don't close input file! |
| 395 | 387 | */ |
| 396 | −int st_stretch_stop(eff_t effp) | |
| 388 | +static int st_stretch_stop(eff_t effp) | |
| 397 | 389 | { |
| 398 | 390 | stretch_t stretch = (stretch_t) effp->priv; |
| 399 | 391 | |