diff options
author | Laszlo Ashin <kodest@gmail.com> | 2008-11-22 14:27:18 +0100 |
---|---|---|
committer | Laszlo Ashin <kodest@gmail.com> | 2008-11-22 14:28:11 +0100 |
commit | a493aafe0209cc7d82e505fdf1cb9cf4bd0895f9 (patch) | |
tree | bda5d9f9aec9e9bb786b30448442368bb8f9c9db /src/decoder/wavpack_plugin.c | |
parent | 457a6f4beef0550c21ecaa7615ac6ec3d9772258 (diff) | |
download | mpd-a493aafe0209cc7d82e505fdf1cb9cf4bd0895f9.tar.gz mpd-a493aafe0209cc7d82e505fdf1cb9cf4bd0895f9.tar.xz mpd-a493aafe0209cc7d82e505fdf1cb9cf4bd0895f9.zip |
wavpack: use assert_static()
Diffstat (limited to 'src/decoder/wavpack_plugin.c')
-rw-r--r-- | src/decoder/wavpack_plugin.c | 9 |
1 files changed, 5 insertions, 4 deletions
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 <wavpack/wavpack.h> #include <glib.h> @@ -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); |