Fix most compiler warnings on macOS with clang https://codeberg.org/sox_ng/sox_ng/commit/3fc3066559b321e38cae3d10b1726a7999be74c8 Make all seek() functions take sox_uint64_t https://codeberg.org/sox_ng/sox_ng/commit/92209eabad2b657f692c6580251d64aec8227f41 --- src/flac.c.orig 2014-10-05 21:02:30.000000000 -0500 +++ src/flac.c 2024-11-11 21:53:42.000000000 -0600 @@ -580,7 +580,7 @@ -static int seek(sox_format_t * ft, uint64_t offset) +static int seek(sox_format_t * ft, sox_uint64_t offset) { priv_t * p = (priv_t *)ft->priv; p->seek_offset = offset; --- src/mp3.c.orig 2014-10-05 20:59:34.000000000 -0500 +++ src/mp3.c 2024-11-11 21:53:42.000000000 -0600 @@ -120,6 +120,7 @@ MAD_FUNC(f,x, signed long, mad_timer_count, (mad_timer_t, enum mad_units)) \ MAD_FUNC(f,x, void, mad_timer_multiply, (mad_timer_t *, signed long)) +#ifdef HAVE_LAME static const char* const lame_library_names[] = { #ifdef DL_LAME @@ -130,6 +131,7 @@ #endif NULL }; +#endif #ifdef DL_LAME @@ -558,7 +560,7 @@ return SOX_SUCCESS; } -static int sox_mp3seek(sox_format_t * ft, uint64_t offset) +static int sox_mp3seek(sox_format_t * ft, sox_uint64_t offset) { priv_t * p = (priv_t *) ft->priv; size_t initial_bitrate = p->Frame.header.bitrate; @@ -1231,7 +1233,9 @@ static int stopwrite(sox_format_t * ft) { priv_t *p = (priv_t *) ft->priv; +#ifdef HAVE_LAME uint64_t num_samples = ft->olength == SOX_IGNORE_LENGTH ? 0 : ft->olength / max(ft->signal.channels, 1); +#endif int written = 0; if (p->mp2) { --- src/opus.c.orig 2014-10-05 21:02:30.000000000 -0500 +++ src/opus.c 2024-11-11 21:53:42.000000000 -0600 @@ -215,7 +215,7 @@ return (SOX_SUCCESS); } -static int seek(sox_format_t * ft, uint64_t offset) +static int seek(sox_format_t * ft, sox_uint64_t offset) { priv_t * vb = (priv_t *) ft->priv; --- src/prc.c.orig 2012-01-23 16:27:33.000000000 -0600 +++ src/prc.c 2024-11-11 21:53:42.000000000 -0600 @@ -68,7 +68,7 @@ static void prcwriteheader(sox_format_t * ft); -static int seek(sox_format_t * ft, uint64_t offset) +static int seek(sox_format_t * ft, sox_uint64_t offset) { priv_t * p = (priv_t *)ft->priv; if (ft->encoding.encoding == SOX_ENCODING_ALAW) --- src/raw.c.orig 2012-01-23 16:27:33.000000000 -0600 +++ src/raw.c 2024-11-11 21:53:42.000000000 -0600 @@ -19,7 +19,7 @@ #define SOX_SAMPLE_TO_ULAW_BYTE(d,c) sox_14linear2ulaw(SOX_SAMPLE_TO_UNSIGNED(14,d,c) - 0x2000) #define SOX_SAMPLE_TO_ALAW_BYTE(d,c) sox_13linear2alaw(SOX_SAMPLE_TO_UNSIGNED(13,d,c) - 0x1000) -int lsx_rawseek(sox_format_t * ft, uint64_t offset) +int lsx_rawseek(sox_format_t * ft, sox_uint64_t offset) { return lsx_offset_seek(ft, (off_t)ft->data_start, (off_t)offset); } --- src/skelform.c.orig 2014-10-05 20:59:34.000000000 -0500 +++ src/skelform.c 2024-11-11 21:53:42.000000000 -0600 @@ -183,7 +183,7 @@ return SOX_SUCCESS; } -static int seek(sox_format_t UNUSED * ft, uint64_t UNUSED offset) +static int seek(sox_format_t UNUSED * ft, sox_uint64_t UNUSED offset) { /* Seek relative to current position. */ return SOX_SUCCESS; --- src/smp.c.orig 2012-01-23 16:27:33.000000000 -0600 +++ src/smp.c 2024-11-11 21:53:42.000000000 -0600 @@ -172,7 +172,7 @@ return(SOX_SUCCESS); } -static int sox_smpseek(sox_format_t * ft, uint64_t offset) +static int sox_smpseek(sox_format_t * ft, sox_uint64_t offset) { uint64_t new_offset; size_t channel_block, alignment; --- src/sndfile.c.orig 2014-10-05 20:59:34.000000000 -0500 +++ src/sndfile.c 2024-11-11 21:53:42.000000000 -0600 @@ -489,7 +489,7 @@ return SOX_SUCCESS; } -static int seek(sox_format_t * ft, uint64_t offset) +static int seek(sox_format_t * ft, sox_uint64_t offset) { priv_t * sf = (priv_t *)ft->priv; sf->sf_seek(sf->sf_file, (sf_count_t)(offset / ft->signal.channels), SEEK_CUR); --- src/sox.c.orig 2014-10-05 21:02:30.000000000 -0500 +++ src/sox.c 2024-11-11 21:53:42.000000000 -0600 @@ -3026,7 +3026,7 @@ "`%s' output clipped %" PRIu64 " samples; decrease volume?", (files[i]->ft->handler.flags & SOX_FILE_DEVICE)? files[i]->ft->handler.names[0] : files[i]->ft->filename, - files[i]->ft->clips); + (uint64_t)(files[i]->ft->clips)); if (mixing_clips > 0) lsx_warn("mix-combining clipped %" PRIu64 " samples; decrease volume?", mixing_clips); --- src/sox_i.h.orig 2014-10-05 21:02:30.000000000 -0500 +++ src/sox_i.h 2024-11-11 21:53:42.000000000 -0600 @@ -235,7 +235,7 @@ int lsx_rawstopread(sox_format_t * ft); int lsx_rawstartwrite(sox_format_t * ft); size_t lsx_rawwrite(sox_format_t * ft, const sox_sample_t *buf, size_t nsamp); -int lsx_rawseek(sox_format_t * ft, uint64_t offset); +int lsx_rawseek(sox_format_t * ft, sox_uint64_t offset); int lsx_rawstart(sox_format_t * ft, sox_bool default_rate, sox_bool default_channels, sox_bool default_length, sox_encoding_t encoding, unsigned bits_per_sample); #define lsx_rawstartread(ft) lsx_rawstart(ft, sox_false, sox_false, sox_false, SOX_ENCODING_UNKNOWN, 0) #define lsx_rawstartwrite lsx_rawstartread --- src/vorbis.c.orig 2014-10-05 21:02:30.000000000 -0500 +++ src/vorbis.c 2024-11-11 21:53:42.000000000 -0600 @@ -405,7 +405,7 @@ return (SOX_SUCCESS); } -static int seek(sox_format_t * ft, uint64_t offset) +static int seek(sox_format_t * ft, sox_uint64_t offset) { priv_t * vb = (priv_t *) ft->priv; --- src/wav.c.orig 2014-12-22 10:38:05.000000000 -0600 +++ src/wav.c 2024-11-11 21:53:42.000000000 -0600 @@ -1725,7 +1725,7 @@ } } -static int seek(sox_format_t * ft, uint64_t offset) +static int seek(sox_format_t * ft, sox_uint64_t offset) { priv_t * wav = (priv_t *) ft->priv; --- src/wavpack.c.orig 2012-01-23 16:27:33.000000000 -0600 +++ src/wavpack.c 2024-11-11 21:53:42.000000000 -0600 @@ -171,7 +171,7 @@ return SOX_SUCCESS; } -static int seek(sox_format_t * ft, uint64_t offset) +static int seek(sox_format_t * ft, sox_uint64_t offset) { priv_t * p = (priv_t *)ft->priv;