aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/effects/chorus.c44
-rw-r--r--Alc/effects/compressor.c24
-rw-r--r--Alc/effects/dedicated.c22
-rw-r--r--Alc/effects/distortion.c32
-rw-r--r--Alc/effects/echo.c30
-rw-r--r--Alc/effects/equalizer.c40
-rw-r--r--Alc/effects/modulator.c14
-rw-r--r--Alc/effects/null.c48
-rw-r--r--Alc/effects/reverb.c92
-rw-r--r--OpenAL32/Include/alError.h10
-rw-r--r--OpenAL32/alAuxEffectSlot.c71
-rw-r--r--OpenAL32/alBuffer.c208
-rw-r--r--OpenAL32/alEffect.c28
-rw-r--r--OpenAL32/alError.c30
-rw-r--r--OpenAL32/alExtension.c2
-rw-r--r--OpenAL32/alFilter.c136
-rw-r--r--OpenAL32/alListener.c13
-rw-r--r--OpenAL32/alSource.c266
-rw-r--r--OpenAL32/alState.c65
-rw-r--r--OpenAL32/event.c6
20 files changed, 610 insertions, 571 deletions
diff --git a/Alc/effects/chorus.c b/Alc/effects/chorus.c
index 75de6be7..666933a8 100644
--- a/Alc/effects/chorus.c
+++ b/Alc/effects/chorus.c
@@ -317,18 +317,18 @@ void ALchorus_setParami(ALeffect *effect, ALCcontext *context, ALenum param, ALi
{
case AL_CHORUS_WAVEFORM:
if(!(val >= AL_CHORUS_MIN_WAVEFORM && val <= AL_CHORUS_MAX_WAVEFORM))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Invalid chorus waveform",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Invalid chorus waveform");
props->Chorus.Waveform = val;
break;
case AL_CHORUS_PHASE:
if(!(val >= AL_CHORUS_MIN_PHASE && val <= AL_CHORUS_MAX_PHASE))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Chorus phase out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Chorus phase out of range");
props->Chorus.Phase = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid chorus integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid chorus integer property 0x%04x", param);
}
}
void ALchorus_setParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
@@ -340,30 +340,30 @@ void ALchorus_setParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALf
{
case AL_CHORUS_RATE:
if(!(val >= AL_CHORUS_MIN_RATE && val <= AL_CHORUS_MAX_RATE))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Chorus rate out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Chorus rate out of range");
props->Chorus.Rate = val;
break;
case AL_CHORUS_DEPTH:
if(!(val >= AL_CHORUS_MIN_DEPTH && val <= AL_CHORUS_MAX_DEPTH))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Chorus depth out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Chorus depth out of range");
props->Chorus.Depth = val;
break;
case AL_CHORUS_FEEDBACK:
if(!(val >= AL_CHORUS_MIN_FEEDBACK && val <= AL_CHORUS_MAX_FEEDBACK))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Chorus feedback out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Chorus feedback out of range");
props->Chorus.Feedback = val;
break;
case AL_CHORUS_DELAY:
if(!(val >= AL_CHORUS_MIN_DELAY && val <= AL_CHORUS_MAX_DELAY))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Chorus delay out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Chorus delay out of range");
props->Chorus.Delay = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid chorus float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid chorus float property 0x%04x", param);
}
}
void ALchorus_setParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
@@ -383,7 +383,7 @@ void ALchorus_getParami(const ALeffect *effect, ALCcontext *context, ALenum para
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid chorus integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid chorus integer property 0x%04x", param);
}
}
void ALchorus_getParamiv(const ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
@@ -410,7 +410,7 @@ void ALchorus_getParamf(const ALeffect *effect, ALCcontext *context, ALenum para
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid chorus float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid chorus float property 0x%04x", param);
}
}
void ALchorus_getParamfv(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
@@ -453,18 +453,18 @@ void ALflanger_setParami(ALeffect *effect, ALCcontext *context, ALenum param, AL
{
case AL_FLANGER_WAVEFORM:
if(!(val >= AL_FLANGER_MIN_WAVEFORM && val <= AL_FLANGER_MAX_WAVEFORM))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Invalid flanger waveform",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Invalid flanger waveform");
props->Chorus.Waveform = val;
break;
case AL_FLANGER_PHASE:
if(!(val >= AL_FLANGER_MIN_PHASE && val <= AL_FLANGER_MAX_PHASE))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Flanger phase out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Flanger phase out of range");
props->Chorus.Phase = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid flanger integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid flanger integer property 0x%04x", param);
}
}
void ALflanger_setParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
@@ -476,30 +476,30 @@ void ALflanger_setParamf(ALeffect *effect, ALCcontext *context, ALenum param, AL
{
case AL_FLANGER_RATE:
if(!(val >= AL_FLANGER_MIN_RATE && val <= AL_FLANGER_MAX_RATE))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Flanger rate out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Flanger rate out of range");
props->Chorus.Rate = val;
break;
case AL_FLANGER_DEPTH:
if(!(val >= AL_FLANGER_MIN_DEPTH && val <= AL_FLANGER_MAX_DEPTH))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Flanger depth out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Flanger depth out of range");
props->Chorus.Depth = val;
break;
case AL_FLANGER_FEEDBACK:
if(!(val >= AL_FLANGER_MIN_FEEDBACK && val <= AL_FLANGER_MAX_FEEDBACK))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Flanger feedback out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Flanger feedback out of range");
props->Chorus.Feedback = val;
break;
case AL_FLANGER_DELAY:
if(!(val >= AL_FLANGER_MIN_DELAY && val <= AL_FLANGER_MAX_DELAY))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Flanger delay out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Flanger delay out of range");
props->Chorus.Delay = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid flanger float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid flanger float property 0x%04x", param);
}
}
void ALflanger_setParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
@@ -519,13 +519,11 @@ void ALflanger_getParami(const ALeffect *effect, ALCcontext *context, ALenum par
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid flanger integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid flanger integer property 0x%04x", param);
}
}
void ALflanger_getParamiv(const ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
-{
- ALflanger_getParami(effect, context, param, vals);
-}
+{ ALflanger_getParami(effect, context, param, vals); }
void ALflanger_getParamf(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
{
const ALeffectProps *props = &effect->Props;
@@ -548,7 +546,7 @@ void ALflanger_getParamf(const ALeffect *effect, ALCcontext *context, ALenum par
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid flanger float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid flanger float property 0x%04x", param);
}
}
void ALflanger_getParamfv(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
diff --git a/Alc/effects/compressor.c b/Alc/effects/compressor.c
index 330733b3..bb9be8b9 100644
--- a/Alc/effects/compressor.c
+++ b/Alc/effects/compressor.c
@@ -210,20 +210,21 @@ void ALcompressor_setParami(ALeffect *effect, ALCcontext *context, ALenum param,
{
case AL_COMPRESSOR_ONOFF:
if(!(val >= AL_COMPRESSOR_MIN_ONOFF && val <= AL_COMPRESSOR_MAX_ONOFF))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Compressor state out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Compressor state out of range");
props->Compressor.OnOff = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid compressor integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid compressor integer property 0x%04x",
+ param);
}
}
void ALcompressor_setParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
{ ALcompressor_setParami(effect, context, param, vals[0]); }
-void ALcompressor_setParamf(ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALfloat UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid compressor float property"); }
-void ALcompressor_setParamfv(ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), const ALfloat *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid compressor float-vector property"); }
+void ALcompressor_setParamf(ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALfloat UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid compressor float property 0x%04x", param); }
+void ALcompressor_setParamfv(ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, const ALfloat *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid compressor float-vector property 0x%04x", param); }
void ALcompressor_getParami(const ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
{
@@ -235,14 +236,15 @@ void ALcompressor_getParami(const ALeffect *effect, ALCcontext *context, ALenum
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid compressor integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid compressor integer property 0x%04x",
+ param);
}
}
void ALcompressor_getParamiv(const ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
{ ALcompressor_getParami(effect, context, param, vals); }
-void ALcompressor_getParamf(const ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALfloat *UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid compressor float property"); }
-void ALcompressor_getParamfv(const ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALfloat *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid compressor float-vector property"); }
+void ALcompressor_getParamf(const ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALfloat *UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid compressor float property 0x%04x", param); }
+void ALcompressor_getParamfv(const ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALfloat *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid compressor float-vector property 0x%04x", param); }
DEFINE_ALEFFECT_VTABLE(ALcompressor);
diff --git a/Alc/effects/dedicated.c b/Alc/effects/dedicated.c
index 684e8171..70a97ea9 100644
--- a/Alc/effects/dedicated.c
+++ b/Alc/effects/dedicated.c
@@ -139,10 +139,10 @@ ALeffectStateFactory *ALdedicatedStateFactory_getFactory(void)
}
-void ALdedicated_setParami(ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALint UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid dedicated integer property"); }
-void ALdedicated_setParamiv(ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), const ALint *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid dedicated integer-vector property"); }
+void ALdedicated_setParami(ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALint UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid dedicated integer property 0x%04x", param); }
+void ALdedicated_setParamiv(ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, const ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid dedicated integer-vector property 0x%04x", param); }
void ALdedicated_setParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
{
ALeffectProps *props = &effect->Props;
@@ -150,21 +150,21 @@ void ALdedicated_setParamf(ALeffect *effect, ALCcontext *context, ALenum param,
{
case AL_DEDICATED_GAIN:
if(!(val >= 0.0f && isfinite(val)))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Dedicated gain out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Dedicated gain out of range");
props->Dedicated.Gain = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid dedicated float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid dedicated float property 0x%04x", param);
}
}
void ALdedicated_setParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
{ ALdedicated_setParamf(effect, context, param, vals[0]); }
-void ALdedicated_getParami(const ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid dedicated integer property"); }
-void ALdedicated_getParamiv(const ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid dedicated integer-vector property"); }
+void ALdedicated_getParami(const ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALint *UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid dedicated integer property 0x%04x", param); }
+void ALdedicated_getParamiv(const ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid dedicated integer-vector property 0x%04x", param); }
void ALdedicated_getParamf(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
{
const ALeffectProps *props = &effect->Props;
@@ -175,7 +175,7 @@ void ALdedicated_getParamf(const ALeffect *effect, ALCcontext *context, ALenum p
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid dedicated float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid dedicated float property 0x%04x", param);
}
}
void ALdedicated_getParamfv(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
diff --git a/Alc/effects/distortion.c b/Alc/effects/distortion.c
index 2a7c21ec..dcb2bfe4 100644
--- a/Alc/effects/distortion.c
+++ b/Alc/effects/distortion.c
@@ -198,10 +198,10 @@ ALeffectStateFactory *ALdistortionStateFactory_getFactory(void)
}
-void ALdistortion_setParami(ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALint UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid distortion integer property"); }
-void ALdistortion_setParamiv(ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), const ALint *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid distortion integer-vector property"); }
+void ALdistortion_setParami(ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALint UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid distortion integer property 0x%04x", param); }
+void ALdistortion_setParamiv(ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, const ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid distortion integer-vector property 0x%04x", param); }
void ALdistortion_setParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
{
ALeffectProps *props = &effect->Props;
@@ -209,45 +209,46 @@ void ALdistortion_setParamf(ALeffect *effect, ALCcontext *context, ALenum param,
{
case AL_DISTORTION_EDGE:
if(!(val >= AL_DISTORTION_MIN_EDGE && val <= AL_DISTORTION_MAX_EDGE))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Distortion edge out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Distortion edge out of range");
props->Distortion.Edge = val;
break;
case AL_DISTORTION_GAIN:
if(!(val >= AL_DISTORTION_MIN_GAIN && val <= AL_DISTORTION_MAX_GAIN))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Distortion gain out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Distortion gain out of range");
props->Distortion.Gain = val;
break;
case AL_DISTORTION_LOWPASS_CUTOFF:
if(!(val >= AL_DISTORTION_MIN_LOWPASS_CUTOFF && val <= AL_DISTORTION_MAX_LOWPASS_CUTOFF))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Distortion low-pass cutoff out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Distortion low-pass cutoff out of range");
props->Distortion.LowpassCutoff = val;
break;
case AL_DISTORTION_EQCENTER:
if(!(val >= AL_DISTORTION_MIN_EQCENTER && val <= AL_DISTORTION_MAX_EQCENTER))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Distortion EQ center out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Distortion EQ center out of range");
props->Distortion.EQCenter = val;
break;
case AL_DISTORTION_EQBANDWIDTH:
if(!(val >= AL_DISTORTION_MIN_EQBANDWIDTH && val <= AL_DISTORTION_MAX_EQBANDWIDTH))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Distortion EQ bandwidth out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Distortion EQ bandwidth out of range");
props->Distortion.EQBandwidth = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid distortion float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid distortion float property 0x%04x",
+ param);
}
}
void ALdistortion_setParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
{ ALdistortion_setParamf(effect, context, param, vals[0]); }
-void ALdistortion_getParami(const ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid distortion integer property"); }
-void ALdistortion_getParamiv(const ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid distortion integer-vector property"); }
+void ALdistortion_getParami(const ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALint *UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid distortion integer property 0x%04x", param); }
+void ALdistortion_getParamiv(const ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid distortion integer-vector property 0x%04x", param); }
void ALdistortion_getParamf(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
{
const ALeffectProps *props = &effect->Props;
@@ -274,7 +275,8 @@ void ALdistortion_getParamf(const ALeffect *effect, ALCcontext *context, ALenum
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid distortion float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid distortion float property 0x%04x",
+ param);
}
}
void ALdistortion_getParamfv(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
diff --git a/Alc/effects/echo.c b/Alc/effects/echo.c
index b59b06b0..d8cbd214 100644
--- a/Alc/effects/echo.c
+++ b/Alc/effects/echo.c
@@ -230,10 +230,10 @@ ALeffectStateFactory *ALechoStateFactory_getFactory(void)
}
-void ALecho_setParami(ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALint UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid echo integer property"); }
-void ALecho_setParamiv(ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), const ALint *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid echo integer-vector property"); }
+void ALecho_setParami(ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALint UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid echo integer property 0x%04x", param); }
+void ALecho_setParamiv(ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, const ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid echo integer-vector property 0x%04x", param); }
void ALecho_setParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
{
ALeffectProps *props = &effect->Props;
@@ -241,45 +241,45 @@ void ALecho_setParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALflo
{
case AL_ECHO_DELAY:
if(!(val >= AL_ECHO_MIN_DELAY && val <= AL_ECHO_MAX_DELAY))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Echo delay out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Echo delay out of range");
props->Echo.Delay = val;
break;
case AL_ECHO_LRDELAY:
if(!(val >= AL_ECHO_MIN_LRDELAY && val <= AL_ECHO_MAX_LRDELAY))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Echo LR delay out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Echo LR delay out of range");
props->Echo.LRDelay = val;
break;
case AL_ECHO_DAMPING:
if(!(val >= AL_ECHO_MIN_DAMPING && val <= AL_ECHO_MAX_DAMPING))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Echo damping out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Echo damping out of range");
props->Echo.Damping = val;
break;
case AL_ECHO_FEEDBACK:
if(!(val >= AL_ECHO_MIN_FEEDBACK && val <= AL_ECHO_MAX_FEEDBACK))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Echo feedback out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Echo feedback out of range");
props->Echo.Feedback = val;
break;
case AL_ECHO_SPREAD:
if(!(val >= AL_ECHO_MIN_SPREAD && val <= AL_ECHO_MAX_SPREAD))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Echo spread out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Echo spread out of range");
props->Echo.Spread = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid echo float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid echo float property 0x%04x", param);
}
}
void ALecho_setParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
{ ALecho_setParamf(effect, context, param, vals[0]); }
-void ALecho_getParami(const ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid echo integer property"); }
-void ALecho_getParamiv(const ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid echo integer-vector property"); }
+void ALecho_getParami(const ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALint *UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid echo integer property 0x%04x", param); }
+void ALecho_getParamiv(const ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid echo integer-vector property 0x%04x", param); }
void ALecho_getParamf(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
{
const ALeffectProps *props = &effect->Props;
@@ -306,7 +306,7 @@ void ALecho_getParamf(const ALeffect *effect, ALCcontext *context, ALenum param,
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid echo float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid echo float property 0x%04x", param);
}
}
void ALecho_getParamfv(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
diff --git a/Alc/effects/equalizer.c b/Alc/effects/equalizer.c
index b800d27a..8c2b31e2 100644
--- a/Alc/effects/equalizer.c
+++ b/Alc/effects/equalizer.c
@@ -220,10 +220,10 @@ ALeffectStateFactory *ALequalizerStateFactory_getFactory(void)
}
-void ALequalizer_setParami(ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALint UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid equalizer integer property"); }
-void ALequalizer_setParamiv(ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), const ALint *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid equalizer integer-vector property"); }
+void ALequalizer_setParami(ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALint UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid equalizer integer property 0x%04x", param); }
+void ALequalizer_setParamiv(ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, const ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid equalizer integer-vector property 0x%04x", param); }
void ALequalizer_setParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
{
ALeffectProps *props = &effect->Props;
@@ -231,75 +231,75 @@ void ALequalizer_setParamf(ALeffect *effect, ALCcontext *context, ALenum param,
{
case AL_EQUALIZER_LOW_GAIN:
if(!(val >= AL_EQUALIZER_MIN_LOW_GAIN && val <= AL_EQUALIZER_MAX_LOW_GAIN))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Equalizer low-band gain out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Equalizer low-band gain out of range");
props->Equalizer.LowGain = val;
break;
case AL_EQUALIZER_LOW_CUTOFF:
if(!(val >= AL_EQUALIZER_MIN_LOW_CUTOFF && val <= AL_EQUALIZER_MAX_LOW_CUTOFF))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Equalizer low-band cutoff out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Equalizer low-band cutoff out of range");
props->Equalizer.LowCutoff = val;
break;
case AL_EQUALIZER_MID1_GAIN:
if(!(val >= AL_EQUALIZER_MIN_MID1_GAIN && val <= AL_EQUALIZER_MAX_MID1_GAIN))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Equalizer mid1-band gain out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Equalizer mid1-band gain out of range");
props->Equalizer.Mid1Gain = val;
break;
case AL_EQUALIZER_MID1_CENTER:
if(!(val >= AL_EQUALIZER_MIN_MID1_CENTER && val <= AL_EQUALIZER_MAX_MID1_CENTER))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Equalizer mid1-band center out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Equalizer mid1-band center out of range");
props->Equalizer.Mid1Center = val;
break;
case AL_EQUALIZER_MID1_WIDTH:
if(!(val >= AL_EQUALIZER_MIN_MID1_WIDTH && val <= AL_EQUALIZER_MAX_MID1_WIDTH))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Equalizer mid1-band width out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Equalizer mid1-band width out of range");
props->Equalizer.Mid1Width = val;
break;
case AL_EQUALIZER_MID2_GAIN:
if(!(val >= AL_EQUALIZER_MIN_MID2_GAIN && val <= AL_EQUALIZER_MAX_MID2_GAIN))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Equalizer mid2-band gain out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Equalizer mid2-band gain out of range");
props->Equalizer.Mid2Gain = val;
break;
case AL_EQUALIZER_MID2_CENTER:
if(!(val >= AL_EQUALIZER_MIN_MID2_CENTER && val <= AL_EQUALIZER_MAX_MID2_CENTER))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Equalizer mid2-band center out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Equalizer mid2-band center out of range");
props->Equalizer.Mid2Center = val;
break;
case AL_EQUALIZER_MID2_WIDTH:
if(!(val >= AL_EQUALIZER_MIN_MID2_WIDTH && val <= AL_EQUALIZER_MAX_MID2_WIDTH))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Equalizer mid2-band width out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Equalizer mid2-band width out of range");
props->Equalizer.Mid2Width = val;
break;
case AL_EQUALIZER_HIGH_GAIN:
if(!(val >= AL_EQUALIZER_MIN_HIGH_GAIN && val <= AL_EQUALIZER_MAX_HIGH_GAIN))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Equalizer high-band gain out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Equalizer high-band gain out of range");
props->Equalizer.HighGain = val;
break;
case AL_EQUALIZER_HIGH_CUTOFF:
if(!(val >= AL_EQUALIZER_MIN_HIGH_CUTOFF && val <= AL_EQUALIZER_MAX_HIGH_CUTOFF))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Equalizer high-band cutoff out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Equalizer high-band cutoff out of range");
props->Equalizer.HighCutoff = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid equalizer float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid equalizer float property 0x%04x", param);
}
}
void ALequalizer_setParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
{ ALequalizer_setParamf(effect, context, param, vals[0]); }
-void ALequalizer_getParami(const ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid equalizer integer property"); }
-void ALequalizer_getParamiv(const ALeffect *effect, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid equalizer integer-vector property"); }
+void ALequalizer_getParami(const ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALint *UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid equalizer integer property 0x%04x", param); }
+void ALequalizer_getParamiv(const ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid equalizer integer-vector property 0x%04x", param); }
void ALequalizer_getParamf(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
{
const ALeffectProps *props = &effect->Props;
@@ -346,7 +346,7 @@ void ALequalizer_getParamf(const ALeffect *effect, ALCcontext *context, ALenum p
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid equalizer float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid equalizer float property 0x%04x", param);
}
}
void ALequalizer_getParamfv(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
diff --git a/Alc/effects/modulator.c b/Alc/effects/modulator.c
index 0fb03042..ed0851d6 100644
--- a/Alc/effects/modulator.c
+++ b/Alc/effects/modulator.c
@@ -217,18 +217,18 @@ void ALmodulator_setParamf(ALeffect *effect, ALCcontext *context, ALenum param,
{
case AL_RING_MODULATOR_FREQUENCY:
if(!(val >= AL_RING_MODULATOR_MIN_FREQUENCY && val <= AL_RING_MODULATOR_MAX_FREQUENCY))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Modulator frequency out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Modulator frequency out of range");
props->Modulator.Frequency = val;
break;
case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
if(!(val >= AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF && val <= AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Modulator high-pass cutoff out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Modulator high-pass cutoff out of range");
props->Modulator.HighPassCutoff = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid modulator float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid modulator float property 0x%04x", param);
}
}
void ALmodulator_setParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
@@ -245,12 +245,12 @@ void ALmodulator_setParami(ALeffect *effect, ALCcontext *context, ALenum param,
case AL_RING_MODULATOR_WAVEFORM:
if(!(val >= AL_RING_MODULATOR_MIN_WAVEFORM && val <= AL_RING_MODULATOR_MAX_WAVEFORM))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Invalid modulator waveform",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Invalid modulator waveform");
props->Modulator.Waveform = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid modulator integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid modulator integer property 0x%04x", param);
}
}
void ALmodulator_setParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
@@ -272,7 +272,7 @@ void ALmodulator_getParami(const ALeffect *effect, ALCcontext *context, ALenum p
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid modulator integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid modulator integer property 0x%04x", param);
}
}
void ALmodulator_getParamiv(const ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
@@ -290,7 +290,7 @@ void ALmodulator_getParamf(const ALeffect *effect, ALCcontext *context, ALenum p
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid modulator float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid modulator float property 0x%04x", param);
}
}
void ALmodulator_getParamfv(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
diff --git a/Alc/effects/null.c b/Alc/effects/null.c
index 2dc43870..f9583011 100644
--- a/Alc/effects/null.c
+++ b/Alc/effects/null.c
@@ -110,69 +110,69 @@ ALeffectStateFactory *ALnullStateFactory_getFactory(void)
}
-void ALnull_setParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint UNUSED(val))
+void ALnull_setParami(ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALint UNUSED(val))
{
switch(param)
{
- default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid null effect integer property");
+ default:
+ alSetError(context, AL_INVALID_ENUM, "Invalid null effect integer property 0x%04x", param);
}
}
-void ALnull_setParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint* UNUSED(vals))
+void ALnull_setParamiv(ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, const ALint* UNUSED(vals))
{
switch(param)
{
- default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid null effect integer-vector property");
+ default:
+ alSetError(context, AL_INVALID_ENUM, "Invalid null effect integer-vector property 0x%04x", param);
}
}
-void ALnull_setParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat UNUSED(val))
+void ALnull_setParamf(ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALfloat UNUSED(val))
{
switch(param)
{
- default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid null effect float property");
+ default:
+ alSetError(context, AL_INVALID_ENUM, "Invalid null effect float property 0x%04x", param);
}
}
-void ALnull_setParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat* UNUSED(vals))
+void ALnull_setParamfv(ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, const ALfloat* UNUSED(vals))
{
switch(param)
{
- default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid null effect float-vector property");
+ default:
+ alSetError(context, AL_INVALID_ENUM, "Invalid null effect float-vector property 0x%04x", param);
}
}
-void ALnull_getParami(const ALeffect *effect, ALCcontext *context, ALenum param, ALint* UNUSED(val))
+void ALnull_getParami(const ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALint* UNUSED(val))
{
switch(param)
{
- default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid null effect integer property");
+ default:
+ alSetError(context, AL_INVALID_ENUM, "Invalid null effect integer property 0x%04x", param);
}
}
-void ALnull_getParamiv(const ALeffect *effect, ALCcontext *context, ALenum param, ALint* UNUSED(vals))
+void ALnull_getParamiv(const ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALint* UNUSED(vals))
{
switch(param)
{
- default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid null effect integer-vector property");
+ default:
+ alSetError(context, AL_INVALID_ENUM, "Invalid null effect integer-vector property 0x%04x", param);
}
}
-void ALnull_getParamf(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat* UNUSED(val))
+void ALnull_getParamf(const ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALfloat* UNUSED(val))
{
switch(param)
{
- default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid null effect float property");
+ default:
+ alSetError(context, AL_INVALID_ENUM, "Invalid null effect float property 0x%04x", param);
}
}
-void ALnull_getParamfv(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat* UNUSED(vals))
+void ALnull_getParamfv(const ALeffect *UNUSED(effect), ALCcontext *context, ALenum param, ALfloat* UNUSED(vals))
{
switch(param)
{
- default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid null effect float-vector property");
+ default:
+ alSetError(context, AL_INVALID_ENUM, "Invalid null effect float-vector property 0x%04x", param);
}
}
diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c
index 0cebab9b..64aa8916 100644
--- a/Alc/effects/reverb.c
+++ b/Alc/effects/reverb.c
@@ -1775,12 +1775,13 @@ void ALeaxreverb_setParami(ALeffect *effect, ALCcontext *context, ALenum param,
{
case AL_EAXREVERB_DECAY_HFLIMIT:
if(!(val >= AL_EAXREVERB_MIN_DECAY_HFLIMIT && val <= AL_EAXREVERB_MAX_DECAY_HFLIMIT))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb decay hflimit out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb decay hflimit out of range");
props->Reverb.DecayHFLimit = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid EAX reverb integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid EAX reverb integer property 0x%04x",
+ param);
}
}
void ALeaxreverb_setParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
@@ -1792,126 +1793,127 @@ void ALeaxreverb_setParamf(ALeffect *effect, ALCcontext *context, ALenum param,
{
case AL_EAXREVERB_DENSITY:
if(!(val >= AL_EAXREVERB_MIN_DENSITY && val <= AL_EAXREVERB_MAX_DENSITY))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb density out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb density out of range");
props->Reverb.Density = val;
break;
case AL_EAXREVERB_DIFFUSION:
if(!(val >= AL_EAXREVERB_MIN_DIFFUSION && val <= AL_EAXREVERB_MAX_DIFFUSION))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb diffusion out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb diffusion out of range");
props->Reverb.Diffusion = val;
break;
case AL_EAXREVERB_GAIN:
if(!(val >= AL_EAXREVERB_MIN_GAIN && val <= AL_EAXREVERB_MAX_GAIN))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb gain out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb gain out of range");
props->Reverb.Gain = val;
break;
case AL_EAXREVERB_GAINHF:
if(!(val >= AL_EAXREVERB_MIN_GAINHF && val <= AL_EAXREVERB_MAX_GAINHF))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb gainhf out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb gainhf out of range");
props->Reverb.GainHF = val;
break;
case AL_EAXREVERB_GAINLF:
if(!(val >= AL_EAXREVERB_MIN_GAINLF && val <= AL_EAXREVERB_MAX_GAINLF))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb gainlf out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb gainlf out of range");
props->Reverb.GainLF = val;
break;
case AL_EAXREVERB_DECAY_TIME:
if(!(val >= AL_EAXREVERB_MIN_DECAY_TIME && val <= AL_EAXREVERB_MAX_DECAY_TIME))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb decay time out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb decay time out of range");
props->Reverb.DecayTime = val;
break;
case AL_EAXREVERB_DECAY_HFRATIO:
if(!(val >= AL_EAXREVERB_MIN_DECAY_HFRATIO && val <= AL_EAXREVERB_MAX_DECAY_HFRATIO))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb decay hfratio out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb decay hfratio out of range");
props->Reverb.DecayHFRatio = val;
break;
case AL_EAXREVERB_DECAY_LFRATIO:
if(!(val >= AL_EAXREVERB_MIN_DECAY_LFRATIO && val <= AL_EAXREVERB_MAX_DECAY_LFRATIO))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb decay lfratio out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb decay lfratio out of range");
props->Reverb.DecayLFRatio = val;
break;
case AL_EAXREVERB_REFLECTIONS_GAIN:
if(!(val >= AL_EAXREVERB_MIN_REFLECTIONS_GAIN && val <= AL_EAXREVERB_MAX_REFLECTIONS_GAIN))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb reflections gain out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb reflections gain out of range");
props->Reverb.ReflectionsGain = val;
break;
case AL_EAXREVERB_REFLECTIONS_DELAY:
if(!(val >= AL_EAXREVERB_MIN_REFLECTIONS_DELAY && val <= AL_EAXREVERB_MAX_REFLECTIONS_DELAY))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb reflections delay out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb reflections delay out of range");
props->Reverb.ReflectionsDelay = val;
break;
case AL_EAXREVERB_LATE_REVERB_GAIN:
if(!(val >= AL_EAXREVERB_MIN_LATE_REVERB_GAIN && val <= AL_EAXREVERB_MAX_LATE_REVERB_GAIN))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb late reverb gain out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb late reverb gain out of range");
props->Reverb.LateReverbGain = val;
break;
case AL_EAXREVERB_LATE_REVERB_DELAY:
if(!(val >= AL_EAXREVERB_MIN_LATE_REVERB_DELAY && val <= AL_EAXREVERB_MAX_LATE_REVERB_DELAY))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb late reverb delay out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb late reverb delay out of range");
props->Reverb.LateReverbDelay = val;
break;
case AL_EAXREVERB_AIR_ABSORPTION_GAINHF:
if(!(val >= AL_EAXREVERB_MIN_AIR_ABSORPTION_GAINHF && val <= AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb air absorption gainhf out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb air absorption gainhf out of range");
props->Reverb.AirAbsorptionGainHF = val;
break;
case AL_EAXREVERB_ECHO_TIME:
if(!(val >= AL_EAXREVERB_MIN_ECHO_TIME && val <= AL_EAXREVERB_MAX_ECHO_TIME))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb echo time out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb echo time out of range");
props->Reverb.EchoTime = val;
break;
case AL_EAXREVERB_ECHO_DEPTH:
if(!(val >= AL_EAXREVERB_MIN_ECHO_DEPTH && val <= AL_EAXREVERB_MAX_ECHO_DEPTH))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb echo depth out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb echo depth out of range");
props->Reverb.EchoDepth = val;
break;
case AL_EAXREVERB_MODULATION_TIME:
if(!(val >= AL_EAXREVERB_MIN_MODULATION_TIME && val <= AL_EAXREVERB_MAX_MODULATION_TIME))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb modulation time out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb modulation time out of range");
props->Reverb.ModulationTime = val;
break;
case AL_EAXREVERB_MODULATION_DEPTH:
if(!(val >= AL_EAXREVERB_MIN_MODULATION_DEPTH && val <= AL_EAXREVERB_MAX_MODULATION_DEPTH))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb modulation depth out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb modulation depth out of range");
props->Reverb.ModulationDepth = val;
break;
case AL_EAXREVERB_HFREFERENCE:
if(!(val >= AL_EAXREVERB_MIN_HFREFERENCE && val <= AL_EAXREVERB_MAX_HFREFERENCE))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb hfreference out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb hfreference out of range");
props->Reverb.HFReference = val;
break;
case AL_EAXREVERB_LFREFERENCE:
if(!(val >= AL_EAXREVERB_MIN_LFREFERENCE && val <= AL_EAXREVERB_MAX_LFREFERENCE))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb lfreference out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb lfreference out of range");
props->Reverb.LFReference = val;
break;
case AL_EAXREVERB_ROOM_ROLLOFF_FACTOR:
if(!(val >= AL_EAXREVERB_MIN_ROOM_ROLLOFF_FACTOR && val <= AL_EAXREVERB_MAX_ROOM_ROLLOFF_FACTOR))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb room rolloff factor out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb room rolloff factor out of range");
props->Reverb.RoomRolloffFactor = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid EAX reverb float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid EAX reverb float property 0x%04x",
+ param);
}
}
void ALeaxreverb_setParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
@@ -1921,14 +1923,14 @@ void ALeaxreverb_setParamfv(ALeffect *effect, ALCcontext *context, ALenum param,
{
case AL_EAXREVERB_REFLECTIONS_PAN:
if(!(isfinite(vals[0]) && isfinite(vals[1]) && isfinite(vals[2])))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb reflections pan out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb reflections pan out of range");
props->Reverb.ReflectionsPan[0] = vals[0];
props->Reverb.ReflectionsPan[1] = vals[1];
props->Reverb.ReflectionsPan[2] = vals[2];
break;
case AL_EAXREVERB_LATE_REVERB_PAN:
if(!(isfinite(vals[0]) && isfinite(vals[1]) && isfinite(vals[2])))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "EAX Reverb late reverb pan out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb late reverb pan out of range");
props->Reverb.LateReverbPan[0] = vals[0];
props->Reverb.LateReverbPan[1] = vals[1];
props->Reverb.LateReverbPan[2] = vals[2];
@@ -1950,7 +1952,8 @@ void ALeaxreverb_getParami(const ALeffect *effect, ALCcontext *context, ALenum p
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid EAX reverb integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid EAX reverb integer property 0x%04x",
+ param);
}
}
void ALeaxreverb_getParamiv(const ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
@@ -2041,7 +2044,8 @@ void ALeaxreverb_getParamf(const ALeffect *effect, ALCcontext *context, ALenum p
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid EAX reverb float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid EAX reverb float property 0x%04x",
+ param);
}
}
void ALeaxreverb_getParamfv(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
@@ -2075,12 +2079,12 @@ void ALreverb_setParami(ALeffect *effect, ALCcontext *context, ALenum param, ALi
{
case AL_REVERB_DECAY_HFLIMIT:
if(!(val >= AL_REVERB_MIN_DECAY_HFLIMIT && val <= AL_REVERB_MAX_DECAY_HFLIMIT))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Reverb decay hflimit out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Reverb decay hflimit out of range");
props->Reverb.DecayHFLimit = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid reverb integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid reverb integer property 0x%04x", param);
}
}
void ALreverb_setParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
@@ -2092,78 +2096,78 @@ void ALreverb_setParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALf
{
case AL_REVERB_DENSITY:
if(!(val >= AL_REVERB_MIN_DENSITY && val <= AL_REVERB_MAX_DENSITY))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Reverb density out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Reverb density out of range");
props->Reverb.Density = val;
break;
case AL_REVERB_DIFFUSION:
if(!(val >= AL_REVERB_MIN_DIFFUSION && val <= AL_REVERB_MAX_DIFFUSION))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Reverb diffusion out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Reverb diffusion out of range");
props->Reverb.Diffusion = val;
break;
case AL_REVERB_GAIN:
if(!(val >= AL_REVERB_MIN_GAIN && val <= AL_REVERB_MAX_GAIN))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Reverb gain out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Reverb gain out of range");
props->Reverb.Gain = val;
break;
case AL_REVERB_GAINHF:
if(!(val >= AL_REVERB_MIN_GAINHF && val <= AL_REVERB_MAX_GAINHF))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Reverb gainhf out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Reverb gainhf out of range");
props->Reverb.GainHF = val;
break;
case AL_REVERB_DECAY_TIME:
if(!(val >= AL_REVERB_MIN_DECAY_TIME && val <= AL_REVERB_MAX_DECAY_TIME))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Reverb decay time out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Reverb decay time out of range");
props->Reverb.DecayTime = val;
break;
case AL_REVERB_DECAY_HFRATIO:
if(!(val >= AL_REVERB_MIN_DECAY_HFRATIO && val <= AL_REVERB_MAX_DECAY_HFRATIO))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Reverb decay hfratio out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Reverb decay hfratio out of range");
props->Reverb.DecayHFRatio = val;
break;
case AL_REVERB_REFLECTIONS_GAIN:
if(!(val >= AL_REVERB_MIN_REFLECTIONS_GAIN && val <= AL_REVERB_MAX_REFLECTIONS_GAIN))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Reverb reflections gain out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Reverb reflections gain out of range");
props->Reverb.ReflectionsGain = val;
break;
case AL_REVERB_REFLECTIONS_DELAY:
if(!(val >= AL_REVERB_MIN_REFLECTIONS_DELAY && val <= AL_REVERB_MAX_REFLECTIONS_DELAY))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Reverb reflections delay out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Reverb reflections delay out of range");
props->Reverb.ReflectionsDelay = val;
break;
case AL_REVERB_LATE_REVERB_GAIN:
if(!(val >= AL_REVERB_MIN_LATE_REVERB_GAIN && val <= AL_REVERB_MAX_LATE_REVERB_GAIN))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Reverb late reverb gain out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Reverb late reverb gain out of range");
props->Reverb.LateReverbGain = val;
break;
case AL_REVERB_LATE_REVERB_DELAY:
if(!(val >= AL_REVERB_MIN_LATE_REVERB_DELAY && val <= AL_REVERB_MAX_LATE_REVERB_DELAY))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Reverb late reverb delay out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Reverb late reverb delay out of range");
props->Reverb.LateReverbDelay = val;
break;
case AL_REVERB_AIR_ABSORPTION_GAINHF:
if(!(val >= AL_REVERB_MIN_AIR_ABSORPTION_GAINHF && val <= AL_REVERB_MAX_AIR_ABSORPTION_GAINHF))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Reverb air absorption gainhf out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Reverb air absorption gainhf out of range");
props->Reverb.AirAbsorptionGainHF = val;
break;
case AL_REVERB_ROOM_ROLLOFF_FACTOR:
if(!(val >= AL_REVERB_MIN_ROOM_ROLLOFF_FACTOR && val <= AL_REVERB_MAX_ROOM_ROLLOFF_FACTOR))
- SETERR_RETURN(context, AL_INVALID_VALUE, effect->id, "Reverb room rolloff factor out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Reverb room rolloff factor out of range");
props->Reverb.RoomRolloffFactor = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid reverb float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid reverb float property 0x%04x", param);
}
}
void ALreverb_setParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
@@ -2179,7 +2183,7 @@ void ALreverb_getParami(const ALeffect *effect, ALCcontext *context, ALenum para
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid reverb integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid reverb integer property 0x%04x", param);
}
}
void ALreverb_getParamiv(const ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
@@ -2238,7 +2242,7 @@ void ALreverb_getParamf(const ALeffect *effect, ALCcontext *context, ALenum para
break;
default:
- alSetError(context, AL_INVALID_ENUM, effect->id, "Invalid reverb float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid reverb float property 0x%04x", param);
}
}
void ALreverb_getParamfv(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
diff --git a/OpenAL32/Include/alError.h b/OpenAL32/Include/alError.h
index 3dc16103..479697f2 100644
--- a/OpenAL32/Include/alError.h
+++ b/OpenAL32/Include/alError.h
@@ -9,15 +9,15 @@ extern "C" {
extern ALboolean TrapALError;
-ALvoid alSetError(ALCcontext *context, ALenum errorCode, ALuint objid, const char *msg);
+void alSetError(ALCcontext *context, ALenum errorCode, const char *msg, ...);
-#define SETERR_GOTO(ctx, err, objid, msg, lbl) do { \
- alSetError((ctx), (err), (objid), (msg)); \
+#define SETERR_GOTO(ctx, err, lbl, ...) do { \
+ alSetError((ctx), (err), __VA_ARGS__); \
goto lbl; \
} while(0)
-#define SETERR_RETURN(ctx, err, objid, msg, retval) do { \
- alSetError((ctx), (err), (objid), (msg)); \
+#define SETERR_RETURN(ctx, err, retval, ...) do { \
+ alSetError((ctx), (err), __VA_ARGS__); \
return retval; \
} while(0)
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c
index a8186f07..d2039097 100644
--- a/OpenAL32/alAuxEffectSlot.c
+++ b/OpenAL32/alAuxEffectSlot.c
@@ -73,7 +73,7 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo
if(!context) return;
if(!(n >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Generating negative effect slots", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Generating %d effect slots", n);
tmpslots = al_malloc(DEF_ALIGN, sizeof(ALeffectslot*)*n);
LockEffectSlotsWrite(context);
@@ -87,7 +87,7 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo
UnlockEffectSlotsWrite(context);
alDeleteAuxiliaryEffectSlots(cur, effectslots);
- SETERR_GOTO(context, err, 0, "Effect slot object allocation failed", done);
+ SETERR_GOTO(context, err, done, "Effect slot object allocation failed");
}
err = NewThunkEntry(&slot->id);
@@ -103,7 +103,7 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo
UnlockEffectSlotsWrite(context);
alDeleteAuxiliaryEffectSlots(cur, effectslots);
- SETERR_GOTO(context, err, 0, "Failed to set effect slot ID", done);
+ SETERR_GOTO(context, err, done, "Failed to set effect slot ID");
}
aluInitEffectPanning(slot);
@@ -149,15 +149,15 @@ AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *
LockEffectSlotsWrite(context);
if(!(n >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Deleting negative effect slots",
- done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Deleting %d effect slots", n);
for(i = 0;i < n;i++)
{
if((slot=LookupEffectSlot(context, effectslots[i])) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, effectslots[i], "Invalid effect slot ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid effect slot ID %u",
+ effectslots[i]);
if(ReadRef(&slot->ref) != 0)
- SETERR_GOTO(context, AL_INVALID_OPERATION, effectslots[i],
- "Deleting in-use effect slot", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Deleting in-use effect slot %u",
+ effectslots[i]);
}
// All effectslots are valid
@@ -240,7 +240,7 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param
WriteLock(&context->PropLock);
LockEffectSlotsRead(context);
if((slot=LookupEffectSlot(context, effectslot)) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, effectslot, "Invalid effect slot ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid effect slot ID %u", effectslot);
switch(param)
{
case AL_EFFECTSLOT_EFFECT:
@@ -251,25 +251,25 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param
if(!(value == 0 || effect != NULL))
{
UnlockEffectsRead(device);
- SETERR_GOTO(context, AL_INVALID_VALUE, effectslot, "Invalid effect ID", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Invalid effect ID %u", value);
}
err = InitializeEffect(context, slot, effect);
UnlockEffectsRead(device);
if(err != AL_NO_ERROR)
- SETERR_GOTO(context, err, effectslot, "Effect initialization failed", done);
+ SETERR_GOTO(context, err, done, "Effect initialization failed");
break;
case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
if(!(value == AL_TRUE || value == AL_FALSE))
- SETERR_GOTO(context, AL_INVALID_VALUE, effectslot,
- "Effect slot auxiliary send auto out of range", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done,
+ "Effect slot auxiliary send auto out of range");
slot->AuxSendAuto = value;
break;
default:
- SETERR_GOTO(context, AL_INVALID_ENUM, effectslot, "Invalid effect slot integer property",
- done);
+ SETERR_GOTO(context, AL_INVALID_ENUM, done, "Invalid effect slot integer property 0x%04x",
+ param);
}
DO_UPDATEPROPS();
@@ -296,12 +296,12 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum para
LockEffectSlotsRead(context);
if(LookupEffectSlot(context, effectslot) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, effectslot, "Invalid effect slot ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid effect slot ID %u", effectslot);
switch(param)
{
default:
- alSetError(context, AL_INVALID_ENUM, effectslot,
- "Invalid effect slot integer-vector property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid effect slot integer-vector property 0x%04x",
+ param);
}
done:
@@ -320,19 +320,18 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param
WriteLock(&context->PropLock);
LockEffectSlotsRead(context);
if((slot=LookupEffectSlot(context, effectslot)) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, effectslot, "Invalid effect slot ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid effect slot ID %u", effectslot);
switch(param)
{
case AL_EFFECTSLOT_GAIN:
if(!(value >= 0.0f && value <= 1.0f))
- SETERR_GOTO(context, AL_INVALID_VALUE, effectslot, "Effect slot gain out of range",
- done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Effect slot gain out of range");
slot->Gain = value;
break;
default:
- SETERR_GOTO(context, AL_INVALID_ENUM, effectslot, "Invalid effect slot float property",
- done);
+ SETERR_GOTO(context, AL_INVALID_ENUM, done, "Invalid effect slot float property 0x%04x",
+ param);
}
DO_UPDATEPROPS();
@@ -358,12 +357,12 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum para
LockEffectSlotsRead(context);
if(LookupEffectSlot(context, effectslot) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, effectslot, "Invalid effect slot ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid effect slot ID %u", effectslot);
switch(param)
{
default:
- alSetError(context, AL_INVALID_ENUM, effectslot,
- "Invalid effect slot float-vector property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid effect slot float-vector property 0x%04x",
+ param);
}
done:
@@ -381,7 +380,7 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum pa
LockEffectSlotsRead(context);
if((slot=LookupEffectSlot(context, effectslot)) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, effectslot, "Invalid effect slot ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid effect slot ID %u", effectslot);
switch(param)
{
case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
@@ -389,7 +388,7 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum pa
break;
default:
- alSetError(context, AL_INVALID_ENUM, effectslot, "Invalid effect slot integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid effect slot integer property 0x%04x", param);
}
done:
@@ -414,12 +413,12 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum p
LockEffectSlotsRead(context);
if(LookupEffectSlot(context, effectslot) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, effectslot, "Invalid effect slot ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid effect slot ID %u", effectslot);
switch(param)
{
default:
- alSetError(context, AL_INVALID_ENUM, effectslot,
- "Invalid effect slot integer-vector property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid effect slot integer-vector property 0x%04x",
+ param);
}
done:
@@ -437,7 +436,7 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum pa
LockEffectSlotsRead(context);
if((slot=LookupEffectSlot(context, effectslot)) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, effectslot, "Invalid effect slot ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid effect slot ID %u", effectslot);
switch(param)
{
case AL_EFFECTSLOT_GAIN:
@@ -445,7 +444,7 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum pa
break;
default:
- alSetError(context, AL_INVALID_ENUM, effectslot, "Invalid effect slot float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid effect slot float property 0x%04x", param);
}
done:
@@ -469,12 +468,12 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum p
LockEffectSlotsRead(context);
if(LookupEffectSlot(context, effectslot) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, effectslot, "Invalid effect slot ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid effect slot ID %u", effectslot);
switch(param)
{
default:
- alSetError(context, AL_INVALID_ENUM, effectslot,
- "Invalid effect slot float-vector property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid effect slot float-vector property 0x%04x",
+ param);
}
done:
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index 922c379c..0ef4bf69 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -66,7 +66,7 @@ AL_API ALvoid AL_APIENTRY alGenBuffers(ALsizei n, ALuint *buffers)
if(!context) return;
if(!(n >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Generating negative buffers", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Generating %d buffers", n);
for(cur = 0;cur < n;cur++)
{
@@ -98,7 +98,7 @@ AL_API ALvoid AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers)
LockBuffersWrite(device);
if(!(n >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Deleting negative buffers", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Deleting %d buffers", n);
for(i = 0;i < n;i++)
{
@@ -107,9 +107,10 @@ AL_API ALvoid AL_APIENTRY alDeleteBuffers(ALsizei n, const ALuint *buffers)
/* Check for valid Buffer ID */
if((ALBuf=LookupBuffer(device, buffers[i])) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffers[i], "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffers[i]);
if(ReadRef(&ALBuf->ref) != 0)
- SETERR_GOTO(context, AL_INVALID_OPERATION, buffers[i], "Deleting in-use buffer", done);
+ SETERR_GOTO(context, AL_INVALID_OPERATION, done, "Deleting in-use buffer %u",
+ buffers[i]);
}
for(i = 0;i < n;i++)
@@ -161,19 +162,20 @@ AL_API void AL_APIENTRY alBufferStorageSOFT(ALuint buffer, ALenum format, const
device = context->Device;
LockBuffersRead(device);
if((albuf=LookupBuffer(device, buffer)) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
- if(!(size >= 0)) SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "Negative storage size", done);
- if(!(freq > 0)) SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "Invalid sample rate", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
+ if(!(size >= 0)) SETERR_GOTO(context, AL_INVALID_VALUE, done, "Negative storage size %d", size);
+ if(!(freq > 0)) SETERR_GOTO(context, AL_INVALID_VALUE, done, "Invalid sample rate %d", freq);
if((flags&INVALID_STORAGE_MASK) != 0)
- SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "Invalid storage flags", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Invalid storage flags 0x%x",
+ flags&INVALID_STORAGE_MASK);
if((flags&AL_MAP_PERSISTENT_BIT_SOFT) && !(flags&MAP_READ_WRITE_FLAGS))
- SETERR_GOTO(context, AL_INVALID_VALUE, buffer,
- "Declaring persistently mapped storage without read or write access", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done,
+ "Declaring persistently mapped storage without read or write access");
if(DecomposeUserFormat(format, &srcchannels, &srctype) == AL_FALSE)
- SETERR_GOTO(context, AL_INVALID_ENUM, buffer, "Invalid format", done);
+ SETERR_GOTO(context, AL_INVALID_ENUM, done, "Invalid format 0x%04x", format);
align = SanitizeAlignment(srctype, ATOMIC_LOAD_SEQ(&albuf->UnpackAlign));
- if(align < 1) SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "Invalid unpack alignment", done);
+ if(align < 1) SETERR_GOTO(context, AL_INVALID_VALUE, done, "Invalid unpack alignment");
switch(srctype)
{
@@ -195,7 +197,8 @@ AL_API void AL_APIENTRY alBufferStorageSOFT(ALuint buffer, ALenum format, const
break;
}
if((size%framesize) != 0)
- alSetError(context, AL_INVALID_VALUE, buffer, "Data size is not a frame multiple");
+ alSetError(context, AL_INVALID_VALUE, "Data size %d is not a multiple of frame size %d",
+ size, framesize);
else
LoadData(context, albuf, freq, size/framesize*align, srcchannels, srctype, data, align,
flags);
@@ -218,32 +221,33 @@ AL_API void* AL_APIENTRY alMapBufferSOFT(ALuint buffer, ALsizei offset, ALsizei
device = context->Device;
LockBuffersRead(device);
if((albuf=LookupBuffer(device, buffer)) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
if((access&~MAP_ACCESS_FLAGS) != 0)
- SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "Invalid map flags", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Invalid map flags 0x%x",
+ access&~MAP_ACCESS_FLAGS);
if(!(access&MAP_READ_WRITE_FLAGS))
- SETERR_GOTO(context, AL_INVALID_VALUE, buffer,
- "Mapping buffer without read or write access", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done,
+ "Mapping buffer without read or write access");
WriteLock(&albuf->lock);
if(ReadRef(&albuf->ref) != 0 && !(access&AL_MAP_PERSISTENT_BIT_SOFT))
- SETERR_GOTO(context, AL_INVALID_OPERATION, buffer,
- "Mapping in-use buffer without persistent mapping", unlock_done);
+ SETERR_GOTO(context, AL_INVALID_OPERATION, unlock_done,
+ "Mapping in-use buffer without persistent mapping");
if(albuf->MappedAccess != 0)
- SETERR_GOTO(context, AL_INVALID_OPERATION, buffer, "Mapping already-mapped buffer",
- unlock_done);
+ SETERR_GOTO(context, AL_INVALID_OPERATION, unlock_done, "Mapping already-mapped buffer");
if((access&AL_MAP_READ_BIT_SOFT) && !(albuf->Access&AL_MAP_READ_BIT_SOFT))
- SETERR_GOTO(context, AL_INVALID_VALUE, buffer,
- "Mapping buffer for reading without read access", unlock_done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, unlock_done,
+ "Mapping buffer for reading without read access");
if((access&AL_MAP_WRITE_BIT_SOFT) && !(albuf->Access&AL_MAP_WRITE_BIT_SOFT))
- SETERR_GOTO(context, AL_INVALID_VALUE, buffer,
- "Mapping buffer for writing without write access", unlock_done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, unlock_done,
+ "Mapping buffer for writing without write access");
if((access&AL_MAP_PERSISTENT_BIT_SOFT) && !(albuf->Access&AL_MAP_PERSISTENT_BIT_SOFT))
- SETERR_GOTO(context, AL_INVALID_VALUE, buffer,
- "Mapping buffer persistently without persistent access", unlock_done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, unlock_done,
+ "Mapping buffer persistently without persistent access");
if(offset < 0 || offset >= albuf->OriginalSize ||
length <= 0 || length > albuf->OriginalSize - offset)
- SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "Mapping out of range", unlock_done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, unlock_done, "Mapping invalid range %d+%d",
+ offset, length);
retval = (ALbyte*)albuf->data + offset;
albuf->MappedAccess = access;
@@ -272,11 +276,11 @@ AL_API void AL_APIENTRY alUnmapBufferSOFT(ALuint buffer)
device = context->Device;
LockBuffersRead(device);
if((albuf=LookupBuffer(device, buffer)) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
WriteLock(&albuf->lock);
if(albuf->MappedAccess == 0)
- alSetError(context, AL_INVALID_OPERATION, albuf->id, "Unmapping an unmapped buffer");
+ alSetError(context, AL_INVALID_OPERATION, "Unmapping an unmapped buffer %u", buffer);
else
{
albuf->MappedAccess = 0;
@@ -302,15 +306,15 @@ AL_API void AL_APIENTRY alFlushMappedBufferSOFT(ALuint buffer, ALsizei offset, A
device = context->Device;
LockBuffersRead(device);
if((albuf=LookupBuffer(device, buffer)) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
WriteLock(&albuf->lock);
if(albuf->MappedAccess == 0 || !(albuf->MappedAccess&AL_MAP_WRITE_BIT_SOFT))
- alSetError(context, AL_INVALID_OPERATION, albuf->id,
- "Flushing a buffer not mapped for writing");
+ alSetError(context, AL_INVALID_OPERATION, "Flushing buffer %u not mapped for writing",
+ buffer);
else if(offset < albuf->MappedOffset || offset >= albuf->MappedOffset+albuf->MappedSize ||
length <= 0 || length > albuf->MappedOffset+albuf->MappedSize-offset)
- alSetError(context, AL_INVALID_VALUE, albuf->id, "Flushing an invalid range");
+ alSetError(context, AL_INVALID_VALUE, "Flushing an invalid range %d+%d", offset, length);
else
{
/* FIXME: Need to use some method of double-buffering for the mixer and
@@ -346,22 +350,22 @@ AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer, ALenum format, cons
device = context->Device;
LockBuffersRead(device);
if((albuf=LookupBuffer(device, buffer)) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
if(DecomposeUserFormat(format, &srcchannels, &srctype) == AL_FALSE)
- SETERR_GOTO(context, AL_INVALID_ENUM, buffer, "Invalid format", done);
+ SETERR_GOTO(context, AL_INVALID_ENUM, done, "Invalid format 0x%04x", format);
WriteLock(&albuf->lock);
align = SanitizeAlignment(srctype, ATOMIC_LOAD_SEQ(&albuf->UnpackAlign));
- if(align < 1) SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "Invalid unpack alignment", done);
+ if(align < 1) SETERR_GOTO(context, AL_INVALID_VALUE, unlock_done, "Invalid unpack alignment");
if((long)srcchannels != (long)albuf->FmtChannels || srctype != albuf->OriginalType)
- SETERR_GOTO(context, AL_INVALID_ENUM, buffer, "Unpacking data with mismatched format",
- unlock_done);
+ SETERR_GOTO(context, AL_INVALID_ENUM, unlock_done,
+ "Unpacking data with mismatched format");
if(align != albuf->OriginalAlign)
- SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "Unpacking data with mismatched alignment",
- unlock_done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, unlock_done,
+ "Unpacking data with mismatched alignment");
if(albuf->MappedAccess != 0)
- SETERR_GOTO(context, AL_INVALID_OPERATION, buffer, "Unpacking data into mapped buffer",
- unlock_done);
+ SETERR_GOTO(context, AL_INVALID_OPERATION, unlock_done,
+ "Unpacking data into mapped buffer");
num_chans = ChannelsFromFmt(albuf->FmtChannels);
frame_size = num_chans * BytesFromFmt(albuf->FmtType);
@@ -374,9 +378,10 @@ AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer, ALenum format, cons
if(offset < 0 || length < 0 || offset > albuf->OriginalSize ||
length > albuf->OriginalSize-offset)
- SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "Data sub-range out of range", unlock_done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, unlock_done, "Invalid data sub-range %d+%d",
+ offset, length);
if((offset%byte_align) != 0 || (length%byte_align) != 0)
- SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "Invalid sub-range alignment", unlock_done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, unlock_done, "Invalid sub-range alignment");
/* offset -> byte offset, length -> sample count */
offset = offset/byte_align * frame_size;
@@ -411,7 +416,7 @@ AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint UNUSED(buffer),
context = GetContextRef();
if(!context) return;
- alSetError(context, AL_INVALID_OPERATION, 0, "alBufferSamplesSOFT not supported");
+ alSetError(context, AL_INVALID_OPERATION, "alBufferSamplesSOFT not supported");
ALCcontext_DecRef(context);
}
@@ -425,7 +430,7 @@ AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint UNUSED(buffer),
context = GetContextRef();
if(!context) return;
- alSetError(context, AL_INVALID_OPERATION, 0, "alBufferSubSamplesSOFT not supported");
+ alSetError(context, AL_INVALID_OPERATION, "alBufferSubSamplesSOFT not supported");
ALCcontext_DecRef(context);
}
@@ -439,7 +444,7 @@ AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint UNUSED(buffer),
context = GetContextRef();
if(!context) return;
- alSetError(context, AL_INVALID_OPERATION, 0, "alGetBufferSamplesSOFT not supported");
+ alSetError(context, AL_INVALID_OPERATION, "alGetBufferSamplesSOFT not supported");
ALCcontext_DecRef(context);
}
@@ -451,7 +456,7 @@ AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum UNUSED(format)
context = GetContextRef();
if(!context) return AL_FALSE;
- alSetError(context, AL_INVALID_OPERATION, 0, "alIsBufferFormatSupportedSOFT not supported");
+ alSetError(context, AL_INVALID_OPERATION, "alIsBufferFormatSupportedSOFT not supported");
ALCcontext_DecRef(context);
return AL_FALSE;
@@ -469,12 +474,12 @@ AL_API void AL_APIENTRY alBufferf(ALuint buffer, ALenum param, ALfloat UNUSED(va
device = context->Device;
LockBuffersRead(device);
if(LookupBuffer(device, buffer) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
switch(param)
{
default:
- alSetError(context, AL_INVALID_ENUM, buffer, "Invalid buffer float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid buffer float property 0x%04x", param);
}
done:
@@ -494,12 +499,12 @@ AL_API void AL_APIENTRY alBuffer3f(ALuint buffer, ALenum param, ALfloat UNUSED(v
device = context->Device;
LockBuffersRead(device);
if(LookupBuffer(device, buffer) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
switch(param)
{
default:
- alSetError(context, AL_INVALID_ENUM, buffer, "Invalid buffer 3-float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid buffer 3-float property 0x%04x", param);
}
done:
@@ -519,13 +524,13 @@ AL_API void AL_APIENTRY alBufferfv(ALuint buffer, ALenum param, const ALfloat *v
device = context->Device;
LockBuffersRead(device);
if(LookupBuffer(device, buffer) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
- if(!values) SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "NULL pointer", done);
+ if(!values) SETERR_GOTO(context, AL_INVALID_VALUE, done, "NULL pointer");
switch(param)
{
default:
- alSetError(context, AL_INVALID_ENUM, buffer, "Invalid buffer float-vector property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid buffer float-vector property 0x%04x", param);
}
done:
@@ -546,26 +551,26 @@ AL_API void AL_APIENTRY alBufferi(ALuint buffer, ALenum param, ALint value)
device = context->Device;
LockBuffersRead(device);
if((albuf=LookupBuffer(device, buffer)) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
switch(param)
{
case AL_UNPACK_BLOCK_ALIGNMENT_SOFT:
if(!(value >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, buffer,
- "Negative buffer unpack block alignment", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done,
+ "Buffer unpack block alignment %d is invalid", value);
ATOMIC_STORE_SEQ(&albuf->UnpackAlign, value);
break;
case AL_PACK_BLOCK_ALIGNMENT_SOFT:
if(!(value >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "Negative buffer pack block alignment",
- done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done,
+ "Buffer pack block alignment %d is invalid", value);
ATOMIC_STORE_SEQ(&albuf->PackAlign, value);
break;
default:
- alSetError(context, AL_INVALID_ENUM, buffer, "Invalid buffer integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid buffer integer property 0x%04x", param);
}
done:
@@ -584,12 +589,12 @@ AL_API void AL_APIENTRY alBuffer3i(ALuint buffer, ALenum param, ALint UNUSED(val
device = context->Device;
if(LookupBuffer(device, buffer) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
switch(param)
{
default:
- alSetError(context, AL_INVALID_ENUM, buffer, "Invalid buffer 3-integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid buffer 3-integer property 0x%04x", param);
}
done:
@@ -620,9 +625,9 @@ AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum param, const ALint *val
device = context->Device;
LockBuffersRead(device);
if((albuf=LookupBuffer(device, buffer)) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
- if(!values) SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "NULL pointer", done);
+ if(!values) SETERR_GOTO(context, AL_INVALID_VALUE, done, "NULL pointer");
switch(param)
{
case AL_LOOP_POINTS_SOFT:
@@ -630,14 +635,15 @@ AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum param, const ALint *val
if(ReadRef(&albuf->ref) != 0)
{
WriteUnlock(&albuf->lock);
- SETERR_GOTO(context, AL_INVALID_OPERATION, buffer,
- "Modifying in-use buffer loop points", done);
+ SETERR_GOTO(context, AL_INVALID_OPERATION, done,
+ "Modifying in-use buffer loop points");
}
if(values[0] >= values[1] || values[0] < 0 ||
values[1] > albuf->SampleLen)
{
WriteUnlock(&albuf->lock);
- SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "Invalid loop point range", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Invalid loop point range %d -> %d",
+ values[0], values[1]);
}
albuf->LoopStart = values[0];
@@ -646,7 +652,8 @@ AL_API void AL_APIENTRY alBufferiv(ALuint buffer, ALenum param, const ALint *val
break;
default:
- alSetError(context, AL_INVALID_ENUM, buffer, "Invalid buffer integer-vector property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid buffer integer-vector property 0x%04x",
+ param);
}
done:
@@ -667,13 +674,13 @@ AL_API ALvoid AL_APIENTRY alGetBufferf(ALuint buffer, ALenum param, ALfloat *val
device = context->Device;
LockBuffersRead(device);
if((albuf=LookupBuffer(device, buffer)) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
- if(!value) SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "NULL pointer", done);
+ if(!value) SETERR_GOTO(context, AL_INVALID_VALUE, done, "NULL pointer");
switch(param)
{
default:
- alSetError(context, AL_INVALID_ENUM, buffer, "Invalid buffer float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid buffer float property 0x%04x", param);
}
done:
@@ -693,14 +700,14 @@ AL_API void AL_APIENTRY alGetBuffer3f(ALuint buffer, ALenum param, ALfloat *valu
device = context->Device;
LockBuffersRead(device);
if(LookupBuffer(device, buffer) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
if(!value1 || !value2 || !value3)
- SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "NULL pointer", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "NULL pointer");
switch(param)
{
default:
- alSetError(context, AL_INVALID_ENUM, buffer, "Invalid buffer 3-float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid buffer 3-float property 0x%04x", param);
}
done:
@@ -727,13 +734,13 @@ AL_API void AL_APIENTRY alGetBufferfv(ALuint buffer, ALenum param, ALfloat *valu
device = context->Device;
LockBuffersRead(device);
if(LookupBuffer(device, buffer) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
- if(!values) SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "NULL pointer", done);
+ if(!values) SETERR_GOTO(context, AL_INVALID_VALUE, done, "NULL pointer");
switch(param)
{
default:
- alSetError(context, AL_INVALID_ENUM, buffer, "Invalid buffer float-vector property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid buffer float-vector property 0x%04x", param);
}
done:
@@ -754,9 +761,9 @@ AL_API ALvoid AL_APIENTRY alGetBufferi(ALuint buffer, ALenum param, ALint *value
device = context->Device;
LockBuffersRead(device);
if((albuf=LookupBuffer(device, buffer)) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
- if(!value) SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "NULL pointer", done);
+ if(!value) SETERR_GOTO(context, AL_INVALID_VALUE, done, "NULL pointer");
switch(param)
{
case AL_FREQUENCY:
@@ -787,7 +794,7 @@ AL_API ALvoid AL_APIENTRY alGetBufferi(ALuint buffer, ALenum param, ALint *value
break;
default:
- alSetError(context, AL_INVALID_ENUM, buffer, "Invalid buffer integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid buffer integer property 0x%04x", param);
}
done:
@@ -807,14 +814,14 @@ AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum param, ALint *value1
device = context->Device;
LockBuffersRead(device);
if(LookupBuffer(device, buffer) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
if(!value1 || !value2 || !value3)
- SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "NULL pointer", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "NULL pointer");
switch(param)
{
default:
- alSetError(context, AL_INVALID_ENUM, buffer, "Invalid buffer 3-integer property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid buffer 3-integer property 0x%04x", param);
}
done:
@@ -850,9 +857,9 @@ AL_API void AL_APIENTRY alGetBufferiv(ALuint buffer, ALenum param, ALint *values
device = context->Device;
LockBuffersRead(device);
if((albuf=LookupBuffer(device, buffer)) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, buffer, "Invalid buffer ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid buffer ID %u", buffer);
- if(!values) SETERR_GOTO(context, AL_INVALID_VALUE, buffer, "NULL pointer", done);
+ if(!values) SETERR_GOTO(context, AL_INVALID_VALUE, done, "NULL pointer");
switch(param)
{
case AL_LOOP_POINTS_SOFT:
@@ -863,7 +870,8 @@ AL_API void AL_APIENTRY alGetBufferiv(ALuint buffer, ALenum param, ALint *values
break;
default:
- alSetError(context, AL_INVALID_ENUM, buffer, "Invalid buffer integer-vector property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid buffer integer-vector property 0x%04x",
+ param);
}
done:
@@ -898,7 +906,7 @@ static void LoadData(ALCcontext *context, ALbuffer *ALBuf, ALuint freq, ALsizei
case UserFmtBFormat3D: DstChannels = FmtBFormat3D; break;
}
if(UNLIKELY((long)SrcChannels != (long)DstChannels))
- SETERR_RETURN(context, AL_INVALID_ENUM, ALBuf->id, "Invalid format",);
+ SETERR_RETURN(context, AL_INVALID_ENUM,, "Invalid format");
/* IMA4 and MSADPCM convert to 16-bit short. */
switch(SrcType)
@@ -916,23 +924,22 @@ static void LoadData(ALCcontext *context, ALbuffer *ALBuf, ALuint freq, ALsizei
if(access != 0)
{
if(UNLIKELY((long)SrcType != (long)DstType))
- SETERR_RETURN(context, AL_INVALID_VALUE, ALBuf->id,
- "Format cannot be mapped or preserved",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Format cannot be mapped or preserved");
}
NumChannels = ChannelsFromFmt(DstChannels);
FrameSize = NumChannels * BytesFromFmt(DstType);
if(UNLIKELY(frames > INT_MAX/FrameSize))
- SETERR_RETURN(context, AL_OUT_OF_MEMORY, ALBuf->id, "Buffer size too large",);
+ SETERR_RETURN(context, AL_OUT_OF_MEMORY,,
+ "Buffer size overflow, %d frames x %d bytes per frame", frames, FrameSize);
newsize = frames*FrameSize;
WriteLock(&ALBuf->lock);
if(UNLIKELY(ReadRef(&ALBuf->ref) != 0 || ALBuf->MappedAccess != 0))
{
WriteUnlock(&ALBuf->lock);
- SETERR_RETURN(context, AL_INVALID_OPERATION, ALBuf->id,
- "Modifying storage for in-use buffer",);
+ SETERR_RETURN(context, AL_INVALID_OPERATION,, "Modifying storage for in-use buffer");
}
if((access&AL_PRESERVE_DATA_BIT_SOFT))
@@ -941,14 +948,12 @@ static void LoadData(ALCcontext *context, ALbuffer *ALBuf, ALuint freq, ALsizei
if(UNLIKELY(ALBuf->FmtChannels != DstChannels || ALBuf->OriginalType != SrcType))
{
WriteUnlock(&ALBuf->lock);
- SETERR_RETURN(context, AL_INVALID_VALUE, ALBuf->id,
- "Preserving data of mismatched format",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Preserving data of mismatched format");
}
if(UNLIKELY(ALBuf->OriginalAlign != align))
{
WriteUnlock(&ALBuf->lock);
- SETERR_RETURN(context, AL_INVALID_VALUE, ALBuf->id,
- "Preserving data of mismatched alignment",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Preserving data of mismatched alignment");
}
}
@@ -966,7 +971,8 @@ static void LoadData(ALCcontext *context, ALbuffer *ALBuf, ALuint freq, ALsizei
if(UNLIKELY(!temp && newsize))
{
WriteUnlock(&ALBuf->lock);
- SETERR_RETURN(context, AL_OUT_OF_MEMORY, ALBuf->id, "Failed to allocate storage",);
+ SETERR_RETURN(context, AL_OUT_OF_MEMORY,, "Failed to allocate %d bytes of storage",
+ newsize);
}
if((access&AL_PRESERVE_DATA_BIT_SOFT))
{
@@ -1204,7 +1210,7 @@ ALbuffer *NewBuffer(ALCcontext *context)
buffer = al_calloc(16, sizeof(ALbuffer));
if(!buffer)
- SETERR_RETURN(context, AL_OUT_OF_MEMORY, 0, "Failed to allocate buffer object", NULL);
+ SETERR_RETURN(context, AL_OUT_OF_MEMORY, NULL, "Failed to allocate buffer object");
RWLockInit(&buffer->lock);
buffer->Access = 0;
buffer->MappedAccess = 0;
@@ -1218,7 +1224,7 @@ ALbuffer *NewBuffer(ALCcontext *context)
memset(buffer, 0, sizeof(ALbuffer));
al_free(buffer);
- SETERR_RETURN(context, err, 0, "Failed to set buffer ID", NULL);
+ SETERR_RETURN(context, err, NULL, "Failed to set buffer ID");
}
return buffer;
diff --git a/OpenAL32/alEffect.c b/OpenAL32/alEffect.c
index 5f6e661a..ab42112c 100644
--- a/OpenAL32/alEffect.c
+++ b/OpenAL32/alEffect.c
@@ -69,7 +69,7 @@ AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects)
if(!context) return;
if(!(n >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Generating negative effects", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Generating %d effects", n);
device = context->Device;
for(cur = 0;cur < n;cur++)
@@ -80,7 +80,7 @@ AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects)
{
al_free(effect);
alDeleteEffects(cur, effects);
- SETERR_GOTO(context, err, 0, "Failed to allocate effect object", done);
+ SETERR_GOTO(context, err, done, "Failed to allocate effect object");
}
err = NewThunkEntry(&effect->id);
@@ -93,7 +93,7 @@ AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects)
al_free(effect);
alDeleteEffects(cur, effects);
- SETERR_GOTO(context, err, 0, "Failed to set effect ID", done);
+ SETERR_GOTO(context, err, done, "Failed to set effect ID");
}
effects[cur] = effect->id;
@@ -116,11 +116,11 @@ AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects)
device = context->Device;
LockEffectsWrite(device);
if(!(n >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Deleting negative effects", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Deleting %d effects", n);
for(i = 0;i < n;i++)
{
if(effects[i] && LookupEffect(device, effects[i]) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, effects[i], "Invalid effect ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid effect ID %u", effects[i]);
}
for(i = 0;i < n;i++)
{
@@ -167,7 +167,7 @@ AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint value)
Device = Context->Device;
LockEffectsWrite(Device);
if((ALEffect=LookupEffect(Device, effect)) == NULL)
- alSetError(Context, AL_INVALID_NAME, effect, "Invalid effect ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid effect ID %u", effect);
else
{
if(param == AL_EFFECT_TYPE)
@@ -184,7 +184,7 @@ AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint value)
if(isOk)
InitEffectParams(ALEffect, value);
else
- alSetError(Context, AL_INVALID_VALUE, effect, "Effect type not supported");
+ alSetError(Context, AL_INVALID_VALUE, "Effect type 0x%04x not supported", value);
}
else
{
@@ -216,7 +216,7 @@ AL_API ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, const ALint *v
Device = Context->Device;
LockEffectsWrite(Device);
if((ALEffect=LookupEffect(Device, effect)) == NULL)
- alSetError(Context, AL_INVALID_NAME, effect, "Invalid effect ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid effect ID %u", effect);
else
{
/* Call the appropriate handler */
@@ -239,7 +239,7 @@ AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat value)
Device = Context->Device;
LockEffectsWrite(Device);
if((ALEffect=LookupEffect(Device, effect)) == NULL)
- alSetError(Context, AL_INVALID_NAME, effect, "Invalid effect ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid effect ID %u", effect);
else
{
/* Call the appropriate handler */
@@ -262,7 +262,7 @@ AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, const ALfloat
Device = Context->Device;
LockEffectsWrite(Device);
if((ALEffect=LookupEffect(Device, effect)) == NULL)
- alSetError(Context, AL_INVALID_NAME, effect, "Invalid effect ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid effect ID %u", effect);
else
{
/* Call the appropriate handler */
@@ -285,7 +285,7 @@ AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *value
Device = Context->Device;
LockEffectsRead(Device);
if((ALEffect=LookupEffect(Device, effect)) == NULL)
- alSetError(Context, AL_INVALID_NAME, effect, "Invalid effect ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid effect ID %u", effect);
else
{
if(param == AL_EFFECT_TYPE)
@@ -320,7 +320,7 @@ AL_API ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *valu
Device = Context->Device;
LockEffectsRead(Device);
if((ALEffect=LookupEffect(Device, effect)) == NULL)
- alSetError(Context, AL_INVALID_NAME, effect, "Invalid effect ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid effect ID %u", effect);
else
{
/* Call the appropriate handler */
@@ -343,7 +343,7 @@ AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *val
Device = Context->Device;
LockEffectsRead(Device);
if((ALEffect=LookupEffect(Device, effect)) == NULL)
- alSetError(Context, AL_INVALID_NAME, effect, "Invalid effect ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid effect ID %u", effect);
else
{
/* Call the appropriate handler */
@@ -366,7 +366,7 @@ AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *va
Device = Context->Device;
LockEffectsRead(Device);
if((ALEffect=LookupEffect(Device, effect)) == NULL)
- alSetError(Context, AL_INVALID_NAME, effect, "Invalid effect ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid effect ID %u", effect);
else
{
/* Call the appropriate handler */
diff --git a/OpenAL32/alError.c b/OpenAL32/alError.c
index 8d138aa2..fe0e02be 100644
--- a/OpenAL32/alError.c
+++ b/OpenAL32/alError.c
@@ -21,6 +21,7 @@
#include "config.h"
#include <signal.h>
+#include <stdarg.h>
#ifdef HAVE_WINDOWS_H
#define WIN32_LEAN_AND_MEAN
@@ -33,12 +34,32 @@
ALboolean TrapALError = AL_FALSE;
-ALvoid alSetError(ALCcontext *context, ALenum errorCode, ALuint objid, const char *msg)
+void alSetError(ALCcontext *context, ALenum errorCode, const char *msg, ...)
{
ALenum curerr = AL_NO_ERROR;
+ char message[1024] = { 0 };
+ va_list args;
+ int msglen;
- WARN("Error generated on context %p, code 0x%04x, object %u, \"%s\"\n",
- context, errorCode, objid, msg);
+ va_start(args, msg);
+ msglen = vsnprintf(message, sizeof(message), msg, args);
+ va_end(args);
+
+ if(msglen < 0 || (size_t)msglen >= sizeof(message))
+ {
+ message[sizeof(message)-1] = 0;
+ msglen = strlen(message);
+ }
+ if(msglen > 0)
+ msg = message;
+ else
+ {
+ msg = "<internal error constructing message>";
+ msglen = strlen(msg);
+ }
+
+ WARN("Error generated on context %p, code 0x%04x, \"%s\"\n",
+ context, errorCode, message);
if(TrapALError)
{
#ifdef _WIN32
@@ -55,7 +76,7 @@ ALvoid alSetError(ALCcontext *context, ALenum errorCode, ALuint objid, const cha
{
almtx_lock(&context->EventLock);
if((context->EnabledEvts&EventType_Error) && context->EventCb)
- (*context->EventCb)(AL_EVENT_TYPE_ERROR_SOFT, objid, errorCode, strlen(msg), msg,
+ (*context->EventCb)(AL_EVENT_TYPE_ERROR_SOFT, 0, errorCode, msglen, msg,
context->EventParam);
almtx_unlock(&context->EventLock);
}
@@ -86,6 +107,5 @@ AL_API ALenum AL_APIENTRY alGetError(void)
errorCode = ATOMIC_EXCHANGE_SEQ(&context->LastError, AL_NO_ERROR);
ALCcontext_DecRef(context);
-
return errorCode;
}
diff --git a/OpenAL32/alExtension.c b/OpenAL32/alExtension.c
index 9b6e5a97..f6378c70 100644
--- a/OpenAL32/alExtension.c
+++ b/OpenAL32/alExtension.c
@@ -46,7 +46,7 @@ AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extName)
if(!context) return AL_FALSE;
if(!extName)
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "NULL pointer", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "NULL pointer");
len = strlen(extName);
ptr = context->ExtensionList;
diff --git a/OpenAL32/alFilter.c b/OpenAL32/alFilter.c
index 24b0e607..34f2f271 100644
--- a/OpenAL32/alFilter.c
+++ b/OpenAL32/alFilter.c
@@ -55,7 +55,7 @@ AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters)
if(!context) return;
if(!(n >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Generating negative filters", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Generating %d filters", n);
device = context->Device;
for(cur = 0;cur < n;cur++)
@@ -64,7 +64,7 @@ AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters)
if(!filter)
{
alDeleteFilters(cur, filters);
- SETERR_GOTO(context, AL_OUT_OF_MEMORY, 0, "Failed to allocate filter object", done);
+ SETERR_GOTO(context, AL_OUT_OF_MEMORY, done, "Failed to allocate filter object");
}
InitFilterParams(filter, AL_FILTER_NULL);
@@ -78,7 +78,7 @@ AL_API ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters)
al_free(filter);
alDeleteFilters(cur, filters);
- SETERR_GOTO(context, err, 0, "Failed ot set filter ID", done);
+ SETERR_GOTO(context, err, done, "Failed ot set filter ID");
}
filters[cur] = filter->id;
@@ -101,11 +101,11 @@ AL_API ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, const ALuint *filters)
device = context->Device;
LockFiltersWrite(device);
if(!(n >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Deleting negative filters", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Deleting %d filters", n);
for(i = 0;i < n;i++)
{
if(filters[i] && LookupFilter(device, filters[i]) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, filters[i], "Invalid filter ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid filter ID %u", filters[i]);
}
for(i = 0;i < n;i++)
{
@@ -152,7 +152,7 @@ AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint value)
Device = Context->Device;
LockFiltersWrite(Device);
if((ALFilter=LookupFilter(Device, filter)) == NULL)
- alSetError(Context, AL_INVALID_NAME, filter, "Invalid filter ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid filter ID %u", filter);
else
{
if(param == AL_FILTER_TYPE)
@@ -161,7 +161,7 @@ AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint value)
value == AL_FILTER_HIGHPASS || value == AL_FILTER_BANDPASS)
InitFilterParams(ALFilter, value);
else
- alSetError(Context, AL_INVALID_VALUE, filter, "Filter type not supported");
+ alSetError(Context, AL_INVALID_VALUE, "Invalid filter type 0x%04x", value);
}
else
{
@@ -193,7 +193,7 @@ AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, const ALint *v
Device = Context->Device;
LockFiltersWrite(Device);
if((ALFilter=LookupFilter(Device, filter)) == NULL)
- alSetError(Context, AL_INVALID_NAME, filter, "Invalid filter ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid filter ID %u", filter);
else
{
/* Call the appropriate handler */
@@ -216,7 +216,7 @@ AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat value)
Device = Context->Device;
LockFiltersWrite(Device);
if((ALFilter=LookupFilter(Device, filter)) == NULL)
- alSetError(Context, AL_INVALID_NAME, filter, "Invalid filter ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid filter ID %u", filter);
else
{
/* Call the appropriate handler */
@@ -239,7 +239,7 @@ AL_API ALvoid AL_APIENTRY alFilterfv(ALuint filter, ALenum param, const ALfloat
Device = Context->Device;
LockFiltersWrite(Device);
if((ALFilter=LookupFilter(Device, filter)) == NULL)
- alSetError(Context, AL_INVALID_NAME, filter, "Invalid filter ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid filter ID %u", filter);
else
{
/* Call the appropriate handler */
@@ -262,7 +262,7 @@ AL_API ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *value
Device = Context->Device;
LockFiltersRead(Device);
if((ALFilter=LookupFilter(Device, filter)) == NULL)
- alSetError(Context, AL_INVALID_NAME, filter, "Invalid filter ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid filter ID %u", filter);
else
{
if(param == AL_FILTER_TYPE)
@@ -297,7 +297,7 @@ AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *valu
Device = Context->Device;
LockFiltersRead(Device);
if((ALFilter=LookupFilter(Device, filter)) == NULL)
- alSetError(Context, AL_INVALID_NAME, filter, "Invalid filter ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid filter ID %u", filter);
else
{
/* Call the appropriate handler */
@@ -320,7 +320,7 @@ AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *val
Device = Context->Device;
LockFiltersRead(Device);
if((ALFilter=LookupFilter(Device, filter)) == NULL)
- alSetError(Context, AL_INVALID_NAME, filter, "Invalid filter ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid filter ID %u", filter);
else
{
/* Call the appropriate handler */
@@ -343,7 +343,7 @@ AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *va
Device = Context->Device;
LockFiltersRead(Device);
if((ALFilter=LookupFilter(Device, filter)) == NULL)
- alSetError(Context, AL_INVALID_NAME, filter, "Invalid filter ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid filter ID %u", filter);
else
{
/* Call the appropriate handler */
@@ -435,37 +435,37 @@ void ALfilterState_setParams(ALfilterState *filter, ALfilterType type, ALfloat g
}
-static void ALlowpass_setParami(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), ALint UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid low-pass integer property"); }
-static void ALlowpass_setParamiv(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), const ALint *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid low-pass integer-vector property"); }
+static void ALlowpass_setParami(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, ALint UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid low-pass integer property 0x%04x", param); }
+static void ALlowpass_setParamiv(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, const ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid low-pass integer-vector property 0x%04x", param); }
static void ALlowpass_setParamf(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat val)
{
switch(param)
{
case AL_LOWPASS_GAIN:
if(!(val >= AL_LOWPASS_MIN_GAIN && val <= AL_LOWPASS_MAX_GAIN))
- SETERR_RETURN(context, AL_INVALID_VALUE, filter->id, "Low-pass gain out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Low-pass gain %f out of range", val);
filter->Gain = val;
break;
case AL_LOWPASS_GAINHF:
if(!(val >= AL_LOWPASS_MIN_GAINHF && val <= AL_LOWPASS_MAX_GAINHF))
- SETERR_RETURN(context, AL_INVALID_VALUE, filter->id, "Low-pass gainhf out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Low-pass gainhf %f out of range", val);
filter->GainHF = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid low-pass float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid low-pass float property 0x%04x", param);
}
}
static void ALlowpass_setParamfv(ALfilter *filter, ALCcontext *context, ALenum param, const ALfloat *vals)
{ ALlowpass_setParamf(filter, context, param, vals[0]); }
-static void ALlowpass_getParami(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid low-pass integer property"); }
-static void ALlowpass_getParamiv(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid low-pass integer-vector property"); }
+static void ALlowpass_getParami(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, ALint *UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid low-pass integer property 0x%04x", param); }
+static void ALlowpass_getParamiv(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid low-pass integer-vector property 0x%04x", param); }
static void ALlowpass_getParamf(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *val)
{
switch(param)
@@ -479,7 +479,7 @@ static void ALlowpass_getParamf(ALfilter *filter, ALCcontext *context, ALenum pa
break;
default:
- alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid low-pass float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid low-pass float property 0x%04x", param);
}
}
static void ALlowpass_getParamfv(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *vals)
@@ -488,37 +488,37 @@ static void ALlowpass_getParamfv(ALfilter *filter, ALCcontext *context, ALenum p
DEFINE_ALFILTER_VTABLE(ALlowpass);
-static void ALhighpass_setParami(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), ALint UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid high-pass integer property"); }
-static void ALhighpass_setParamiv(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), const ALint *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid high-pass integer-vector property"); }
+static void ALhighpass_setParami(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, ALint UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid high-pass integer property 0x%04x", param); }
+static void ALhighpass_setParamiv(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, const ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid high-pass integer-vector property 0x%04x", param); }
static void ALhighpass_setParamf(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat val)
{
switch(param)
{
case AL_HIGHPASS_GAIN:
if(!(val >= AL_HIGHPASS_MIN_GAIN && val <= AL_HIGHPASS_MAX_GAIN))
- SETERR_RETURN(context, AL_INVALID_VALUE, filter->id, "High-pass gain out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "High-pass gain out of range");
filter->Gain = val;
break;
case AL_HIGHPASS_GAINLF:
if(!(val >= AL_HIGHPASS_MIN_GAINLF && val <= AL_HIGHPASS_MAX_GAINLF))
- SETERR_RETURN(context, AL_INVALID_VALUE, filter->id, "High-pass gainlf out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "High-pass gainlf out of range");
filter->GainLF = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid high-pass float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid high-pass float property 0x%04x", param);
}
}
static void ALhighpass_setParamfv(ALfilter *filter, ALCcontext *context, ALenum param, const ALfloat *vals)
{ ALhighpass_setParamf(filter, context, param, vals[0]); }
-static void ALhighpass_getParami(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid high-pass integer property"); }
-static void ALhighpass_getParamiv(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid high-pass integer-vector property"); }
+static void ALhighpass_getParami(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, ALint *UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid high-pass integer property 0x%04x", param); }
+static void ALhighpass_getParamiv(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid high-pass integer-vector property 0x%04x", param); }
static void ALhighpass_getParamf(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *val)
{
switch(param)
@@ -532,7 +532,7 @@ static void ALhighpass_getParamf(ALfilter *filter, ALCcontext *context, ALenum p
break;
default:
- alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid high-pass float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid high-pass float property 0x%04x", param);
}
}
static void ALhighpass_getParamfv(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *vals)
@@ -541,43 +541,43 @@ static void ALhighpass_getParamfv(ALfilter *filter, ALCcontext *context, ALenum
DEFINE_ALFILTER_VTABLE(ALhighpass);
-static void ALbandpass_setParami(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), ALint UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid band-pass integer property"); }
-static void ALbandpass_setParamiv(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), const ALint *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid band-pass integer-vector property"); }
+static void ALbandpass_setParami(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, ALint UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid band-pass integer property 0x%04x", param); }
+static void ALbandpass_setParamiv(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, const ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid band-pass integer-vector property 0x%04x", param); }
static void ALbandpass_setParamf(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat val)
{
switch(param)
{
case AL_BANDPASS_GAIN:
if(!(val >= AL_BANDPASS_MIN_GAIN && val <= AL_BANDPASS_MAX_GAIN))
- SETERR_RETURN(context, AL_INVALID_VALUE, filter->id, "Band-pass gain out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Band-pass gain out of range");
filter->Gain = val;
break;
case AL_BANDPASS_GAINHF:
if(!(val >= AL_BANDPASS_MIN_GAINHF && val <= AL_BANDPASS_MAX_GAINHF))
- SETERR_RETURN(context, AL_INVALID_VALUE, filter->id, "Band-pass gainhf out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Band-pass gainhf out of range");
filter->GainHF = val;
break;
case AL_BANDPASS_GAINLF:
if(!(val >= AL_BANDPASS_MIN_GAINLF && val <= AL_BANDPASS_MAX_GAINLF))
- SETERR_RETURN(context, AL_INVALID_VALUE, filter->id, "Band-pass gainlf out of range",);
+ SETERR_RETURN(context, AL_INVALID_VALUE,, "Band-pass gainlf out of range");
filter->GainLF = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid band-pass float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid band-pass float property 0x%04x", param);
}
}
static void ALbandpass_setParamfv(ALfilter *filter, ALCcontext *context, ALenum param, const ALfloat *vals)
{ ALbandpass_setParamf(filter, context, param, vals[0]); }
-static void ALbandpass_getParami(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid band-pass integer property"); }
-static void ALbandpass_getParamiv(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid band-pass integer-vector property"); }
+static void ALbandpass_getParami(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, ALint *UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid band-pass integer property 0x%04x", param); }
+static void ALbandpass_getParamiv(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid band-pass integer-vector property 0x%04x", param); }
static void ALbandpass_getParamf(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *val)
{
switch(param)
@@ -595,7 +595,7 @@ static void ALbandpass_getParamf(ALfilter *filter, ALCcontext *context, ALenum p
break;
default:
- alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid band-pass float property");
+ alSetError(context, AL_INVALID_ENUM, "Invalid band-pass float property 0x%04x", param);
}
}
static void ALbandpass_getParamfv(ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *vals)
@@ -604,23 +604,23 @@ static void ALbandpass_getParamfv(ALfilter *filter, ALCcontext *context, ALenum
DEFINE_ALFILTER_VTABLE(ALbandpass);
-static void ALnullfilter_setParami(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), ALint UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid null filter property"); }
-static void ALnullfilter_setParamiv(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), const ALint *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid null filter property"); }
-static void ALnullfilter_setParamf(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), ALfloat UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid null filter property"); }
-static void ALnullfilter_setParamfv(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), const ALfloat *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid null filter property"); }
-
-static void ALnullfilter_getParami(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid null filter property"); }
-static void ALnullfilter_getParamiv(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), ALint *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid null filter property"); }
-static void ALnullfilter_getParamf(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), ALfloat *UNUSED(val))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid null filter property"); }
-static void ALnullfilter_getParamfv(ALfilter *filter, ALCcontext *context, ALenum UNUSED(param), ALfloat *UNUSED(vals))
-{ alSetError(context, AL_INVALID_ENUM, filter->id, "Invalid null filter property"); }
+static void ALnullfilter_setParami(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, ALint UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid null filter property 0x%04x", param); }
+static void ALnullfilter_setParamiv(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, const ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid null filter property 0x%04x", param); }
+static void ALnullfilter_setParamf(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, ALfloat UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid null filter property 0x%04x", param); }
+static void ALnullfilter_setParamfv(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, const ALfloat *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid null filter property 0x%04x", param); }
+
+static void ALnullfilter_getParami(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, ALint *UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid null filter property 0x%04x", param); }
+static void ALnullfilter_getParamiv(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, ALint *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid null filter property 0x%04x", param); }
+static void ALnullfilter_getParamf(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, ALfloat *UNUSED(val))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid null filter property 0x%04x", param); }
+static void ALnullfilter_getParamfv(ALfilter *UNUSED(filter), ALCcontext *context, ALenum param, ALfloat *UNUSED(vals))
+{ alSetError(context, AL_INVALID_ENUM, "Invalid null filter property 0x%04x", param); }
DEFINE_ALFILTER_VTABLE(ALnullfilter);
diff --git a/OpenAL32/alListener.c b/OpenAL32/alListener.c
index 51ab6fc9..6d1db2fb 100644
--- a/OpenAL32/alListener.c
+++ b/OpenAL32/alListener.c
@@ -48,15 +48,14 @@ AL_API ALvoid AL_APIENTRY alListenerf(ALenum param, ALfloat value)
{
case AL_GAIN:
if(!(value >= 0.0f && isfinite(value)))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Listener gain out of range", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Listener gain out of range");
listener->Gain = value;
DO_UPDATEPROPS();
break;
case AL_METERS_PER_UNIT:
if(!(value >= AL_MIN_METERS_PER_UNIT && value <= AL_MAX_METERS_PER_UNIT))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Listener meters per unit out of range",
- done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Listener meters per unit out of range");
context->MetersPerUnit = value;
if(!ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire))
UpdateContextProps(context);
@@ -88,7 +87,7 @@ AL_API ALvoid AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat val
{
case AL_POSITION:
if(!(isfinite(value1) && isfinite(value2) && isfinite(value3)))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Listener position out of range", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Listener position out of range");
listener->Position[0] = value1;
listener->Position[1] = value2;
listener->Position[2] = value3;
@@ -97,7 +96,7 @@ AL_API ALvoid AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat val
case AL_VELOCITY:
if(!(isfinite(value1) && isfinite(value2) && isfinite(value3)))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Listener velocity out of range", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Listener velocity out of range");
listener->Velocity[0] = value1;
listener->Velocity[1] = value2;
listener->Velocity[2] = value3;
@@ -140,13 +139,13 @@ AL_API ALvoid AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values)
listener = context->Listener;
WriteLock(&context->PropLock);
- if(!values) SETERR_GOTO(context, AL_INVALID_VALUE, 0, "NULL pointer", done);
+ if(!values) SETERR_GOTO(context, AL_INVALID_VALUE, done, "NULL pointer");
switch(param)
{
case AL_ORIENTATION:
if(!(isfinite(values[0]) && isfinite(values[1]) && isfinite(values[2]) &&
isfinite(values[3]) && isfinite(values[4]) && isfinite(values[5])))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Listener orientation out of range", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Listener orientation out of range");
/* AT then UP */
listener->Forward[0] = values[0];
listener->Forward[1] = values[1];
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index c60b6a01..898e54d6 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -453,8 +453,7 @@ static ALint Int64ValsByProp(ALenum prop)
#define CHECKVAL(x) do { \
if(!(x)) \
{ \
- alSetError(Context, AL_INVALID_VALUE, Source->id, \
- "Value out of range"); \
+ alSetError(Context, AL_INVALID_VALUE, "Value out of range"); \
return AL_FALSE; \
} \
} while(0)
@@ -481,8 +480,8 @@ static ALboolean SetSourcefv(ALsource *Source, ALCcontext *Context, SourceProp p
case AL_SEC_OFFSET_LATENCY_SOFT:
case AL_SEC_OFFSET_CLOCK_SOFT:
/* Query only */
- SETERR_RETURN(Context, AL_INVALID_OPERATION, Source->id,
- "Setting read-only source property", AL_FALSE);
+ SETERR_RETURN(Context, AL_INVALID_OPERATION, AL_FALSE,
+ "Setting read-only source property 0x%04x", prop);
case AL_PITCH:
CHECKVAL(*values >= 0.0f);
@@ -606,8 +605,7 @@ static ALboolean SetSourcefv(ALsource *Source, ALCcontext *Context, SourceProp p
{
WriteUnlock(&Source->queue_lock);
ALCdevice_Unlock(Context->Device);
- SETERR_RETURN(Context, AL_INVALID_VALUE, Source->id, "Invalid offset",
- AL_FALSE);
+ SETERR_RETURN(Context, AL_INVALID_VALUE, AL_FALSE, "Invalid offset");
}
WriteUnlock(&Source->queue_lock);
}
@@ -700,7 +698,7 @@ static ALboolean SetSourcefv(ALsource *Source, ALCcontext *Context, SourceProp p
}
ERR("Unexpected property: 0x%04x\n", prop);
- SETERR_RETURN(Context, AL_INVALID_ENUM, Source->id, "Invalid source float property", AL_FALSE);
+ SETERR_RETURN(Context, AL_INVALID_ENUM, AL_FALSE, "Invalid source float property 0x%04x", prop);
}
static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp prop, const ALint *values)
@@ -722,8 +720,8 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp p
case AL_SAMPLE_LENGTH_SOFT:
case AL_SEC_LENGTH_SOFT:
/* Query only */
- SETERR_RETURN(Context, AL_INVALID_OPERATION, Source->id,
- "Setting read-only source property", AL_FALSE);
+ SETERR_RETURN(Context, AL_INVALID_OPERATION, AL_FALSE,
+ "Setting read-only source property 0x%04x", prop);
case AL_SOURCE_RELATIVE:
CHECKVAL(*values == AL_FALSE || *values == AL_TRUE);
@@ -763,8 +761,8 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp p
if(!(*values == 0 || (buffer=LookupBuffer(device, *values)) != NULL))
{
UnlockBuffersRead(device);
- SETERR_RETURN(Context, AL_INVALID_VALUE, Source->id, "Invalid buffer ID",
- AL_FALSE);
+ SETERR_RETURN(Context, AL_INVALID_VALUE, AL_FALSE, "Invalid buffer ID %u",
+ *values);
}
WriteLock(&Source->queue_lock);
@@ -773,8 +771,8 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp p
{
WriteUnlock(&Source->queue_lock);
UnlockBuffersRead(device);
- SETERR_RETURN(Context, AL_INVALID_OPERATION, Source->id,
- "Setting non-persistently mapped buffer", AL_FALSE);
+ SETERR_RETURN(Context, AL_INVALID_OPERATION, AL_FALSE,
+ "Setting non-persistently mapped buffer %u", buffer->id);
}
else
{
@@ -783,8 +781,8 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp p
{
WriteUnlock(&Source->queue_lock);
UnlockBuffersRead(device);
- SETERR_RETURN(Context, AL_INVALID_OPERATION, Source->id,
- "Setting buffer on playing or paused source", AL_FALSE);
+ SETERR_RETURN(Context, AL_INVALID_OPERATION, AL_FALSE,
+ "Setting buffer on playing or paused source %u", Source->id);
}
}
@@ -849,8 +847,8 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp p
{
WriteUnlock(&Source->queue_lock);
ALCdevice_Unlock(Context->Device);
- SETERR_RETURN(Context, AL_INVALID_VALUE, Source->id,
- "Invalid source offset", AL_FALSE);
+ SETERR_RETURN(Context, AL_INVALID_VALUE, AL_FALSE,
+ "Invalid source offset");
}
WriteUnlock(&Source->queue_lock);
}
@@ -863,8 +861,8 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp p
if(!(*values == 0 || (filter=LookupFilter(device, *values)) != NULL))
{
UnlockFiltersRead(device);
- SETERR_RETURN(Context, AL_INVALID_VALUE, Source->id, "Invalid filter ID",
- AL_FALSE);
+ SETERR_RETURN(Context, AL_INVALID_VALUE, AL_FALSE, "Invalid filter ID %u",
+ *values);
}
if(!filter)
@@ -946,16 +944,24 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp p
case AL_AUXILIARY_SEND_FILTER:
LockEffectSlotsRead(Context);
+ if(!(values[0] == 0 || (slot=LookupEffectSlot(Context, values[0])) != NULL))
+ {
+ UnlockEffectSlotsRead(Context);
+ SETERR_RETURN(Context, AL_INVALID_VALUE, AL_FALSE, "Invalid effect ID %u",
+ values[0]);
+ }
+ if(!((ALuint)values[1] < (ALuint)device->NumAuxSends))
+ {
+ UnlockEffectSlotsRead(Context);
+ SETERR_RETURN(Context, AL_INVALID_VALUE, AL_FALSE, "Invalid send %u", values[1]);
+ }
LockFiltersRead(device);
- if(!((ALuint)values[1] < (ALuint)device->NumAuxSends &&
- (values[0] == 0 || (slot=LookupEffectSlot(Context, values[0])) != NULL) &&
- (values[2] == 0 || (filter=LookupFilter(device, values[2])) != NULL)))
+ if(!(values[2] == 0 || (filter=LookupFilter(device, values[2])) != NULL))
{
UnlockFiltersRead(device);
UnlockEffectSlotsRead(Context);
- /* TODO: Fix message */
- SETERR_RETURN(Context, AL_INVALID_VALUE, Source->id, "Invalid send parameter",
- AL_FALSE);
+ SETERR_RETURN(Context, AL_INVALID_VALUE, AL_FALSE, "Invalid filter ID %u",
+ values[2]);
}
if(!filter)
@@ -1054,8 +1060,8 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp p
}
ERR("Unexpected property: 0x%04x\n", prop);
- SETERR_RETURN(Context, AL_INVALID_ENUM, Source->id, "Invalid source integer property",
- AL_FALSE);
+ SETERR_RETURN(Context, AL_INVALID_ENUM, AL_FALSE, "Invalid source integer property 0x%04x",
+ prop);
}
static ALboolean SetSourcei64v(ALsource *Source, ALCcontext *Context, SourceProp prop, const ALint64SOFT *values)
@@ -1075,8 +1081,8 @@ static ALboolean SetSourcei64v(ALsource *Source, ALCcontext *Context, SourceProp
case AL_SAMPLE_LENGTH_SOFT:
case AL_SEC_LENGTH_SOFT:
/* Query only */
- SETERR_RETURN(Context, AL_INVALID_OPERATION, Source->id,
- "Setting read-only source property", AL_FALSE);
+ SETERR_RETURN(Context, AL_INVALID_OPERATION, AL_FALSE,
+ "Setting read-only source property 0x%04x", prop);
/* 1x int */
case AL_SOURCE_RELATIVE:
@@ -1160,8 +1166,8 @@ static ALboolean SetSourcei64v(ALsource *Source, ALCcontext *Context, SourceProp
}
ERR("Unexpected property: 0x%04x\n", prop);
- SETERR_RETURN(Context, AL_INVALID_ENUM, Source->id, "Invalid source integer64 property",
- AL_FALSE);
+ SETERR_RETURN(Context, AL_INVALID_ENUM, AL_FALSE, "Invalid source integer64 property 0x%04x",
+ prop);
}
#undef CHECKVAL
@@ -1358,8 +1364,8 @@ static ALboolean GetSourcedv(ALsource *Source, ALCcontext *Context, SourceProp p
}
ERR("Unexpected property: 0x%04x\n", prop);
- SETERR_RETURN(Context, AL_INVALID_ENUM, Source->id, "Invalid source double property",
- AL_FALSE);
+ SETERR_RETURN(Context, AL_INVALID_ENUM, AL_FALSE, "Invalid source double property 0x%04x",
+ prop);
}
static ALboolean GetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp prop, ALint *values)
@@ -1603,8 +1609,8 @@ static ALboolean GetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp p
}
ERR("Unexpected property: 0x%04x\n", prop);
- SETERR_RETURN(Context, AL_INVALID_ENUM, Source->id, "Invalid source integer property",
- AL_FALSE);
+ SETERR_RETURN(Context, AL_INVALID_ENUM, AL_FALSE, "Invalid source integer property 0x%04x",
+ prop);
}
static ALboolean GetSourcei64v(ALsource *Source, ALCcontext *Context, SourceProp prop, ALint64 *values)
@@ -1736,8 +1742,8 @@ static ALboolean GetSourcei64v(ALsource *Source, ALCcontext *Context, SourceProp
}
ERR("Unexpected property: 0x%04x\n", prop);
- SETERR_RETURN(Context, AL_INVALID_ENUM, Source->id, "Invalid source integer64 property",
- AL_FALSE);
+ SETERR_RETURN(Context, AL_INVALID_ENUM, AL_FALSE, "Invalid source integer64 property 0x%04x",
+ prop);
}
@@ -1752,7 +1758,7 @@ AL_API ALvoid AL_APIENTRY alGenSources(ALsizei n, ALuint *sources)
if(!context) return;
if(!(n >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Generating negative sources", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Generating %d sources", n);
device = context->Device;
for(cur = 0;cur < n;cur++)
{
@@ -1760,7 +1766,7 @@ AL_API ALvoid AL_APIENTRY alGenSources(ALsizei n, ALuint *sources)
if(!source)
{
alDeleteSources(cur, sources);
- SETERR_GOTO(context, AL_OUT_OF_MEMORY,0, "Failed to allocate source object", done);
+ SETERR_GOTO(context, AL_OUT_OF_MEMORY, done, "Failed to allocate source object");
}
InitSourceParams(source, device->NumAuxSends);
@@ -1774,7 +1780,7 @@ AL_API ALvoid AL_APIENTRY alGenSources(ALsizei n, ALuint *sources)
al_free(source);
alDeleteSources(cur, sources);
- SETERR_GOTO(context, err, 0, "Failed to set source ID", done);
+ SETERR_GOTO(context, err, done, "Failed to set source ID");
}
sources[cur] = source->id;
@@ -1797,13 +1803,13 @@ AL_API ALvoid AL_APIENTRY alDeleteSources(ALsizei n, const ALuint *sources)
LockSourcesWrite(context);
if(!(n >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Deleting negative sources", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Deleting %d sources", n);
/* Check that all Sources are valid */
for(i = 0;i < n;i++)
{
if(LookupSource(context, sources[i]) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, sources[i], "Invalid source ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid source ID %u", sources[i]);
}
device = context->Device;
for(i = 0;i < n;i++)
@@ -1863,9 +1869,9 @@ AL_API ALvoid AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value)
WriteLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!(FloatValsByProp(param) == 1))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid float property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid float property 0x%04x", param);
else
SetSourcefv(Source, Context, param, &value);
UnlockSourcesRead(Context);
@@ -1885,9 +1891,9 @@ AL_API ALvoid AL_APIENTRY alSource3f(ALuint source, ALenum param, ALfloat value1
WriteLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!(FloatValsByProp(param) == 3))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid 3-float property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid 3-float property 0x%04x", param);
else
{
ALfloat fvals[3] = { value1, value2, value3 };
@@ -1910,11 +1916,11 @@ AL_API ALvoid AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat
WriteLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!values)
- alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer");
+ alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
else if(!(FloatValsByProp(param) > 0))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid float-vector property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid float-vector property 0x%04x", param);
else
SetSourcefv(Source, Context, param, values);
UnlockSourcesRead(Context);
@@ -1935,9 +1941,9 @@ AL_API ALvoid AL_APIENTRY alSourcedSOFT(ALuint source, ALenum param, ALdouble va
WriteLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!(DoubleValsByProp(param) == 1))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid double property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid double property 0x%04x", param);
else
{
ALfloat fval = (ALfloat)value;
@@ -1960,9 +1966,9 @@ AL_API ALvoid AL_APIENTRY alSource3dSOFT(ALuint source, ALenum param, ALdouble v
WriteLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!(DoubleValsByProp(param) == 3))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid 3-double property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid 3-double property 0x%04x", param);
else
{
ALfloat fvals[3] = { (ALfloat)value1, (ALfloat)value2, (ALfloat)value3 };
@@ -1986,11 +1992,11 @@ AL_API ALvoid AL_APIENTRY alSourcedvSOFT(ALuint source, ALenum param, const ALdo
WriteLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!values)
- alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer");
+ alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
else if(!((count=DoubleValsByProp(param)) > 0 && count <= 6))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid double-vector property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid double-vector property 0x%04x", param);
else
{
ALfloat fvals[6];
@@ -2018,9 +2024,9 @@ AL_API ALvoid AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value)
WriteLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!(IntValsByProp(param) == 1))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid integer property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid integer property 0x%04x", param);
else
SetSourceiv(Source, Context, param, &value);
UnlockSourcesRead(Context);
@@ -2040,9 +2046,9 @@ AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum param, ALint value1, AL
WriteLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!(IntValsByProp(param) == 3))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid 3-integer property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid 3-integer property 0x%04x", param);
else
{
ALint ivals[3] = { value1, value2, value3 };
@@ -2065,11 +2071,11 @@ AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum param, const ALint *val
WriteLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!values)
- alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer");
+ alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
else if(!(IntValsByProp(param) > 0))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid integer-vector property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid integer-vector property 0x%04x", param);
else
SetSourceiv(Source, Context, param, values);
UnlockSourcesRead(Context);
@@ -2090,9 +2096,9 @@ AL_API ALvoid AL_APIENTRY alSourcei64SOFT(ALuint source, ALenum param, ALint64SO
WriteLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!(Int64ValsByProp(param) == 1))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid integer64 property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid integer64 property 0x%04x", param);
else
SetSourcei64v(Source, Context, param, &value);
UnlockSourcesRead(Context);
@@ -2112,9 +2118,9 @@ AL_API void AL_APIENTRY alSource3i64SOFT(ALuint source, ALenum param, ALint64SOF
WriteLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!(Int64ValsByProp(param) == 3))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid 3-integer64 property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid 3-integer64 property 0x%04x", param);
else
{
ALint64SOFT i64vals[3] = { value1, value2, value3 };
@@ -2137,11 +2143,11 @@ AL_API void AL_APIENTRY alSourcei64vSOFT(ALuint source, ALenum param, const ALin
WriteLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!values)
- alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer");
+ alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
else if(!(Int64ValsByProp(param) > 0))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid integer64-vector property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid integer64-vector property 0x%04x", param);
else
SetSourcei64v(Source, Context, param, values);
UnlockSourcesRead(Context);
@@ -2162,11 +2168,11 @@ AL_API ALvoid AL_APIENTRY alGetSourcef(ALuint source, ALenum param, ALfloat *val
ReadLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!value)
- alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer");
+ alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
else if(!(FloatValsByProp(param) == 1))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid float property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid float property 0x%04x", param);
else
{
ALdouble dval;
@@ -2191,11 +2197,11 @@ AL_API ALvoid AL_APIENTRY alGetSource3f(ALuint source, ALenum param, ALfloat *va
ReadLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!(value1 && value2 && value3))
- alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer");
+ alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
else if(!(FloatValsByProp(param) == 3))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid 3-float property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid 3-float property 0x%04x", param);
else
{
ALdouble dvals[3];
@@ -2225,11 +2231,11 @@ AL_API ALvoid AL_APIENTRY alGetSourcefv(ALuint source, ALenum param, ALfloat *va
ReadLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!values)
- alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer");
+ alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
else if(!((count=FloatValsByProp(param)) > 0 && count <= 6))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid float-vector property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid float-vector property 0x%04x", param);
else
{
ALdouble dvals[6];
@@ -2258,11 +2264,11 @@ AL_API void AL_APIENTRY alGetSourcedSOFT(ALuint source, ALenum param, ALdouble *
ReadLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!value)
- alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer");
+ alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
else if(!(DoubleValsByProp(param) == 1))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid double property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid double property 0x%04x", param);
else
GetSourcedv(Source, Context, param, value);
UnlockSourcesRead(Context);
@@ -2282,11 +2288,11 @@ AL_API void AL_APIENTRY alGetSource3dSOFT(ALuint source, ALenum param, ALdouble
ReadLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!(value1 && value2 && value3))
- alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer");
+ alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
else if(!(DoubleValsByProp(param) == 3))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid 3-double property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid 3-double property 0x%04x", param);
else
{
ALdouble dvals[3];
@@ -2314,11 +2320,11 @@ AL_API void AL_APIENTRY alGetSourcedvSOFT(ALuint source, ALenum param, ALdouble
ReadLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!values)
- alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer");
+ alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
else if(!(DoubleValsByProp(param) > 0))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid double-vector property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid double-vector property 0x%04x", param);
else
GetSourcedv(Source, Context, param, values);
UnlockSourcesRead(Context);
@@ -2339,11 +2345,11 @@ AL_API ALvoid AL_APIENTRY alGetSourcei(ALuint source, ALenum param, ALint *value
ReadLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!value)
- alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer");
+ alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
else if(!(IntValsByProp(param) == 1))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid integer property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid integer property 0x%04x", param);
else
GetSourceiv(Source, Context, param, value);
UnlockSourcesRead(Context);
@@ -2364,11 +2370,11 @@ AL_API void AL_APIENTRY alGetSource3i(ALuint source, ALenum param, ALint *value1
ReadLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!(value1 && value2 && value3))
- alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer");
+ alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
else if(!(IntValsByProp(param) == 3))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid 3-integer property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid 3-integer property 0x%04x", param);
else
{
ALint ivals[3];
@@ -2397,11 +2403,11 @@ AL_API void AL_APIENTRY alGetSourceiv(ALuint source, ALenum param, ALint *values
ReadLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!values)
- alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer");
+ alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
else if(!(IntValsByProp(param) > 0))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid integer-vector property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid integer-vector property 0x%04x", param);
else
GetSourceiv(Source, Context, param, values);
UnlockSourcesRead(Context);
@@ -2422,11 +2428,11 @@ AL_API void AL_APIENTRY alGetSourcei64SOFT(ALuint source, ALenum param, ALint64S
ReadLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!value)
- alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer");
+ alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
else if(!(Int64ValsByProp(param) == 1))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid integer64 property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid integer64 property 0x%04x", param);
else
GetSourcei64v(Source, Context, param, value);
UnlockSourcesRead(Context);
@@ -2446,11 +2452,11 @@ AL_API void AL_APIENTRY alGetSource3i64SOFT(ALuint source, ALenum param, ALint64
ReadLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!(value1 && value2 && value3))
- alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer");
+ alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
else if(!(Int64ValsByProp(param) == 3))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid 3-integer64 property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid 3-integer64 property 0x%04x", param);
else
{
ALint64 i64vals[3];
@@ -2478,11 +2484,11 @@ AL_API void AL_APIENTRY alGetSourcei64vSOFT(ALuint source, ALenum param, ALint64
ReadLock(&Context->PropLock);
LockSourcesRead(Context);
if((Source=LookupSource(Context, source)) == NULL)
- alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID");
+ alSetError(Context, AL_INVALID_NAME, "Invalid source ID %u", source);
else if(!values)
- alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer");
+ alSetError(Context, AL_INVALID_VALUE, "NULL pointer");
else if(!(Int64ValsByProp(param) > 0))
- alSetError(Context, AL_INVALID_ENUM, source, "Invalid integer64-vector property");
+ alSetError(Context, AL_INVALID_ENUM, "Invalid integer64-vector property 0x%04x", param);
else
GetSourcei64v(Source, Context, param, values);
UnlockSourcesRead(Context);
@@ -2509,11 +2515,11 @@ AL_API ALvoid AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources)
LockSourcesRead(context);
if(!(n >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Playing negative sources", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Playing %d sources", n);
for(i = 0;i < n;i++)
{
if(!LookupSource(context, sources[i]))
- SETERR_GOTO(context, AL_INVALID_NAME, sources[i], "Invalid source ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid source ID %u", sources[i]);
}
device = context->Device;
@@ -2536,7 +2542,8 @@ AL_API ALvoid AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources)
if(context->MaxVoices >= newcount)
{
ALCdevice_Unlock(device);
- SETERR_GOTO(context, AL_OUT_OF_MEMORY, 0, "Max voice count overflow", done);
+ SETERR_GOTO(context, AL_OUT_OF_MEMORY, done,
+ "Overflow increasing voice count %d -> %d", context->MaxVoices, newcount);
}
AllocateVoices(context, newcount, device->NumAuxSends);
}
@@ -2696,11 +2703,11 @@ AL_API ALvoid AL_APIENTRY alSourcePausev(ALsizei n, const ALuint *sources)
LockSourcesRead(context);
if(!(n >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Pausing negative sources", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Pausing %d sources", n);
for(i = 0;i < n;i++)
{
if(!LookupSource(context, sources[i]))
- SETERR_GOTO(context, AL_INVALID_NAME, sources[i], "Invalid source ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid source ID %u", sources[i]);
}
device = context->Device;
@@ -2743,11 +2750,11 @@ AL_API ALvoid AL_APIENTRY alSourceStopv(ALsizei n, const ALuint *sources)
LockSourcesRead(context);
if(!(n >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Stopping negative sources", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Stopping %d sources", n);
for(i = 0;i < n;i++)
{
if(!LookupSource(context, sources[i]))
- SETERR_GOTO(context, AL_INVALID_NAME, sources[i], "Invalid source ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid source ID %u", sources[i]);
}
device = context->Device;
@@ -2793,11 +2800,11 @@ AL_API ALvoid AL_APIENTRY alSourceRewindv(ALsizei n, const ALuint *sources)
LockSourcesRead(context);
if(!(n >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Rewinding negative sources", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Rewinding %d sources", n);
for(i = 0;i < n;i++)
{
if(!LookupSource(context, sources[i]))
- SETERR_GOTO(context, AL_INVALID_NAME, sources[i], "Invalid source ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid source ID %u", sources[i]);
}
device = context->Device;
@@ -2847,16 +2854,16 @@ AL_API ALvoid AL_APIENTRY alSourceQueueBuffers(ALuint src, ALsizei nb, const ALu
LockSourcesRead(context);
if(!(nb >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, src, "Queueing negative buffers", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Queueing %d buffers", nb);
if((source=LookupSource(context, src)) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, src, "Invalid source ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid source ID %u", src);
WriteLock(&source->queue_lock);
if(source->SourceType == AL_STATIC)
{
WriteUnlock(&source->queue_lock);
/* Can't queue on a Static Source */
- SETERR_GOTO(context, AL_INVALID_OPERATION, src, "Queueing onto a static source", done);
+ SETERR_GOTO(context, AL_INVALID_OPERATION, done, "Queueing onto static source %u", src);
}
/* Check for a valid Buffer, for its frequency and format */
@@ -2881,7 +2888,8 @@ AL_API ALvoid AL_APIENTRY alSourceQueueBuffers(ALuint src, ALsizei nb, const ALu
if(buffers[i] && (buffer=LookupBuffer(device, buffers[i])) == NULL)
{
WriteUnlock(&source->queue_lock);
- SETERR_GOTO(context, AL_INVALID_NAME, src, "Invalid buffer ID", buffer_error);
+ SETERR_GOTO(context, AL_INVALID_NAME, buffer_error, "Queueing invalid buffer ID %u",
+ buffers[i]);
}
if(!BufferListStart)
@@ -2911,8 +2919,8 @@ AL_API ALvoid AL_APIENTRY alSourceQueueBuffers(ALuint src, ALsizei nb, const ALu
if(buffer->MappedAccess != 0 && !(buffer->MappedAccess&AL_MAP_PERSISTENT_BIT_SOFT))
{
WriteUnlock(&source->queue_lock);
- SETERR_GOTO(context, AL_INVALID_OPERATION, src,
- "Queueing non-persistently mapped buffer", buffer_error);
+ SETERR_GOTO(context, AL_INVALID_OPERATION, buffer_error,
+ "Queueing non-persistently mapped buffer %u", buffer->id);
}
if(BufferFmt == NULL)
@@ -2922,8 +2930,7 @@ AL_API ALvoid AL_APIENTRY alSourceQueueBuffers(ALuint src, ALsizei nb, const ALu
BufferFmt->OriginalType != buffer->OriginalType)
{
WriteUnlock(&source->queue_lock);
- alSetError(context, AL_INVALID_OPERATION, src,
- "Queueing buffer with mismatched format");
+ alSetError(context, AL_INVALID_OPERATION, "Queueing buffer with mismatched format");
buffer_error:
/* A buffer failed (invalid ID or format), so unlock and release
@@ -2994,10 +3001,9 @@ AL_API ALvoid AL_APIENTRY alSourceUnqueueBuffers(ALuint src, ALsizei nb, ALuint
LockSourcesRead(context);
if(!(nb >= 0))
- SETERR_GOTO(context, AL_INVALID_VALUE, src, "Unqueueing negative buffers", done);
-
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Unqueueing %d buffers", nb);
if((source=LookupSource(context, src)) == NULL)
- SETERR_GOTO(context, AL_INVALID_NAME, src, "Invalid source ID", done);
+ SETERR_GOTO(context, AL_INVALID_NAME, done, "Invalid source ID %u", src);
/* Nothing to unqueue. */
if(nb == 0) goto done;
@@ -3006,13 +3012,13 @@ AL_API ALvoid AL_APIENTRY alSourceUnqueueBuffers(ALuint src, ALsizei nb, ALuint
if(source->Looping)
{
WriteUnlock(&source->queue_lock);
- SETERR_GOTO(context, AL_INVALID_VALUE, src, "Unqueueing from a looping source", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Unqueueing from looping source %u", src);
}
if(source->SourceType != AL_STREAMING)
{
WriteUnlock(&source->queue_lock);
- SETERR_GOTO(context, AL_INVALID_VALUE, src, "Unqueueing from a non-streaming source",
- done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Unqueueing from a non-streaming source %u",
+ src);
}
/* Find the new buffer queue head */
@@ -3034,7 +3040,7 @@ AL_API ALvoid AL_APIENTRY alSourceUnqueueBuffers(ALuint src, ALsizei nb, ALuint
if(i != nb)
{
WriteUnlock(&source->queue_lock);
- SETERR_GOTO(context, AL_INVALID_VALUE, src, "Unqueueing pending buffers", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Unqueueing pending buffers");
}
/* Swap it, and cut the new head from the old. */
diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c
index 9c49b2e8..1d442a1c 100644
--- a/OpenAL32/alState.c
+++ b/OpenAL32/alState.c
@@ -697,14 +697,15 @@ AL_API ALvoid AL_APIENTRY alDopplerFactor(ALfloat value)
if(!context) return;
if(!(value >= 0.0f && isfinite(value)))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Doppler factor out of range", done);
-
- WriteLock(&context->PropLock);
- context->DopplerFactor = value;
- DO_UPDATEPROPS();
- WriteUnlock(&context->PropLock);
+ alSetError(context, AL_INVALID_VALUE, "Doppler factor out of range");
+ else
+ {
+ WriteLock(&context->PropLock);
+ context->DopplerFactor = value;
+ DO_UPDATEPROPS();
+ WriteUnlock(&context->PropLock);
+ }
-done:
ALCcontext_DecRef(context);
}
@@ -727,14 +728,15 @@ AL_API ALvoid AL_APIENTRY alDopplerVelocity(ALfloat value)
}
if(!(value >= 0.0f && isfinite(value)))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Doppler velocity out of range", done);
-
- WriteLock(&context->PropLock);
- context->DopplerVelocity = value;
- DO_UPDATEPROPS();
- WriteUnlock(&context->PropLock);
+ alSetError(context, AL_INVALID_VALUE, "Doppler velocity out of range");
+ else
+ {
+ WriteLock(&context->PropLock);
+ context->DopplerVelocity = value;
+ DO_UPDATEPROPS();
+ WriteUnlock(&context->PropLock);
+ }
-done:
ALCcontext_DecRef(context);
}
@@ -746,14 +748,15 @@ AL_API ALvoid AL_APIENTRY alSpeedOfSound(ALfloat value)
if(!context) return;
if(!(value > 0.0f && isfinite(value)))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Speed of sound out of range", done);
-
- WriteLock(&context->PropLock);
- context->SpeedOfSound = value;
- DO_UPDATEPROPS();
- WriteUnlock(&context->PropLock);
+ alSetError(context, AL_INVALID_VALUE, "Speed of sound out of range");
+ else
+ {
+ WriteLock(&context->PropLock);
+ context->SpeedOfSound = value;
+ DO_UPDATEPROPS();
+ WriteUnlock(&context->PropLock);
+ }
-done:
ALCcontext_DecRef(context);
}
@@ -768,15 +771,16 @@ AL_API ALvoid AL_APIENTRY alDistanceModel(ALenum value)
value == AL_LINEAR_DISTANCE || value == AL_LINEAR_DISTANCE_CLAMPED ||
value == AL_EXPONENT_DISTANCE || value == AL_EXPONENT_DISTANCE_CLAMPED ||
value == AL_NONE))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Distance model out of range", done);
-
- WriteLock(&context->PropLock);
- context->DistanceModel = value;
- if(!context->SourceDistanceModel)
- DO_UPDATEPROPS();
- WriteUnlock(&context->PropLock);
+ alSetError(context, AL_INVALID_VALUE, "Distance model out of range");
+ else
+ {
+ WriteLock(&context->PropLock);
+ context->DistanceModel = value;
+ if(!context->SourceDistanceModel)
+ DO_UPDATEPROPS();
+ WriteUnlock(&context->PropLock);
+ }
-done:
ALCcontext_DecRef(context);
}
@@ -825,7 +829,7 @@ AL_API const ALchar* AL_APIENTRY alGetStringiSOFT(ALenum pname, ALsizei index)
{
case AL_RESAMPLER_NAME_SOFT:
if(index < 0 || (size_t)index >= COUNTOF(ResamplerNames))
- SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Resampler name index out of range", done);
+ SETERR_GOTO(context, AL_INVALID_VALUE, done, "Resampler name index out of range");
value = ResamplerNames[index];
break;
@@ -835,7 +839,6 @@ AL_API const ALchar* AL_APIENTRY alGetStringiSOFT(ALenum pname, ALsizei index)
done:
ALCcontext_DecRef(context);
-
return value;
}
diff --git a/OpenAL32/event.c b/OpenAL32/event.c
index 06db8713..3b70c9f3 100644
--- a/OpenAL32/event.c
+++ b/OpenAL32/event.c
@@ -17,9 +17,9 @@ AL_API void AL_APIENTRY alEventControlSOFT(ALsizei count, const ALenum *types, A
context = GetContextRef();
if(!context) return;
- if(count < 0) SETERR_GOTO(context, AL_INVALID_VALUE, 0, "Controlling negative events", done);
+ if(count < 0) SETERR_GOTO(context, AL_INVALID_VALUE, done, "Controlling %d events", count);
if(count == 0) goto done;
- if(!types) SETERR_GOTO(context, AL_INVALID_VALUE, 0, "NULL pointer", done);
+ if(!types) SETERR_GOTO(context, AL_INVALID_VALUE, done, "NULL pointer");
for(i = 0;i < count;i++)
{
@@ -34,7 +34,7 @@ AL_API void AL_APIENTRY alEventControlSOFT(ALsizei count, const ALenum *types, A
else if(types[i] == AL_EVENT_TYPE_DEPRECATED_SOFT)
flags |= EventType_Deprecated;
else
- SETERR_GOTO(context, AL_INVALID_ENUM, 0, "Invalid event type", done);
+ SETERR_GOTO(context, AL_INVALID_ENUM, done, "Invalid event type 0x%04x", types[i]);
}
almtx_lock(&context->EventLock);