shithub: sox

Download patch

ref: 47a7cd1a1b1fee0d5c58cc933676b5bba13e75bf
parent: 7a16076aa620d6596300066025672b4c0e2e743b
author: Doug Cook <idigdoug@users.sourceforge.net>
date: Tue Jan 24 23:34:19 EST 2012

Fix a few integer-width warnings/bugs

--- a/src/effects.c
+++ b/src/effects.c
@@ -478,7 +478,7 @@
     lsx_warn("%s clipped %" PRIu64 " samples; decrease volume?",
         effp->handler.name, clips);
   if (effp->obeg != effp->oend)
-    lsx_debug("output buffer still held %" PRIu64 " samples; dropped.",
+    lsx_debug("output buffer still held %" PRIuPTR " samples; dropped.",
         (effp->oend - effp->obeg)/effp->out_signal.channels);
       /* May or may not indicate a problem; it is normal if the user aborted
          processing, or if an effect like "trim" stopped early. */
--- a/src/wav.c
+++ b/src/wav.c
@@ -1540,7 +1540,7 @@
         /* Add a pad byte if the number of data bytes is odd.
            See wavwritehdr() above for the calculation. */
         if (wav->formatTag != WAVE_FORMAT_GSM610)
-          lsx_padbytes(ft, ((wav->numSamples + wav->samplesPerBlock - 1)/wav->samplesPerBlock*wav->blockAlign) % 2);
+          lsx_padbytes(ft, (size_t)((wav->numSamples + wav->samplesPerBlock - 1)/wav->samplesPerBlock*wav->blockAlign) % 2);
 
         free(wav->packet);
         free(wav->samples);