aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alMain.h1
-rw-r--r--OpenAL32/alBuffer.c4
-rw-r--r--OpenAL32/alEffect.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 8427f83b..490721be 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -105,6 +105,7 @@ static const union {
} EndianTest = { 1 };
#define IS_LITTLE_ENDIAN (EndianTest.b[0] == 1)
+#define COUNTOF(x) (sizeof((x))/sizeof((x)[0]))
#ifdef _WIN32
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index 6a3bb114..5a0e1dee 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -2136,7 +2136,7 @@ static ALboolean DecomposeUserFormat(ALenum format, enum UserFmtChannels *chans,
};
ALuint i;
- for(i = 0;i < sizeof(list)/sizeof(list[0]);i++)
+ for(i = 0;i < COUNTOF(list);i++)
{
if(list[i].format == format)
{
@@ -2213,7 +2213,7 @@ static ALboolean DecomposeFormat(ALenum format, enum FmtChannels *chans, enum Fm
};
ALuint i;
- for(i = 0;i < sizeof(list)/sizeof(list[0]);i++)
+ for(i = 0;i < COUNTOF(list);i++)
{
if(list[i].format == format)
{
diff --git a/OpenAL32/alEffect.c b/OpenAL32/alEffect.c
index 4e04089c..aebda3c7 100644
--- a/OpenAL32/alEffect.c
+++ b/OpenAL32/alEffect.c
@@ -1449,7 +1449,7 @@ static const struct {
DECL(SMALLWATERROOM),
};
#undef DECL
-static const ALsizei reverblistsize = sizeof(reverblist)/sizeof(reverblist[0]);
+static const ALsizei reverblistsize = COUNTOF(reverblist);
ALvoid GetReverbEffect(const char *name, ALeffect *effect)
{