diff options
author | Chris Robinson <[email protected]> | 2014-07-01 23:24:11 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-07-01 23:24:11 -0700 |
commit | cb726d87cebaec50531e6b2e326bede178bb2065 (patch) | |
tree | 6c2d54c89b964ce584b8d1bfff9502ce29c698b9 /OpenAL32/alFontsound.c | |
parent | fec1fec3733492df49c0cc9f79f19aab7ff849f7 (diff) |
Simplify setting a fontsound link
Diffstat (limited to 'OpenAL32/alFontsound.c')
-rw-r--r-- | OpenAL32/alFontsound.c | 16 |
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: |