summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-10-07 07:44:09 -0700
committerChris Robinson <[email protected]>2013-10-07 07:44:09 -0700
commit1518895e15262deade1b03e29b47a3d149f73c83 (patch)
tree0c3399a3edd858efd10c154753cdedb9fde128c0
parent44172f701c0842fc1a31bfa93b617b361a6d3618 (diff)
Use an UNUSED macro instead of void-tagging unused parameters
-rw-r--r--Alc/ALc.c9
-rw-r--r--Alc/mixer_c.c7
-rw-r--r--OpenAL32/Include/alMain.h16
-rw-r--r--OpenAL32/alBuffer.c20
-rw-r--r--OpenAL32/alFilter.c50
-rw-r--r--OpenAL32/alListener.c4
6 files changed, 49 insertions, 57 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 4ccd628c..8eb99e63 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1330,9 +1330,8 @@ void ALCdevice_UnlockDefault(ALCdevice *device)
{
LeaveCriticalSection(&device->Mutex);
}
-ALint64 ALCdevice_GetLatencyDefault(ALCdevice *device)
+ALint64 ALCdevice_GetLatencyDefault(ALCdevice *UNUSED(device))
{
- (void)device;
return 0;
}
@@ -2132,18 +2131,16 @@ ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device)
*
* Not functional
*/
-ALC_API ALCvoid ALC_APIENTRY alcSuspendContext(ALCcontext *Context)
+ALC_API ALCvoid ALC_APIENTRY alcSuspendContext(ALCcontext *UNUSED(context))
{
- (void)Context;
}
/* alcProcessContext
*
* Not functional
*/
-ALC_API ALCvoid ALC_APIENTRY alcProcessContext(ALCcontext *Context)
+ALC_API ALCvoid ALC_APIENTRY alcProcessContext(ALCcontext *UNUSED(context))
{
- (void)Context;
}
diff --git a/Alc/mixer_c.c b/Alc/mixer_c.c
index da3f8318..34309b12 100644
--- a/Alc/mixer_c.c
+++ b/Alc/mixer_c.c
@@ -8,17 +8,16 @@
#include "alAuxEffectSlot.h"
-static inline ALfloat point32(const ALfloat *vals, ALuint frac)
-{ return vals[0]; (void)frac; }
+static inline ALfloat point32(const ALfloat *vals, ALuint UNUSED(frac))
+{ return vals[0]; }
static inline ALfloat lerp32(const ALfloat *vals, ALuint frac)
{ return lerp(vals[0], vals[1], frac * (1.0f/FRACTIONONE)); }
static inline ALfloat cubic32(const ALfloat *vals, ALuint frac)
{ return cubic(vals[-1], vals[0], vals[1], vals[2], frac * (1.0f/FRACTIONONE)); }
-void Resample_copy32_C(const ALfloat *data, ALuint frac,
+void Resample_copy32_C(const ALfloat *data, ALuint UNUSED(frac),
ALuint increment, ALfloat *restrict OutBuffer, ALuint BufferSize)
{
- (void)frac;
assert(increment==FRACTIONONE);
memcpy(OutBuffer, data, (BufferSize+1)*sizeof(ALfloat));
}
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 10426138..cfe30f47 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -52,14 +52,24 @@ typedef ptrdiff_t ALintptrEXT;
typedef ptrdiff_t ALsizeiptrEXT;
#ifndef U64
-#if !defined(_MSC_VER)
-#if SIZEOF_LONG_LONG == 8
+#if defined(_MSC_VER)
+#define U64(x) ((ALuint64)(x##ui64))
+#elif SIZEOF_LONG_LONG == 8
#define U64(x) ((ALuint64)(x##ull))
#elif SIZEOF_LONG == 8
#define U64(x) ((ALuint64)(x##ul))
#endif
+#endif
+
+#ifndef UNUSED
+#if defined(__cplusplus)
+#define UNUSED(x)
+#elif defined(__GNUC__)
+#define UNUSED(x) UNUSED_##x __attribute__((unused))
+#elif defined(__LCLINT__)
+#define UNUSED(x) /*@unused@*/ x
#else
-#define U64(x) ((ALuint64)(x##ui64))
+#define UNUSED(x) x
#endif
#endif
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index 02c20fb4..fa02582a 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -602,13 +602,11 @@ AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum format)
}
-AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum param, ALfloat value)
+AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum param, ALfloat UNUSED(value))
{
ALCdevice *device;
ALCcontext *context;
- (void)value;
-
context = GetContextRef();
if(!context) return;
@@ -627,15 +625,11 @@ done:
}
-AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3)
+AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum param, ALfloat UNUSED(value1), ALfloat UNUSED(value2), ALfloat UNUSED(value3))
{
ALCdevice *device;
ALCcontext *context;
- (void)value1;
- (void)value2;
- (void)value3;
-
context = GetContextRef();
if(!context) return;
@@ -679,13 +673,11 @@ done:
}
-AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum param, ALint value)
+AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum param, ALint UNUSED(value))
{
ALCdevice *device;
ALCcontext *context;
- (void)value;
-
context = GetContextRef();
if(!context) return;
@@ -704,15 +696,11 @@ done:
}
-AL_API void AL_APIENTRY alBuffer3i(ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3)
+AL_API void AL_APIENTRY alBuffer3i(ALuint buffer, ALenum param, ALint UNUSED(value1), ALint UNUSED(value2), ALint UNUSED(value3))
{
ALCdevice *device;
ALCcontext *context;
- (void)value1;
- (void)value2;
- (void)value3;
-
context = GetContextRef();
if(!context) return;
diff --git a/OpenAL32/alFilter.c b/OpenAL32/alFilter.c
index fd10addc..c8ac7dd3 100644
--- a/OpenAL32/alFilter.c
+++ b/OpenAL32/alFilter.c
@@ -434,10 +434,10 @@ void ALfilterState_setParams(ALfilterState *filter, ALfilterType type, ALfloat g
}
-static void lp_SetParami(ALfilter *filter, ALCcontext *context, ALenum param, ALint val)
-{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); (void)filter;(void)param;(void)val; }
-static void lp_SetParamiv(ALfilter *filter, ALCcontext *context, ALenum param, const ALint *vals)
-{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); (void)filter;(void)param;(void)vals; }
+static void lp_SetParami(ALfilter *UNUSED(filter), ALCcontext *context, ALenum UNUSED(param), ALint UNUSED(val))
+{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); }
+static void lp_SetParamiv(ALfilter *UNUSED(filter), ALCcontext *context, ALenum UNUSED(param), const ALint *UNUSED(vals))
+{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); }
static void lp_SetParamf(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat val)
{
switch(param)
@@ -463,10 +463,10 @@ static void lp_SetParamfv(ALfilter *filter, ALCcontext *context, ALenum param, c
lp_SetParamf(filter, context, param, vals[0]);
}
-static void lp_GetParami(ALfilter *filter, ALCcontext *context, ALenum param, ALint *val)
-{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); (void)filter;(void)param;(void)val; }
-static void lp_GetParamiv(ALfilter *filter, ALCcontext *context, ALenum param, ALint *vals)
-{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); (void)filter;(void)param;(void)vals; }
+static void lp_GetParami(ALfilter *UNUSED(filter), ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(val))
+{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); }
+static void lp_GetParamiv(ALfilter *UNUSED(filter), ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(vals))
+{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); }
static void lp_GetParamf(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *val)
{
switch(param)
@@ -489,23 +489,23 @@ static void lp_GetParamfv(ALfilter *filter, ALCcontext *context, ALenum param, A
}
-static void null_SetParami(ALfilter *filter, ALCcontext *context, ALenum param, ALint val)
-{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); (void)filter;(void)param;(void)val; }
-static void null_SetParamiv(ALfilter *filter, ALCcontext *context, ALenum param, const ALint *vals)
-{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); (void)filter;(void)param;(void)vals; }
-static void null_SetParamf(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat val)
-{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); (void)filter;(void)param;(void)val; }
-static void null_SetParamfv(ALfilter *filter, ALCcontext *context, ALenum param, const ALfloat *vals)
-{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); (void)filter;(void)param;(void)vals; }
-
-static void null_GetParami(ALfilter *filter, ALCcontext *context, ALenum param, ALint *val)
-{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); (void)filter;(void)param;(void)val; }
-static void null_GetParamiv(ALfilter *filter, ALCcontext *context, ALenum param, ALint *vals)
-{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); (void)filter;(void)param;(void)vals; }
-static void null_GetParamf(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *val)
-{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); (void)filter;(void)param;(void)val; }
-static void null_GetParamfv(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *vals)
-{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); (void)filter;(void)param;(void)vals; }
+static void null_SetParami(ALfilter *UNUSED(filter), ALCcontext *context, ALenum UNUSED(param), ALint UNUSED(val))
+{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); }
+static void null_SetParamiv(ALfilter *UNUSED(filter), ALCcontext *context, ALenum UNUSED(param), const ALint *UNUSED(vals))
+{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); }
+static void null_SetParamf(ALfilter *UNUSED(filter), ALCcontext *context, ALenum UNUSED(param), ALfloat UNUSED(val))
+{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); }
+static void null_SetParamfv(ALfilter *UNUSED(filter), ALCcontext *context, ALenum UNUSED(param), const ALfloat *UNUSED(vals))
+{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); }
+
+static void null_GetParami(ALfilter *UNUSED(filter), ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(val))
+{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); }
+static void null_GetParamiv(ALfilter *UNUSED(filter), ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(vals))
+{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); }
+static void null_GetParamf(ALfilter *UNUSED(filter), ALCcontext *context, ALenum UNUSED(param), ALfloat *UNUSED(val))
+{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); }
+static void null_GetParamfv(ALfilter *UNUSED(filter), ALCcontext *context, ALenum UNUSED(param), ALfloat *UNUSED(vals))
+{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); }
ALvoid ReleaseALFilters(ALCdevice *device)
diff --git a/OpenAL32/alListener.c b/OpenAL32/alListener.c
index 682acbb5..246c422f 100644
--- a/OpenAL32/alListener.c
+++ b/OpenAL32/alListener.c
@@ -159,12 +159,10 @@ AL_API ALvoid AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values)
}
-AL_API ALvoid AL_APIENTRY alListeneri(ALenum param, ALint value)
+AL_API ALvoid AL_APIENTRY alListeneri(ALenum param, ALint UNUSED(value))
{
ALCcontext *Context;
- (void)value;
-
Context = GetContextRef();
if(!Context) return;