From a493aafe0209cc7d82e505fdf1cb9cf4bd0895f9 Mon Sep 17 00:00:00 2001 From: Laszlo Ashin Date: Sat, 22 Nov 2008 14:27:18 +0100 Subject: wavpack: use assert_static() --- src/decoder/wavpack_plugin.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/decoder') diff --git a/src/decoder/wavpack_plugin.c b/src/decoder/wavpack_plugin.c index 2dcc35102..519f5bf6e 100644 --- a/src/decoder/wavpack_plugin.c +++ b/src/decoder/wavpack_plugin.c @@ -20,6 +20,7 @@ #include "../decoder_api.h" #include "../path.h" +#include "../utils.h" #include #include @@ -71,7 +72,7 @@ format_samples_int(int bytes_per_sample, void *buffer, uint32_t count) * of the output samples never can be greater than the size * of the input ones. Otherwise we would have an overflow. */ - assert(sizeof(uchar) <= sizeof(uint32_t)); + assert_static(sizeof(*dst) <= sizeof(*src)); /* pass through and align 8-bit samples */ while (count--) { @@ -81,7 +82,7 @@ format_samples_int(int bytes_per_sample, void *buffer, uint32_t count) } case 2: { uint16_t *dst = buffer; - assert(sizeof(uint16_t) <= sizeof(uint32_t)); + assert_static(sizeof(*dst) <= sizeof(*src)); /* pass through and align 16-bit samples */ while (count--) { @@ -94,7 +95,7 @@ format_samples_int(int bytes_per_sample, void *buffer, uint32_t count) break; case 4: { uint32_t *dst = buffer; - assert(sizeof(uint32_t) <= sizeof(uint32_t)); + assert_static(sizeof(*dst) <= sizeof(*src)); /* downsample to 24-bit */ while (count--) { @@ -114,7 +115,7 @@ format_samples_float(mpd_unused int bytes_per_sample, void *buffer, { int32_t *dst = buffer; float *src = buffer; - assert(sizeof(int32_t) <= sizeof(float)); + assert_static(sizeof(*dst) <= sizeof(*src)); while (count--) { *dst++ = (int32_t)(*src++ + 0.5f); -- cgit v1.2.3