From c37567a14f13dc7edda326d8b9b2253daeee87ba Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 12 Mar 2009 18:34:38 +0100 Subject: audio: converted device number check to assertion No caller must ever pass an invalid device number to mixer_control_setvol() or mixer_control_getvol(). --- src/mixer_control.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mixer_control.c b/src/mixer_control.c index 782fbcd6a..a43230d5a 100644 --- a/src/mixer_control.c +++ b/src/mixer_control.c @@ -22,14 +22,15 @@ #include "output_plugin.h" #include "output_internal.h" +#include + bool mixer_control_setvol(unsigned int device, int volume, int rel) { struct audio_output *output; struct mixer *mixer; - if (device >= audio_output_count()) - return false; + assert(device < audio_output_count()); output = audio_output_get(device); mixer = ao_plugin_get_mixer(output->plugin, output->data); @@ -57,8 +58,7 @@ mixer_control_getvol(unsigned int device, int *volume) struct audio_output *output; struct mixer *mixer; - if (device >= audio_output_count()) - return false; + assert(device < audio_output_count()); output = audio_output_get(device); mixer = ao_plugin_get_mixer(output->plugin, output->data); -- cgit v1.2.3