summaryrefslogtreecommitdiffstats
path: root/Alc/effects/dedicated.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-05-26 00:01:07 -0700
committerChris Robinson <[email protected]>2013-05-26 00:01:07 -0700
commit8808159d55a65cec92010622f63844e76644722c (patch)
tree7efadd52692b8558e1da4c476c3f63632e60d974 /Alc/effects/dedicated.c
parent2759239754c4e9b7ff3f6d8a267c6a208dae48ed (diff)
Add helper macros to set an error and return, and use it in a few places
Diffstat (limited to 'Alc/effects/dedicated.c')
-rw-r--r--Alc/effects/dedicated.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/Alc/effects/dedicated.c b/Alc/effects/dedicated.c
index 35d26cc0..9ed68af2 100644
--- a/Alc/effects/dedicated.c
+++ b/Alc/effects/dedicated.c
@@ -125,7 +125,7 @@ ALeffectStateFactory *ALdedicatedStateFactory_getFactory(void)
void ALdedicated_SetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
-{ (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
+{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); (void)effect;(void)param;(void)val; }
void ALdedicated_SetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
{
ALdedicated_SetParami(effect, context, param, vals[0]);
@@ -136,15 +136,13 @@ void ALdedicated_SetParamf(ALeffect *effect, ALCcontext *context, ALenum param,
switch(param)
{
case AL_DEDICATED_GAIN:
- if(val >= 0.0f && isfinite(val))
- props->Dedicated.Gain = val;
- else
- alSetError(context, AL_INVALID_VALUE);
+ if(!(val >= 0.0f && isfinite(val)))
+ SET_ERROR_AND_RETURN(context, AL_INVALID_VALUE);
+ props->Dedicated.Gain = val;
break;
default:
- alSetError(context, AL_INVALID_ENUM);
- break;
+ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM);
}
}
void ALdedicated_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
@@ -153,7 +151,7 @@ void ALdedicated_SetParamfv(ALeffect *effect, ALCcontext *context, ALenum param,
}
void ALdedicated_GetParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
-{ (void)effect;(void)param;(void)val; alSetError(context, AL_INVALID_ENUM); }
+{ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); (void)effect;(void)param;(void)val; }
void ALdedicated_GetParamiv(ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
{
ALdedicated_GetParami(effect, context, param, vals);
@@ -168,8 +166,7 @@ void ALdedicated_GetParamf(ALeffect *effect, ALCcontext *context, ALenum param,
break;
default:
- alSetError(context, AL_INVALID_ENUM);
- break;
+ SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM);
}
}
void ALdedicated_GetParamfv(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)