diff options
author | Rob Sykes <robs@users.sourceforge.net> | 2015-08-21 00:06:38 +0300 |
---|---|---|
committer | Rob Sykes <robs@users.sourceforge.net> | 2015-08-21 00:06:38 +0300 |
commit | 32c99e847cda2b6f5a64d5e75272168d0b86a5ff (patch) | |
tree | a0bd68a868752059d766c1b7c919a35c6e0f9bce | |
parent | 86e855d3e4d676df597e168ccbc93c232827eece (diff) |
fix compiler warning
-rw-r--r-- | examples/5-variable-rate.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/5-variable-rate.c b/examples/5-variable-rate.c index 63c2063..1a1c63f 100644 --- a/examples/5-variable-rate.c +++ b/examples/5-variable-rate.c @@ -29,7 +29,7 @@ int main(int argc, char *arg[]) int opt = argc <= 1? 2 : (atoi(arg[1]) & 3), saw = opt & 1, fm = opt & 2; float ibuf[10 << OCTAVES], obuf[AL(ibuf)]; int i, wl = 2 << OCTAVES; - size_t ilen = AL(ibuf), need_input = 1; + size_t ilen = AL(ibuf), need_input = 1, written; size_t odone, total_odone, total_olen = OLEN * FS; size_t olen1 = fm? 10 : AL(obuf); /* Small block-len if fast-changing ratio */ soxr_error_t error; @@ -69,7 +69,7 @@ int main(int argc, char *arg[]) do { size_t len = need_input? ilen : 0; error = soxr_process(soxr, ibuf, len, NULL, obuf, block_len, &odone); - fwrite(obuf, sizeof(float), odone, stdout); + written = fwrite(obuf, sizeof(float), odone, stdout); /* Update counters for the current block and for the total length: */ block_len -= odone; @@ -79,7 +79,7 @@ int main(int argc, char *arg[]) * again, supplying more input samples: */ need_input = block_len != 0; - } while (need_input && !error); + } while (need_input && !error && written == odone); /* Now that the block for the current ioratio is complete, go back * round the main `for' loop in order to process the next block. */ |