aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-01-25 23:52:09 -0800
committerChris Robinson <[email protected]>2018-01-25 23:52:09 -0800
commit6ae7fc5df1184f748b9c71f3f8d0dfe504ae19b9 (patch)
tree612b20da7623b32e58550526a4d3fd72499e5aca
parent99f0377ae3f24ebf3391a09940d888dec1d4b4c4 (diff)
Add the printf-format attribute to alSetError
-rw-r--r--OpenAL32/Include/alError.h3
-rw-r--r--OpenAL32/alListener.c38
-rw-r--r--OpenAL32/alState.c60
3 files changed, 51 insertions, 50 deletions
diff --git a/OpenAL32/Include/alError.h b/OpenAL32/Include/alError.h
index 479697f2..858f81de 100644
--- a/OpenAL32/Include/alError.h
+++ b/OpenAL32/Include/alError.h
@@ -2,6 +2,7 @@
#define _AL_ERROR_H_
#include "alMain.h"
+#include "logging.h"
#ifdef __cplusplus
extern "C" {
@@ -9,7 +10,7 @@ extern "C" {
extern ALboolean TrapALError;
-void alSetError(ALCcontext *context, ALenum errorCode, const char *msg, ...);
+void alSetError(ALCcontext *context, ALenum errorCode, const char *msg, ...) DECL_FORMAT(printf, 3, 4);
#define SETERR_GOTO(ctx, err, lbl, ...) do { \
alSetError((ctx), (err), __VA_ARGS__); \
diff --git a/OpenAL32/alListener.c b/OpenAL32/alListener.c
index 6d1db2fb..290ae8ca 100644
--- a/OpenAL32/alListener.c
+++ b/OpenAL32/alListener.c
@@ -64,7 +64,7 @@ AL_API ALvoid AL_APIENTRY alListenerf(ALenum param, ALfloat value)
break;
default:
- alSetError(context, AL_INVALID_ENUM, 0, "Invalid listener float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid listener float property");
}
done:
@@ -104,7 +104,7 @@ AL_API ALvoid AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat val
break;
default:
- alSetError(context, AL_INVALID_ENUM, 0, "Invalid listener 3-float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid listener 3-float property");
}
done:
@@ -157,7 +157,7 @@ AL_API ALvoid AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values)
break;
default:
- alSetError(context, AL_INVALID_ENUM, 0, "Invalid listener float-vector property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid listener float-vector property");
}
done:
@@ -177,7 +177,7 @@ AL_API ALvoid AL_APIENTRY alListeneri(ALenum param, ALint UNUSED(value))
switch(param)
{
default:
- alSetError(context, AL_INVALID_ENUM, 0, "Invalid listener integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid listener integer property");
}
WriteUnlock(&context->PropLock);
@@ -204,7 +204,7 @@ AL_API void AL_APIENTRY alListener3i(ALenum param, ALint value1, ALint value2, A
switch(param)
{
default:
- alSetError(context, AL_INVALID_ENUM, 0, "Invalid listener 3-integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid listener 3-integer property");
}
WriteUnlock(&context->PropLock);
@@ -243,11 +243,11 @@ AL_API void AL_APIENTRY alListeneriv(ALenum param, const ALint *values)
WriteLock(&context->PropLock);
if(!values)
- alSetError(context, AL_INVALID_VALUE, 0, "NULL pointer");
+ alSetError(context, AL_INVALID_VALUE, "NULL pointer");
else switch(param)
{
default:
- alSetError(context, AL_INVALID_ENUM, 0, "Invalid listener integer-vector property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid listener integer-vector property");
}
WriteUnlock(&context->PropLock);
@@ -264,7 +264,7 @@ AL_API ALvoid AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value)
ReadLock(&context->PropLock);
if(!value)
- alSetError(context, AL_INVALID_VALUE, 0, "NULL pointer");
+ alSetError(context, AL_INVALID_VALUE, "NULL pointer");
else switch(param)
{
case AL_GAIN:
@@ -276,7 +276,7 @@ AL_API ALvoid AL_APIENTRY alGetListenerf(ALenum param, ALfloat *value)
break;
default:
- alSetError(context, AL_INVALID_ENUM, 0, "Invalid listener float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid listener float property");
}
ReadUnlock(&context->PropLock);
@@ -293,7 +293,7 @@ AL_API ALvoid AL_APIENTRY alGetListener3f(ALenum param, ALfloat *value1, ALfloat
ReadLock(&context->PropLock);
if(!value1 || !value2 || !value3)
- alSetError(context, AL_INVALID_VALUE, 0, "NULL pointer");
+ alSetError(context, AL_INVALID_VALUE, "NULL pointer");
else switch(param)
{
case AL_POSITION:
@@ -309,7 +309,7 @@ AL_API ALvoid AL_APIENTRY alGetListener3f(ALenum param, ALfloat *value1, ALfloat
break;
default:
- alSetError(context, AL_INVALID_ENUM, 0, "Invalid listener 3-float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid listener 3-float property");
}
ReadUnlock(&context->PropLock);
@@ -339,7 +339,7 @@ AL_API ALvoid AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values)
ReadLock(&context->PropLock);
if(!values)
- alSetError(context, AL_INVALID_VALUE, 0, "NULL pointer");
+ alSetError(context, AL_INVALID_VALUE, "NULL pointer");
else switch(param)
{
case AL_ORIENTATION:
@@ -353,7 +353,7 @@ AL_API ALvoid AL_APIENTRY alGetListenerfv(ALenum param, ALfloat *values)
break;
default:
- alSetError(context, AL_INVALID_ENUM, 0, "Invalid listener float-vector property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid listener float-vector property");
}
ReadUnlock(&context->PropLock);
@@ -370,11 +370,11 @@ AL_API ALvoid AL_APIENTRY alGetListeneri(ALenum param, ALint *value)
ReadLock(&context->PropLock);
if(!value)
- alSetError(context, AL_INVALID_VALUE, 0, "NULL pointer");
+ alSetError(context, AL_INVALID_VALUE, "NULL pointer");
else switch(param)
{
default:
- alSetError(context, AL_INVALID_ENUM, 0, "Invalid listener integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid listener integer property");
}
ReadUnlock(&context->PropLock);
@@ -391,7 +391,7 @@ AL_API void AL_APIENTRY alGetListener3i(ALenum param, ALint *value1, ALint *valu
ReadLock(&context->PropLock);
if(!value1 || !value2 || !value3)
- alSetError(context, AL_INVALID_VALUE, 0, "NULL pointer");
+ alSetError(context, AL_INVALID_VALUE, "NULL pointer");
else switch(param)
{
case AL_POSITION:
@@ -407,7 +407,7 @@ AL_API void AL_APIENTRY alGetListener3i(ALenum param, ALint *value1, ALint *valu
break;
default:
- alSetError(context, AL_INVALID_ENUM, 0, "Invalid listener 3-integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid listener 3-integer property");
}
ReadUnlock(&context->PropLock);
@@ -432,7 +432,7 @@ AL_API void AL_APIENTRY alGetListeneriv(ALenum param, ALint* values)
ReadLock(&context->PropLock);
if(!values)
- alSetError(context, AL_INVALID_VALUE, 0, "NULL pointer");
+ alSetError(context, AL_INVALID_VALUE, "NULL pointer");
else switch(param)
{
case AL_ORIENTATION:
@@ -446,7 +446,7 @@ AL_API void AL_APIENTRY alGetListeneriv(ALenum param, ALint* values)
break;
default:
- alSetError(context, AL_INVALID_ENUM, 0, "Invalid listener integer-vector property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid listener integer-vector property");
}
ReadUnlock(&context->PropLock);
diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c
index 1d442a1c..2637aacd 100644
--- a/OpenAL32/alState.c
+++ b/OpenAL32/alState.c
@@ -88,7 +88,7 @@ AL_API ALvoid AL_APIENTRY alEnable(ALenum capability)
break;
default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid enable property");
+ alSetError(context, AL_INVALID_VALUE, "Invalid enable property");
}
WriteUnlock(&context->PropLock);
@@ -111,7 +111,7 @@ AL_API ALvoid AL_APIENTRY alDisable(ALenum capability)
break;
default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid disable property");
+ alSetError(context, AL_INVALID_VALUE, "Invalid disable property");
}
WriteUnlock(&context->PropLock);
@@ -133,7 +133,7 @@ AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability)
break;
default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid is enabled property");
+ alSetError(context, AL_INVALID_VALUE, "Invalid is enabled property");
}
ALCcontext_DecRef(context);
@@ -190,7 +190,7 @@ AL_API ALboolean AL_APIENTRY alGetBoolean(ALenum pname)
break;
default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid boolean property");
+ alSetError(context, AL_INVALID_VALUE, "Invalid boolean property");
}
ALCcontext_DecRef(context);
@@ -241,7 +241,7 @@ AL_API ALdouble AL_APIENTRY alGetDouble(ALenum pname)
break;
default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid double property");
+ alSetError(context, AL_INVALID_VALUE, "Invalid double property");
}
ALCcontext_DecRef(context);
@@ -292,7 +292,7 @@ AL_API ALfloat AL_APIENTRY alGetFloat(ALenum pname)
break;
default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid float property");
+ alSetError(context, AL_INVALID_VALUE, "Invalid float property");
}
ALCcontext_DecRef(context);
@@ -343,7 +343,7 @@ AL_API ALint AL_APIENTRY alGetInteger(ALenum pname)
break;
default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid integer property");
+ alSetError(context, AL_INVALID_VALUE, "Invalid integer property");
}
ALCcontext_DecRef(context);
@@ -394,7 +394,7 @@ AL_API ALint64SOFT AL_APIENTRY alGetInteger64SOFT(ALenum pname)
break;
default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid integer64 property");
+ alSetError(context, AL_INVALID_VALUE, "Invalid integer64 property");
}
ALCcontext_DecRef(context);
@@ -411,16 +411,16 @@ AL_API void* AL_APIENTRY alGetPointerSOFT(ALenum pname)
switch(pname)
{
- case AL_EVENT_CALLBACK_FUNCTION_SOFT:
- value = context->EventCb;
- break;
+ case AL_EVENT_CALLBACK_FUNCTION_SOFT:
+ value = context->EventCb;
+ break;
- case AL_EVENT_CALLBACK_USER_PARAM_SOFT:
- value = context->EventParam;
- break;
+ case AL_EVENT_CALLBACK_USER_PARAM_SOFT:
+ value = context->EventParam;
+ break;
- default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid pointer property");
+ default:
+ alSetError(context, AL_INVALID_VALUE, "Invalid pointer property");
}
ALCcontext_DecRef(context);
@@ -452,11 +452,11 @@ AL_API ALvoid AL_APIENTRY alGetBooleanv(ALenum pname, ALboolean *values)
if(!context) return;
if(!values)
- alSetError(context, AL_INVALID_VALUE, 0, "NULL pointer");
+ alSetError(context, AL_INVALID_VALUE, "NULL pointer");
switch(pname)
{
default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid boolean-vector property");
+ alSetError(context, AL_INVALID_VALUE, "Invalid boolean-vector property");
}
ALCcontext_DecRef(context);
@@ -487,11 +487,11 @@ AL_API ALvoid AL_APIENTRY alGetDoublev(ALenum pname, ALdouble *values)
if(!context) return;
if(!values)
- alSetError(context, AL_INVALID_VALUE, 0, "NULL pointer");
+ alSetError(context, AL_INVALID_VALUE, "NULL pointer");
switch(pname)
{
default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid double-vector property");
+ alSetError(context, AL_INVALID_VALUE, "Invalid double-vector property");
}
ALCcontext_DecRef(context);
@@ -522,11 +522,11 @@ AL_API ALvoid AL_APIENTRY alGetFloatv(ALenum pname, ALfloat *values)
if(!context) return;
if(!values)
- alSetError(context, AL_INVALID_VALUE, 0, "NULL pointer");
+ alSetError(context, AL_INVALID_VALUE, "NULL pointer");
switch(pname)
{
default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid float-vector property");
+ alSetError(context, AL_INVALID_VALUE, "Invalid float-vector property");
}
ALCcontext_DecRef(context);
@@ -557,11 +557,11 @@ AL_API ALvoid AL_APIENTRY alGetIntegerv(ALenum pname, ALint *values)
if(!context) return;
if(!values)
- alSetError(context, AL_INVALID_VALUE, 0, "NULL pointer");
+ alSetError(context, AL_INVALID_VALUE, "NULL pointer");
switch(pname)
{
default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid integer-vector property");
+ alSetError(context, AL_INVALID_VALUE, "Invalid integer-vector property");
}
ALCcontext_DecRef(context);
@@ -592,11 +592,11 @@ AL_API void AL_APIENTRY alGetInteger64vSOFT(ALenum pname, ALint64SOFT *values)
if(!context) return;
if(!values)
- alSetError(context, AL_INVALID_VALUE, 0, "NULL pointer");
+ alSetError(context, AL_INVALID_VALUE, "NULL pointer");
switch(pname)
{
default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid integer64-vector property");
+ alSetError(context, AL_INVALID_VALUE, "Invalid integer64-vector property");
}
ALCcontext_DecRef(context);
@@ -621,11 +621,11 @@ AL_API void AL_APIENTRY alGetPointervSOFT(ALenum pname, void **values)
if(!context) return;
if(!values)
- alSetError(context, AL_INVALID_VALUE, 0, "NULL pointer");
+ alSetError(context, AL_INVALID_VALUE, "NULL pointer");
switch(pname)
{
default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid pointer-vector property");
+ alSetError(context, AL_INVALID_VALUE, "Invalid pointer-vector property");
}
ALCcontext_DecRef(context);
@@ -682,7 +682,7 @@ AL_API const ALchar* AL_APIENTRY alGetString(ALenum pname)
break;
default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid string property");
+ alSetError(context, AL_INVALID_VALUE, "Invalid string property");
}
ALCcontext_DecRef(context);
@@ -834,7 +834,7 @@ AL_API const ALchar* AL_APIENTRY alGetStringiSOFT(ALenum pname, ALsizei index)
break;
default:
- alSetError(context, AL_INVALID_VALUE, 0, "Invalid string indexed property");
+ alSetError(context, AL_INVALID_VALUE, "Invalid string indexed property");
}
done: