Commit 31d84df7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix some compiler warnings

parent 20180ebe
......@@ -105,6 +105,7 @@ static int aif_play (ao_instance_t * _instance, int flags, sample_t * _samples)
instance->size += 256 * sizeof (int16_t) * 2;
(void)flags;
return 0;
}
......
......@@ -34,6 +34,8 @@
static int float_setup (ao_instance_t * instance, int sample_rate, int * flags,
level_t * level, sample_t * bias)
{
(void)instance;
(void)sample_rate;
*flags = DCA_STEREO;
*level = CONVERT_LEVEL;
*bias = 0;
......@@ -62,11 +64,14 @@ static int float_play (ao_instance_t * instance, int flags,
fwrite (samples, sizeof (float), 256 * 2, stdout);
(void)instance;
(void)flags;
return 0;
}
static void float_close (ao_instance_t * instance)
{
(void)instance;
}
static ao_instance_t instance = {float_setup, float_play, float_close};
......
......@@ -43,17 +43,20 @@ static int null_setup (ao_instance_t * _instance, int sample_rate, int * flags,
*flags = instance->channels;
*level = CONVERT_LEVEL;
*bias = CONVERT_BIAS;
(void)sample_rate;
return 0;
}
static int null_play (ao_instance_t * instance, int flags, sample_t * samples)
{
(void)instance; (void)flags; (void)samples;
return 0;
}
static void null_close (ao_instance_t * instance)
{
(void)instance;
}
static null_instance_t instance = {{null_setup, null_play, null_close}, 0};
......
......@@ -20,6 +20,8 @@ static int peak_setup (ao_instance_t * _instance, int sample_rate, int * flags,
{
peak_instance_t * instance = (peak_instance_t *) _instance;
(void)sample_rate;
(void)flags;
*flags = instance->flags;
*level = CONVERT_LEVEL;
*bias = 0;
......@@ -32,6 +34,8 @@ static int peak_play (ao_instance_t * _instance, int flags, sample_t * samples)
peak_instance_t * instance = (peak_instance_t *) _instance;
int i;
(void)flags;
for (i = 0; i < 256 * 2; i++) {
#ifdef LIBDCA_FIXED
float f = fabs (samples[i] * (1.0 / (1 << 30)));
......
......@@ -495,6 +495,8 @@ static void zero (sample_t * samples)
void dca_downmix (sample_t * samples, int acmod, int output, sample_t bias,
level_t clev, level_t slev)
{
(void)clev;
switch (CONVERT (acmod, output & DCA_CHANNEL_MASK)) {
case CONVERT (DCA_CHANNEL, DCA_MONO):
......
......@@ -73,6 +73,7 @@ dca_state_t * dca_init (uint32_t mm_accel)
dca_state_t * state;
int i;
(void)mm_accel;
state = (dca_state_t *) malloc (sizeof (dca_state_t));
if (state == NULL)
return NULL;
......@@ -131,13 +132,13 @@ static int syncinfo (dca_state_t * state, int * flags,
return 0;
*sample_rate = bitstream_get (state, 4);
if (*sample_rate >= sizeof (dca_sample_rates) / sizeof (int))
if ((size_t)*sample_rate >= sizeof (dca_sample_rates) / sizeof (int))
return 0;
*sample_rate = dca_sample_rates[ *sample_rate ];
if (!*sample_rate) return 0;
*bit_rate = bitstream_get (state, 5);
if (*bit_rate >= sizeof (dca_bit_rates) / sizeof (int))
if ((size_t)*bit_rate >= sizeof (dca_bit_rates) / sizeof (int))
return 0;
*bit_rate = dca_bit_rates[ *bit_rate ];
if (!*bit_rate) return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment