History

Fix read and write return types: now st_size_t, like the size inputs.

To support this change, turn on lots more compiler warnings, and fix all the warnings generated.

rrt committed 19 years ago

Commit 4d743c41 parent ce1f8f393 files · +875 −1236Browse files

Showing the changes to src/stretch.c (1 of 93 files). Show all

Unified · Split

src/stretch.c+19−27
@@ -55,36 +55,24 @@ typedef struct · 54 unmodified lines
5555 */
5656 stretch_status_t state; /* automaton status */
5757
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 */
6060 st_sample_t *ibuf; /* input buffer */
6161 int ishift; /* input shift */
6262
63− int oindex; /* next evailable element */
63+ st_size_t oindex; /* next evailable element */
6464 double * obuf; /* output buffer */
65− int oshift; /* output shift */
65+ st_size_t oshift; /* output shift */
6666
67− int fsize; /* fading size */
67+ st_size_t fsize; /* fading size */
6868 double * fbuf; /* fading, 1.0 -> 0.0 */
6969
7070 } * stretch_t;
7171
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−
8472 /*
8573 * Process options
8674 */
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)
8876 {
8977 char usage[1024];
9078 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
170158 /*
171159 * Start processing
172160 */
173−int st_stretch_start(eff_t effp)
161+static int st_stretch_start(eff_t effp)
174162 {
175163 stretch_t stretch = (stretch_t) effp->priv;
176− register int i;
164+ st_size_t i;
177165
178166 /* not necessary. taken care by effect processing? */
179167 if (effp->outinfo.channels != effp->ininfo.channels)
@@ -199,7 +187,7 @@ int st_stretch_start(eff_t effp) · 19 unmodified lines
199187 sizeof(st_sample_t));
200188
201189 /* 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.
203191 */
204192 if (stretch->factor < 1.0)
205193 {
@@ -246,7 +234,11 @@ int st_stretch_start(eff_t effp) · 40 unmodified lines
246234 } else if (stretch->fsize==1)
247235 stretch->fbuf[0] = 1.0;
248236
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);
250242
251243 return ST_SUCCESS;
252244 }
@@ -276,12 +268,12 @@ static void combine(stretch_t stretch) · 23 unmodified lines
276268 /*
277269 * Processes flow.
278270 */
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,
280272 st_size_t *isamp, st_size_t *osamp)
281273 {
282274 stretch_t stretch = (stretch_t) effp->priv;
283275 st_size_t iindex, oindex;
284− int i;
276+ st_size_t i;
285277
286278 iindex = 0;
287279 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
353345 * Drain buffer at the end
354346 * maybe not correct ? end might be artificially faded?
355347 */
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)
357349 {
358350 stretch_t stretch = (stretch_t) effp->priv;
359− register int i;
351+ st_size_t i;
360352 st_size_t oindex;
361353
362354 oindex = 0;
@@ -393,7 +385,7 @@ int st_stretch_drain(eff_t effp, st_sample_t *obuf, st_size_t *osamp) · 30 unmodified lines
393385 * Do anything required when you stop reading samples.
394386 * Don't close input file!
395387 */
396−int st_stretch_stop(eff_t effp)
388+static int st_stretch_stop(eff_t effp)
397389 {
398390 stretch_t stretch = (stretch_t) effp->priv;
399391

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t