diff options
author | Chris Robinson <[email protected]> | 2012-09-16 01:35:16 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-09-16 01:35:16 -0700 |
commit | 657ee85136861c9da105a67050ae84a85ecfe808 (patch) | |
tree | 09c60903ae761af302703315761355513c1c168c /OpenAL32 | |
parent | 965306b296d6599d8562c713c18a01b8766eafee (diff) |
Use a struct to store the FPU mode
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alMain.h | 7 | ||||
-rw-r--r-- | OpenAL32/alAuxEffectSlot.c | 8 | ||||
-rw-r--r-- | OpenAL32/alState.c | 6 |
3 files changed, 12 insertions, 9 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index af71a615..fd372326 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -778,8 +778,11 @@ void *al_malloc(size_t alignment, size_t size); void *al_calloc(size_t alignment, size_t size); void al_free(void *ptr); -int SetMixerFPUMode(void); -void RestoreFPUMode(int state); +typedef struct { + int state; +} FPUCtl; +void SetMixerFPUMode(FPUCtl *ctl); +void RestoreFPUMode(const FPUCtl *ctl); ALvoid *StartThread(ALuint (*func)(ALvoid*), ALvoid *ptr); ALuint StopThread(ALvoid *thread); diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index 048248aa..e3a626a1 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -528,12 +528,12 @@ ALenum InitializeEffect(ALCdevice *Device, ALeffectslot *EffectSlot, ALeffect *e if(State) { - int oldMode; - oldMode = SetMixerFPUMode(); + FPUCtl oldMode; + SetMixerFPUMode(&oldMode); if(ALeffectState_DeviceUpdate(State, Device) == AL_FALSE) { - RestoreFPUMode(oldMode); + RestoreFPUMode(&oldMode); ALCdevice_Unlock(Device); ALeffectState_Destroy(State); return AL_OUT_OF_MEMORY; @@ -551,7 +551,7 @@ ALenum InitializeEffect(ALCdevice *Device, ALeffectslot *EffectSlot, ALeffect *e ALeffectState_Update(EffectSlot->EffectState, Device, EffectSlot); ALCdevice_Unlock(Device); - RestoreFPUMode(oldMode); + RestoreFPUMode(&oldMode); ALeffectState_Destroy(State); State = NULL; diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c index 359885c5..678e9e94 100644 --- a/OpenAL32/alState.c +++ b/OpenAL32/alState.c @@ -597,9 +597,9 @@ AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void) ALboolean UpdateSources; ALsource **src, **src_end; ALeffectslot **slot, **slot_end; - int fpuState; + FPUCtl oldMode; - fpuState = SetMixerFPUMode(); + SetMixerFPUMode(&oldMode); LockContext(Context); Context->DeferUpdates = AL_TRUE; @@ -634,7 +634,7 @@ AL_API ALvoid AL_APIENTRY alDeferUpdatesSOFT(void) } UnlockContext(Context); - RestoreFPUMode(fpuState); + RestoreFPUMode(&oldMode); } ALCcontext_DecRef(Context); |