aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alFontsound.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-07-01 23:24:11 -0700
committerChris Robinson <[email protected]>2014-07-01 23:24:11 -0700
commitcb726d87cebaec50531e6b2e326bede178bb2065 (patch)
tree6c2d54c89b964ce584b8d1bfff9502ce29c698b9 /OpenAL32/alFontsound.c
parentfec1fec3733492df49c0cc9f79f19aab7ff849f7 (diff)
Simplify setting a fontsound link
Diffstat (limited to 'OpenAL32/alFontsound.c')
-rw-r--r--OpenAL32/alFontsound.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/OpenAL32/alFontsound.c b/OpenAL32/alFontsound.c
index 670fddad..1e2c303d 100644
--- a/OpenAL32/alFontsound.c
+++ b/OpenAL32/alFontsound.c
@@ -821,17 +821,13 @@ void ALfontsound_setPropi(ALfontsound *self, ALCcontext *context, ALenum param,
break;
case AL_FONTSOUND_LINK_SOFT:
- if(!value)
- link = NULL;
- else
- {
- link = LookupFontsound(context->Device, value);
- if(!link)
- SET_ERROR_AND_RETURN(context, AL_INVALID_VALUE);
- }
+ link = value ? LookupFontsound(context->Device, value) : NULL;
+ if(value && !link)
+ SET_ERROR_AND_RETURN(context, AL_INVALID_VALUE);
+
if(link) IncrementRef(&link->ref);
- link = ExchangePtr((XchgPtr*)&self->Link, link);
- if(link) DecrementRef(&link->ref);
+ if((link=ExchangePtr((XchgPtr*)&self->Link, link)) != NULL)
+ DecrementRef(&link->ref);
break;
default: