aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-02-19 12:07:40 -0800
committerChris Robinson <[email protected]>2012-02-19 12:07:40 -0800
commit4a65747a4b20cbbfb2627bf10ded6f5b897cb908 (patch)
tree9a8c3bc309514340dd8795db8904fe51fd8d3803 /Alc/backends
parent6dc194ed1defc358c9ed4ee8a67db71f5c040766 (diff)
Add a COUNTOF macro to get the number of entries in a static array
Diffstat (limited to 'Alc/backends')
-rw-r--r--Alc/backends/alsa.c4
1 files changed, 2 insertions, 2 deletions
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)
{