From 4a65747a4b20cbbfb2627bf10ded6f5b897cb908 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 19 Feb 2012 12:07:40 -0800 Subject: Add a COUNTOF macro to get the number of entries in a static array --- Alc/backends/alsa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Alc/backends') diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c index 51579750..9f77b60d 100644 --- a/Alc/backends/alsa.c +++ b/Alc/backends/alsa.c @@ -703,7 +703,7 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) }; size_t k; - for(k = 0;k < sizeof(formatlist)/sizeof(formatlist[0]);k++) + for(k = 0;k < COUNTOF(formatlist);k++) { format = formatlist[k].format; if(snd_pcm_hw_params_test_format(data->pcmHandle, p, format) >= 0) @@ -726,7 +726,7 @@ static ALCboolean alsa_reset_playback(ALCdevice *device) }; size_t k; - for(k = 0;k < sizeof(channellist)/sizeof(channellist[0]);k++) + for(k = 0;k < COUNTOF(channellist);k++) { if(snd_pcm_hw_params_test_channels(data->pcmHandle, p, ChannelsFromDevFmt(channellist[k])) >= 0) { -- cgit v1.2.3