From b7c076e57648bb5da32ee7191501ee1beb48f2ed Mon Sep 17 00:00:00 2001 From: Raulshc <33253777+Raulshc@users.noreply.github.com> Date: Sat, 5 Oct 2019 18:27:07 +0200 Subject: [PATCH 1/5] Avoid MSVC cast warnings --- buffer.c | 14 +++++++------- primary.c | 4 ++-- reverb.c | 20 ++++++++++---------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/buffer.c b/buffer.c index 0d8d123..6c1529a 100644 --- a/buffer.c +++ b/buffer.c @@ -745,7 +745,7 @@ static HRESULT DSBuffer_SetLoc(DSBuffer *buf, DWORD loc_status) DWORD base = share->sources.maxhw_alloc; buf->source = share->sources.ids[base + --(share->sources.availsw_num)]; } - alSourcef(buf->source, AL_GAIN, mB_to_gain(buf->current.vol)); + alSourcef(buf->source, AL_GAIN, mB_to_gain((float)buf->current.vol)); alSourcef(buf->source, AL_PITCH, buf->current.frequency ? (float)buf->current.frequency/data->format.Format.nSamplesPerSec : 1.0f); @@ -775,7 +775,7 @@ static HRESULT DSBuffer_SetLoc(DSBuffer *buf, DWORD loc_status) alSource3f(source, AL_DIRECTION, params->vConeOrientation.x, params->vConeOrientation.y, -params->vConeOrientation.z); - alSourcef(source, AL_CONE_OUTER_GAIN, mB_to_gain(params->lConeOutsideVolume)); + alSourcef(source, AL_CONE_OUTER_GAIN, mB_to_gain((float)params->lConeOutsideVolume)); alSourcef(source, AL_REFERENCE_DISTANCE, params->flMinDistance); alSourcef(source, AL_MAX_DISTANCE, params->flMaxDistance); if(HAS_EXTENSION(share, SOFT_SOURCE_SPATIALIZE)) @@ -809,7 +809,7 @@ static HRESULT DSBuffer_SetLoc(DSBuffer *buf, DWORD loc_status) alSource3i(source, AL_AUXILIARY_SEND_FILTER, slot, i, filter); } alSourcef(source, AL_ROOM_ROLLOFF_FACTOR, eax_params->flRoomRolloffFactor); - alSourcef(source, AL_CONE_OUTER_GAINHF, mB_to_gain(eax_params->lOutsideVolumeHF)); + alSourcef(source, AL_CONE_OUTER_GAINHF, mB_to_gain((float)eax_params->lOutsideVolumeHF)); alSourcef(source, AL_AIR_ABSORPTION_FACTOR, clampF(prim->current.ctx.flAirAbsorptionHF / -5.0f * eax_params->flAirAbsorptionFactor, 0.0f, 10.0f) @@ -1550,7 +1550,7 @@ static HRESULT WINAPI DSBuffer_SetVolume(IDirectSoundBuffer8 *iface, LONG vol) if(LIKELY(This->source)) { setALContext(This->ctx); - alSourcef(This->source, AL_GAIN, mB_to_gain(vol)); + alSourcef(This->source, AL_GAIN, mB_to_gain((float)vol)); popALContext(); } } @@ -1993,7 +1993,7 @@ void DSBuffer_SetParams(DSBuffer *This, const DS3DBUFFER *params, LONG flags) params->vConeOrientation.y, -params->vConeOrientation.z); if(dirty.bit.cone_outsidevolume) - alSourcef(source, AL_CONE_OUTER_GAIN, mB_to_gain(params->lConeOutsideVolume)); + alSourcef(source, AL_CONE_OUTER_GAIN, mB_to_gain((float)params->lConeOutsideVolume)); if(dirty.bit.min_distance) alSourcef(source, AL_REFERENCE_DISTANCE, params->flMinDistance); if(dirty.bit.max_distance) @@ -2038,7 +2038,7 @@ void DSBuffer_SetParams(DSBuffer *This, const DS3DBUFFER *params, LONG flags) if(dirty.bit.room_rolloff) alSourcef(source, AL_ROOM_ROLLOFF_FACTOR, This->current.eax.flRoomRolloffFactor); if(dirty.bit.cone_outsidevolumehf) - alSourcef(source, AL_CONE_OUTER_GAINHF, mB_to_gain(This->current.eax.lOutsideVolumeHF)); + alSourcef(source, AL_CONE_OUTER_GAINHF, mB_to_gain((float)This->current.eax.lOutsideVolumeHF)); if(dirty.bit.air_absorb) alSourcef(source, AL_AIR_ABSORPTION_FACTOR, This->current.eax.flAirAbsorptionFactor * prim->current.ctx.flAirAbsorptionHF / -5.0f); @@ -2336,7 +2336,7 @@ static HRESULT WINAPI DSBuffer3D_SetConeOutsideVolume(IDirectSound3DBuffer *ifac This->current.ds3d.lConeOutsideVolume = vol; if(LIKELY(This->source)) { - alSourcef(This->source, AL_CONE_OUTER_GAIN, mB_to_gain(vol)); + alSourcef(This->source, AL_CONE_OUTER_GAIN, mB_to_gain((float)vol)); checkALError(); } popALContext(); diff --git a/primary.c b/primary.c index c78e56f..9a93360 100644 --- a/primary.c +++ b/primary.c @@ -995,7 +995,7 @@ static HRESULT WINAPI DSPrimary_SetVolume(IDirectSoundBuffer *iface, LONG vol) return DSERR_CONTROLUNAVAIL; setALContext(This->ctx); - alListenerf(AL_GAIN, mB_to_gain(vol)); + alListenerf(AL_GAIN, mB_to_gain((float)vol)); popALContext(); return DS_OK; @@ -1254,7 +1254,7 @@ static void DSPrimary_SetParams(DSPrimary *This, const DS3DLISTENER *params, LON alAuxiliaryEffectSloti(slot, AL_EFFECTSLOT_EFFECT, This->effect[i]); if(FXSLOT_IS_DIRTY(dirty.bit, i, FXSLOT_VOL_BIT)) alAuxiliaryEffectSlotf(slot, AL_EFFECTSLOT_GAIN, - mB_to_gain(This->current.fxslot[i].props.lVolume) + mB_to_gain((float)This->current.fxslot[i].props.lVolume) ); if(FXSLOT_IS_DIRTY(dirty.bit, i, FXSLOT_FLAGS_BIT)) alAuxiliaryEffectSloti(slot, AL_EFFECTSLOT_AUXILIARY_SEND_AUTO, diff --git a/reverb.c b/reverb.c index af34da8..9b99077 100644 --- a/reverb.c +++ b/reverb.c @@ -34,9 +34,9 @@ static void ApplyReverbParams(ALuint effect, const EAXREVERBPROPERTIES *props) ); alEffectf(effect, AL_EAXREVERB_DIFFUSION, props->flEnvironmentDiffusion); - alEffectf(effect, AL_EAXREVERB_GAIN, mB_to_gain(props->lRoom)); - alEffectf(effect, AL_EAXREVERB_GAINHF, mB_to_gain(props->lRoomHF)); - alEffectf(effect, AL_EAXREVERB_GAINLF, mB_to_gain(props->lRoomLF)); + alEffectf(effect, AL_EAXREVERB_GAIN, mB_to_gain((float)props->lRoom)); + alEffectf(effect, AL_EAXREVERB_GAINHF, mB_to_gain((float)props->lRoomHF)); + alEffectf(effect, AL_EAXREVERB_GAINLF, mB_to_gain((float)props->lRoomLF)); alEffectf(effect, AL_EAXREVERB_DECAY_TIME, props->flDecayTime); alEffectf(effect, AL_EAXREVERB_DECAY_HFRATIO, props->flDecayHFRatio); @@ -48,14 +48,14 @@ static void ApplyReverbParams(ALuint effect, const EAXREVERBPROPERTIES *props) * practical uses, but still technically an error). */ alEffectf(effect, AL_EAXREVERB_REFLECTIONS_GAIN, - clampF(mB_to_gain(props->lReflections), AL_EAXREVERB_MIN_REFLECTIONS_GAIN, + clampF(mB_to_gain((float)props->lReflections), AL_EAXREVERB_MIN_REFLECTIONS_GAIN, AL_EAXREVERB_MAX_REFLECTIONS_GAIN) ); alEffectf(effect, AL_EAXREVERB_REFLECTIONS_DELAY, props->flReflectionsDelay); alEffectfv(effect, AL_EAXREVERB_REFLECTIONS_PAN, &props->vReflectionsPan.x); alEffectf(effect, AL_EAXREVERB_LATE_REVERB_GAIN, - clampF(mB_to_gain(props->lReverb), AL_EAXREVERB_MIN_LATE_REVERB_GAIN, + clampF(mB_to_gain((float)props->lReverb), AL_EAXREVERB_MIN_LATE_REVERB_GAIN, AL_EAXREVERB_MAX_LATE_REVERB_GAIN) ); alEffectf(effect, AL_EAXREVERB_LATE_REVERB_DELAY, props->flReverbDelay); @@ -226,7 +226,7 @@ HRESULT EAXReverb_Set(DSPrimary *prim, LONG idx, DWORD propid, void *pPropData, prim->deferred.fxslot[idx].fx.reverb.lRoom = *data.l; alEffectf(prim->effect[idx], AL_EAXREVERB_GAIN, - mB_to_gain(prim->deferred.fxslot[idx].fx.reverb.lRoom)); + mB_to_gain((float)prim->deferred.fxslot[idx].fx.reverb.lRoom)); checkALError(); FXSLOT_SET_DIRTY(prim->dirty.bit, idx, FXSLOT_EFFECT_BIT); @@ -241,7 +241,7 @@ HRESULT EAXReverb_Set(DSPrimary *prim, LONG idx, DWORD propid, void *pPropData, prim->deferred.fxslot[idx].fx.reverb.lRoomHF = *data.l; alEffectf(prim->effect[idx], AL_EAXREVERB_GAINHF, - mB_to_gain(prim->deferred.fxslot[idx].fx.reverb.lRoomHF)); + mB_to_gain((float)prim->deferred.fxslot[idx].fx.reverb.lRoomHF)); checkALError(); FXSLOT_SET_DIRTY(prim->dirty.bit, idx, FXSLOT_EFFECT_BIT); @@ -256,7 +256,7 @@ HRESULT EAXReverb_Set(DSPrimary *prim, LONG idx, DWORD propid, void *pPropData, prim->deferred.fxslot[idx].fx.reverb.lRoomLF = *data.l; alEffectf(prim->effect[idx], AL_EAXREVERB_GAINLF, - mB_to_gain(prim->deferred.fxslot[idx].fx.reverb.lRoomLF)); + mB_to_gain((float)prim->deferred.fxslot[idx].fx.reverb.lRoomLF)); checkALError(); FXSLOT_SET_DIRTY(prim->dirty.bit, idx, FXSLOT_EFFECT_BIT); @@ -318,7 +318,7 @@ HRESULT EAXReverb_Set(DSPrimary *prim, LONG idx, DWORD propid, void *pPropData, prim->deferred.fxslot[idx].fx.reverb.lReflections = *data.l; alEffectf(prim->effect[idx], AL_EAXREVERB_REFLECTIONS_GAIN, - mB_to_gain(prim->deferred.fxslot[idx].fx.reverb.lReflections)); + mB_to_gain((float)prim->deferred.fxslot[idx].fx.reverb.lReflections)); checkALError(); FXSLOT_SET_DIRTY(prim->dirty.bit, idx, FXSLOT_EFFECT_BIT); @@ -364,7 +364,7 @@ HRESULT EAXReverb_Set(DSPrimary *prim, LONG idx, DWORD propid, void *pPropData, prim->deferred.fxslot[idx].fx.reverb.lReverb = *data.l; alEffectf(prim->effect[idx], AL_EAXREVERB_LATE_REVERB_GAIN, - mB_to_gain(prim->deferred.fxslot[idx].fx.reverb.lReverb)); + mB_to_gain((float)prim->deferred.fxslot[idx].fx.reverb.lReverb)); checkALError(); FXSLOT_SET_DIRTY(prim->dirty.bit, idx, FXSLOT_EFFECT_BIT); From 0f8f05b4877e95b92fc2ba93c0204ee70ce26ad0 Mon Sep 17 00:00:00 2001 From: Raulshc <33253777+Raulshc@users.noreply.github.com> Date: Sat, 5 Oct 2019 20:11:10 +0200 Subject: [PATCH 2/5] Avoid MSVC warnings Specifically: Warning C4090 Warning C4113 Warning C4114 --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c72b70..adccb59 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,9 +97,11 @@ endif() set(DSOAL_DEFS ${DSOAL_DEFS} COBJMACROS) if(MSVC) - add_library(dsound SHARED ${DSOAL_OBJS} msvc.def) + add_library(dsound SHARED ${DSOAL_OBJS} msvc.def) + set(DSOAL_DEFS ${DSOAL_DEFS} _CRT_SECURE_NO_WARNINGS) + set(DSOAL_FLAGS ${DSOAL_FLAGS} /W3 /wd4114 /wd4090 /wd4113) else() - add_library(dsound SHARED ${DSOAL_OBJS} mingw.def) + add_library(dsound SHARED ${DSOAL_OBJS} mingw.def) endif(MSVC) if(WIN32) From 360dcfc99aa039728181c8d403abcc28dd4706f2 Mon Sep 17 00:00:00 2001 From: Raulshc <33253777+Raulshc@users.noreply.github.com> Date: Sat, 5 Oct 2019 20:23:14 +0200 Subject: [PATCH 3/5] Solved MSVC C4114 warning --- CMakeLists.txt | 2 +- buffer.c | 16 ++++++++-------- capture.c | 16 ++++++++-------- dsound8.c | 12 ++++++------ duplex.c | 6 +++--- primary.c | 12 ++++++------ propset.c | 2 +- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index adccb59..48790ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,7 +99,7 @@ set(DSOAL_DEFS ${DSOAL_DEFS} COBJMACROS) if(MSVC) add_library(dsound SHARED ${DSOAL_OBJS} msvc.def) set(DSOAL_DEFS ${DSOAL_DEFS} _CRT_SECURE_NO_WARNINGS) - set(DSOAL_FLAGS ${DSOAL_FLAGS} /W3 /wd4114 /wd4090 /wd4113) + set(DSOAL_FLAGS ${DSOAL_FLAGS} /W3 /wd4090 /wd4113) else() add_library(dsound SHARED ${DSOAL_OBJS} mingw.def) endif(MSVC) diff --git a/buffer.c b/buffer.c index 6c1529a..917b168 100644 --- a/buffer.c +++ b/buffer.c @@ -45,10 +45,10 @@ /* TODO: when bufferlost is set, return from all calls except initialize with * DSERR_BUFFERLOST */ -static const IDirectSoundBuffer8Vtbl DSBuffer_Vtbl; -static const IDirectSound3DBufferVtbl DSBuffer3d_Vtbl; -static const IDirectSoundNotifyVtbl DSBufferNot_Vtbl; -static const IKsPropertySetVtbl DSBufferProp_Vtbl; +static IDirectSoundBuffer8Vtbl DSBuffer_Vtbl; +static IDirectSound3DBufferVtbl DSBuffer3d_Vtbl; +static IDirectSoundNotifyVtbl DSBufferNot_Vtbl; +static IKsPropertySetVtbl DSBufferProp_Vtbl; static inline DSBuffer *impl_from_IDirectSoundBuffer8(IDirectSoundBuffer8 *iface) @@ -1909,7 +1909,7 @@ static HRESULT WINAPI DSBuffer_GetObjectInPath(IDirectSoundBuffer8 *iface, REFGU return E_NOTIMPL; } -static const IDirectSoundBuffer8Vtbl DSBuffer_Vtbl = { +static IDirectSoundBuffer8Vtbl DSBuffer_Vtbl = { DSBuffer_QueryInterface, DSBuffer_AddRef, DSBuffer_Release, @@ -2598,7 +2598,7 @@ static HRESULT WINAPI DSBuffer3D_SetAllParameters(IDirectSound3DBuffer *iface, c return S_OK; } -static const IDirectSound3DBufferVtbl DSBuffer3d_Vtbl = +static IDirectSound3DBufferVtbl DSBuffer3d_Vtbl = { DSBuffer3D_QueryInterface, DSBuffer3D_AddRef, @@ -2713,7 +2713,7 @@ static HRESULT WINAPI DSBufferNot_SetNotificationPositions(IDirectSoundNotify *i return hr; } -static const IDirectSoundNotifyVtbl DSBufferNot_Vtbl = +static IDirectSoundNotifyVtbl DSBufferNot_Vtbl = { DSBufferNot_QueryInterface, DSBufferNot_AddRef, @@ -3024,7 +3024,7 @@ static HRESULT WINAPI DSBufferProp_QuerySupport(IKsPropertySet *iface, return hr; } -static const IKsPropertySetVtbl DSBufferProp_Vtbl = +static IKsPropertySetVtbl DSBufferProp_Vtbl = { DSBufferProp_QueryInterface, DSBufferProp_AddRef, diff --git a/capture.c b/capture.c index cbb2713..34498a8 100644 --- a/capture.c +++ b/capture.c @@ -77,10 +77,10 @@ struct DSCBuffer { BOOL playing, looping; }; -static const IDirectSoundCaptureVtbl DSC_Vtbl; -static const IUnknownVtbl DSC_Unknown_Vtbl; -static const IDirectSoundCaptureBuffer8Vtbl DSCBuffer_Vtbl; -static const IDirectSoundNotifyVtbl DSCNot_Vtbl; +static IDirectSoundCaptureVtbl DSC_Vtbl; +static IUnknownVtbl DSC_Unknown_Vtbl; +static IDirectSoundCaptureBuffer8Vtbl DSCBuffer_Vtbl; +static IDirectSoundNotifyVtbl DSCNot_Vtbl; static void DSCImpl_Destroy(DSCImpl *This); @@ -718,7 +718,7 @@ static HRESULT WINAPI DSCBuffer_GetFXStatus(IDirectSoundCaptureBuffer8 *iface, D return E_NOTIMPL; } -static const IDirectSoundCaptureBuffer8Vtbl DSCBuffer_Vtbl = +static IDirectSoundCaptureBuffer8Vtbl DSCBuffer_Vtbl = { DSCBuffer_QueryInterface, DSCBuffer_AddRef, @@ -824,7 +824,7 @@ static HRESULT WINAPI DSCBufferNot_SetNotificationPositions(IDirectSoundNotify * return hr; } -static const IDirectSoundNotifyVtbl DSCNot_Vtbl = +static IDirectSoundNotifyVtbl DSCNot_Vtbl = { DSCBufferNot_QueryInterface, DSCBufferNot_AddRef, @@ -933,7 +933,7 @@ static ULONG WINAPI DSCImpl_IUnknown_Release(IUnknown *iface) return ref; } -static const IUnknownVtbl DSC_Unknown_Vtbl = { +static IUnknownVtbl DSC_Unknown_Vtbl = { DSCImpl_IUnknown_QueryInterface, DSCImpl_IUnknown_AddRef, DSCImpl_IUnknown_Release @@ -1144,7 +1144,7 @@ static HRESULT WINAPI DSCImpl_Initialize(IDirectSoundCapture *iface, const GUID return hr; } -static const IDirectSoundCaptureVtbl DSC_Vtbl = +static IDirectSoundCaptureVtbl DSC_Vtbl = { DSCImpl_QueryInterface, DSCImpl_AddRef, diff --git a/dsound8.c b/dsound8.c index 43f7e78..99d281a 100644 --- a/dsound8.c +++ b/dsound8.c @@ -451,9 +451,9 @@ static ULONG DSShare_Release(DeviceShare *share) } -static const IDirectSound8Vtbl DS8_Vtbl; -static const IDirectSoundVtbl DS_Vtbl; -static const IUnknownVtbl DS8_Unknown_Vtbl; +static IDirectSound8Vtbl DS8_Vtbl; +static IDirectSoundVtbl DS_Vtbl; +static IUnknownVtbl DS8_Unknown_Vtbl; static HRESULT DSDevice_Create(BOOL is8, REFIID riid, LPVOID *ds); static void DSDevice_Destroy(DSDevice *This); @@ -496,7 +496,7 @@ static ULONG WINAPI DSDevice_IUnknown_Release(IUnknown *iface) return ref; } -static const IUnknownVtbl DS8_Unknown_Vtbl = { +static IUnknownVtbl DS8_Unknown_Vtbl = { DSDevice_IUnknown_QueryInterface, DSDevice_IUnknown_AddRef, DSDevice_IUnknown_Release @@ -1139,7 +1139,7 @@ static HRESULT WINAPI DS8_VerifyCertification(IDirectSound8 *iface, DWORD *certi return DS_OK; } -static const IDirectSound8Vtbl DS8_Vtbl = { +static IDirectSound8Vtbl DS8_Vtbl = { DS8_QueryInterface, DS8_AddRef, DS8_Release, @@ -1221,7 +1221,7 @@ static HRESULT WINAPI DS_Initialize(IDirectSound *iface, const GUID *devguid) return DS8_Initialize(&This->IDirectSound8_iface, devguid); } -static const IDirectSoundVtbl DS_Vtbl = { +static IDirectSoundVtbl DS_Vtbl = { DS_QueryInterface, DS_AddRef, DS_Release, diff --git a/duplex.c b/duplex.c index 01db7f2..718a9be 100644 --- a/duplex.c +++ b/duplex.c @@ -211,7 +211,7 @@ static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSound8_VerifyCertification( return IDirectSound8_VerifyCertification(This->renderer_device,cert); } -static const IDirectSound8Vtbl DirectSoundFullDuplex_DirectSound8_Vtbl = { +static IDirectSound8Vtbl DirectSoundFullDuplex_DirectSound8_Vtbl = { IDirectSoundFullDuplex_IDirectSound8_QueryInterface, IDirectSoundFullDuplex_IDirectSound8_AddRef, IDirectSoundFullDuplex_IDirectSound8_Release, @@ -289,7 +289,7 @@ static HRESULT WINAPI IDirectSoundFullDuplex_IDirectSoundCapture_Initialize( return IDirectSoundCapture_Initialize(This->capture_device,lpcGUID); } -static const IDirectSoundCaptureVtbl DirectSoundFullDuplex_DirectSoundCapture_Vtbl = { +static IDirectSoundCaptureVtbl DirectSoundFullDuplex_DirectSoundCapture_Vtbl = { IDirectSoundFullDuplex_IDirectSoundCapture_QueryInterface, IDirectSoundFullDuplex_IDirectSoundCapture_AddRef, IDirectSoundFullDuplex_IDirectSoundCapture_Release, @@ -460,7 +460,7 @@ static HRESULT WINAPI IDirectSoundFullDuplexImpl_Initialize( return hr; } -static const IDirectSoundFullDuplexVtbl dsfdvt = { +static IDirectSoundFullDuplexVtbl dsfdvt = { /* IUnknown methods */ IDirectSoundFullDuplexImpl_QueryInterface, IDirectSoundFullDuplexImpl_AddRef, diff --git a/primary.c b/primary.c index 9a93360..8774157 100644 --- a/primary.c +++ b/primary.c @@ -37,9 +37,9 @@ #endif -static const IDirectSoundBufferVtbl DSPrimary_Vtbl; -static const IDirectSound3DListenerVtbl DSPrimary3D_Vtbl; -static const IKsPropertySetVtbl DSPrimaryProp_Vtbl; +static IDirectSoundBufferVtbl DSPrimary_Vtbl; +static IDirectSound3DListenerVtbl DSPrimary3D_Vtbl; +static IKsPropertySetVtbl DSPrimaryProp_Vtbl; static void DSPrimary_SetParams(DSPrimary *This, const DS3DLISTENER *params, LONG flags); @@ -1085,7 +1085,7 @@ static HRESULT WINAPI DSPrimary_Restore(IDirectSoundBuffer *iface) return hr; } -static const IDirectSoundBufferVtbl DSPrimary_Vtbl = +static IDirectSoundBufferVtbl DSPrimary_Vtbl = { DSPrimary_QueryInterface, DSPrimary_AddRef, @@ -1743,7 +1743,7 @@ HRESULT WINAPI DSPrimary3D_CommitDeferredSettings(IDirectSound3DListener *iface) return DS_OK; } -static const IDirectSound3DListenerVtbl DSPrimary3D_Vtbl = +static IDirectSound3DListenerVtbl DSPrimary3D_Vtbl = { DSPrimary3D_QueryInterface, DSPrimary3D_AddRef, @@ -1842,7 +1842,7 @@ static HRESULT WINAPI DSPrimaryProp_QuerySupport(IKsPropertySet *iface, return E_PROP_ID_UNSUPPORTED; } -static const IKsPropertySetVtbl DSPrimaryProp_Vtbl = +static IKsPropertySetVtbl DSPrimaryProp_Vtbl = { DSPrimaryProp_QueryInterface, DSPrimaryProp_AddRef, diff --git a/propset.c b/propset.c index 37b0f1c..703d45c 100644 --- a/propset.c +++ b/propset.c @@ -608,7 +608,7 @@ static HRESULT WINAPI IKsPrivatePropertySetImpl_QuerySupport( return E_PROP_ID_UNSUPPORTED; } -static const IKsPropertySetVtbl ikspvt = { +static IKsPropertySetVtbl ikspvt = { IKsPrivatePropertySetImpl_QueryInterface, IKsPrivatePropertySetImpl_AddRef, IKsPrivatePropertySetImpl_Release, From 1f494929e006bc0cd6f27e542f4d8f21eb9e5758 Mon Sep 17 00:00:00 2001 From: Raulshc <33253777+Raulshc@users.noreply.github.com> Date: Sun, 6 Oct 2019 18:49:08 +0200 Subject: [PATCH 4/5] Check whether MSVC has the inline keyword This makes the project works on VS2010 and VS2012 --- CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 48790ad..140f957 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,21 @@ else() endif() endif() +# MSVC workaround for C99 inline +if(MSVC) + check_c_source_compiles("inline void foo(void) { } + int main() {return 0;}" HAVE_INLINE) + if(NOT HAVE_INLINE) + check_c_source_compiles("__inline void foo(void) { } + int main() {return 0;}" HAVE___INLINE) + if(NOT HAVE___INLINE) + message(FATAL_ERROR "No inline keyword found, please update your MSVC version!") + endif() + + set(DSOAL_DEFS ${DSOAL_DEFS} inline=__inline) + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Dinline=__inline") + endif() +endif() if(NOT MSVC) set(DSOAL_FLAGS ${DSOAL_FLAGS} -Winline -Wall) From 0f5e4a91df024acf09661f152d0c66b575d17ab6 Mon Sep 17 00:00:00 2001 From: Raulshc <33253777+Raulshc@users.noreply.github.com> Date: Sun, 6 Oct 2019 19:09:25 +0200 Subject: [PATCH 5/5] Use a conditional on resource file Add conditional compilation directive with RC_INVOKED to resource compiler. This commit avoid a warning using VS2010 and a error using VS >= 2012 with the Windows XP platform toolset. --- version.rc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/version.rc b/version.rc index ca706cd..8673962 100644 --- a/version.rc +++ b/version.rc @@ -43,10 +43,13 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#ifndef RC_INVOKED #include "windef.h" #include "winbase.h" +#endif #include "winver.h" + /* Assign WINE_FILEVERSION and WINE_FILEVERSION_STR high enough number to make sure that programs, relying on the version numbers, will