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/compand.c (1 of 93 files). Show all

Unified · Split

src/compand.c+8−8
@@ -70,7 +70,7 @@ typedef struct { · 69 unmodified lines
70 * Don't do initialization now.70 * Don't do initialization now.
71 * The 'info' fields are not yet filled in.71 * The 'info' fields are not yet filled in.
72 */72 */
73int st_compand_getopts(eff_t effp, int n, char **argv) 73static int st_compand_getopts(eff_t effp, int n, char **argv)
74{74{
75 compand_t l = (compand_t) effp->priv;75 compand_t l = (compand_t) effp->priv;
76 76
@@ -191,7 +191,7 @@ int st_compand_getopts(eff_t effp, int n, char **argv) · 114 unmodified lines
191 * Prepare processing.191 * Prepare processing.
192 * Do all initializations.192 * Do all initializations.
193 */193 */
194int st_compand_start(eff_t effp)194static int st_compand_start(eff_t effp)
195{195{
196 compand_t l = (compand_t) effp->priv;196 compand_t l = (compand_t) effp->priv;
197 int i;197 int i;
@@ -264,14 +264,14 @@ static void doVolume(double *v, double samp, compand_t l, int chan) · 66 unmodified lines
264 * Processed signed long samples from ibuf to obuf.264 * Processed signed long samples from ibuf to obuf.
265 * Return number of samples processed.265 * Return number of samples processed.
266 */266 */
267int st_compand_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf, 267static int st_compand_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf,
268 st_size_t *isamp, st_size_t *osamp)268 st_size_t *isamp, st_size_t *osamp)
269{269{
270 compand_t l = (compand_t) effp->priv;270 compand_t l = (compand_t) effp->priv;
271 int len = (*isamp > *osamp) ? *osamp : *isamp;271 int len = (*isamp > *osamp) ? *osamp : *isamp;
272 int filechans = effp->outinfo.channels;272 int filechans = effp->outinfo.channels;
273 int idone,odone;273 int idone,odone;
274 int64_t checkbuf; //if st_sample_t of type int32_t274 int64_t checkbuf; /* if st_sample_t of type int32_t */
275 275
276 for (idone = 0,odone = 0; idone < len; ibuf += filechans) {276 for (idone = 0,odone = 0; idone < len; ibuf += filechans) {
277 int chan;277 int chan;
@@ -326,7 +326,7 @@ int st_compand_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf, · 48 unmodified lines
326 {326 {
327 if (l->delay_buf_cnt >= l->delay_buf_size)327 if (l->delay_buf_cnt >= l->delay_buf_size)
328 {328 {
329 l->delay_buf_full=1; //delay buffer is now definetly full329 l->delay_buf_full=1; /* delay buffer is now definetly full */
330 checkbuf = l->delay_buf[l->delay_buf_ptr]*(outv/v)*l->outgain;330 checkbuf = l->delay_buf[l->delay_buf_ptr]*(outv/v)*l->outgain;
331 ST_SAMPLE_CLIP_COUNT(checkbuf, effp->clippedCount);331 ST_SAMPLE_CLIP_COUNT(checkbuf, effp->clippedCount);
332 obuf[odone] = checkbuf;332 obuf[odone] = checkbuf;
@@ -337,7 +337,7 @@ int st_compand_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf, · 4 unmodified lines
337 else337 else
338 {338 {
339 l->delay_buf_cnt++;339 l->delay_buf_cnt++;
340 idone++; //no "odone++" because we did not fill obuf[...]340 idone++; /* no "odone++" because we did not fill obuf[...] */
341 }341 }
342 l->delay_buf[l->delay_buf_ptr++] = ibuf[chan];342 l->delay_buf[l->delay_buf_ptr++] = ibuf[chan];
343 l->delay_buf_ptr %= l->delay_buf_size;343 l->delay_buf_ptr %= l->delay_buf_size;
@@ -352,7 +352,7 @@ int st_compand_flow(eff_t effp, const st_sample_t *ibuf, st_sample_t *obuf, · 8 unmodified lines
352/*352/*
353 * Drain out compander delay lines.353 * Drain out compander delay lines.
354 */354 */
355int st_compand_drain(eff_t effp, st_sample_t *obuf, st_size_t *osamp)355static int st_compand_drain(eff_t effp, st_sample_t *obuf, st_size_t *osamp)
356{356{
357 compand_t l = (compand_t) effp->priv;357 compand_t l = (compand_t) effp->priv;
358 st_size_t done;358 st_size_t done;
@@ -380,7 +380,7 @@ int st_compand_drain(eff_t effp, st_sample_t *obuf, st_size_t *osamp) · 21 unmodified lines
380/*380/*
381 * Clean up compander effect.381 * Clean up compander effect.
382 */382 */
383int st_compand_stop(eff_t effp)383static int st_compand_stop(eff_t effp)
384{384{
385 compand_t l = (compand_t) effp->priv;385 compand_t l = (compand_t) effp->priv;
386 386

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