diff options
author | Chris Robinson <[email protected]> | 2018-12-12 21:18:31 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-12 21:18:31 -0800 |
commit | b779ebb512b840a325b32f258261c37bf36a1b7a (patch) | |
tree | 4f09621bb0f307601e8ffdfa9e2dc02bc9630421 /Alc/backends | |
parent | b37bc9f8b7c5ff5f25069ae307c0255ec4320458 (diff) |
Fix some MSVC conversion warnings
Diffstat (limited to 'Alc/backends')
-rw-r--r-- | Alc/backends/dsound.cpp | 6 | ||||
-rw-r--r-- | Alc/backends/wave.cpp | 8 | ||||
-rw-r--r-- | Alc/backends/winmm.cpp | 7 |
3 files changed, 11 insertions, 10 deletions
diff --git a/Alc/backends/dsound.cpp b/Alc/backends/dsound.cpp index 2bb6048a..79e6b01e 100644 --- a/Alc/backends/dsound.cpp +++ b/Alc/backends/dsound.cpp @@ -902,7 +902,7 @@ ALCuint ALCdsoundCapture_availableSamples(ALCdsoundCapture *self) ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; if(!device->Connected.load(std::memory_order_acquire)) - return ll_ringbuffer_read_space(self->Ring); + return static_cast<ALCuint>(ll_ringbuffer_read_space(self->Ring)); ALsizei FrameSize{FrameSizeFromDevFmt(device->FmtChans, device->FmtType, device->mAmbiOrder)}; DWORD BufferBytes{self->BufferBytes}; @@ -915,7 +915,7 @@ ALCuint ALCdsoundCapture_availableSamples(ALCdsoundCapture *self) if(SUCCEEDED(hr)) { DWORD NumBytes{(ReadCursor-LastCursor + BufferBytes) % BufferBytes}; - if(!NumBytes) return ll_ringbuffer_read_space(self->Ring); + if(!NumBytes) return static_cast<ALCubyte>(ll_ringbuffer_read_space(self->Ring)); hr = self->DSCbuffer->Lock(LastCursor, NumBytes, &ReadPtr1, &ReadCnt1, &ReadPtr2, &ReadCnt2, 0); } @@ -934,7 +934,7 @@ ALCuint ALCdsoundCapture_availableSamples(ALCdsoundCapture *self) aluHandleDisconnect(device, "Failure retrieving capture data: 0x%lx", hr); } - return ll_ringbuffer_read_space(self->Ring); + return static_cast<ALCuint>(ll_ringbuffer_read_space(self->Ring)); } } // namespace diff --git a/Alc/backends/wave.cpp b/Alc/backends/wave.cpp index 25245a1b..afa948cb 100644 --- a/Alc/backends/wave.cpp +++ b/Alc/backends/wave.cpp @@ -155,13 +155,13 @@ int ALCwaveBackend_mixerProc(ALCwaveBackend *self) if(!IS_LITTLE_ENDIAN) { - ALuint bytesize = BytesFromDevFmt(device->FmtType); - ALuint i; + const ALsizei bytesize{BytesFromDevFmt(device->FmtType)}; + ALsizei i; if(bytesize == 2) { ALushort *samples = reinterpret_cast<ALushort*>(self->mBuffer.data()); - ALuint len = self->mBuffer.size() / 2; + const auto len = static_cast<ALsizei>(self->mBuffer.size() / 2); for(i = 0;i < len;i++) { ALushort samp = samples[i]; @@ -171,7 +171,7 @@ int ALCwaveBackend_mixerProc(ALCwaveBackend *self) else if(bytesize == 4) { ALuint *samples = reinterpret_cast<ALuint*>(self->mBuffer.data()); - ALuint len = self->mBuffer.size() / 4; + const auto len = static_cast<ALsizei>(self->mBuffer.size() / 4); for(i = 0;i < len;i++) { ALuint samp = samples[i]; diff --git a/Alc/backends/winmm.cpp b/Alc/backends/winmm.cpp index 32cabbde..0d353906 100644 --- a/Alc/backends/winmm.cpp +++ b/Alc/backends/winmm.cpp @@ -361,7 +361,7 @@ ALCboolean ALCwinmmPlayback_start(ALCwinmmPlayback *self) try { std::for_each(self->WaveBuffer.begin(), self->WaveBuffer.end(), [self](WAVEHDR &waveHdr) -> void - { waveOutPrepareHeader(self->OutHdl, &waveHdr, sizeof(WAVEHDR)); } + { waveOutPrepareHeader(self->OutHdl, &waveHdr, static_cast<UINT>(sizeof(WAVEHDR))); } ); self->Writable.store(self->WaveBuffer.size(), std::memory_order_release); @@ -581,8 +581,9 @@ ALCenum ALCwinmmCapture_open(ALCwinmmCapture *self, const ALCchar *deviceName) // Allocate circular memory buffer for the captured audio // Make sure circular buffer is at least 100ms in size - DWORD CapturedDataSize{std::max<DWORD>(device->UpdateSize*device->NumUpdates, - BufferSize*self->WaveBuffer.size())}; + auto CapturedDataSize = static_cast<DWORD>( + std::max<size_t>(device->UpdateSize*device->NumUpdates, BufferSize*self->WaveBuffer.size()) + ); self->Ring = ll_ringbuffer_create(CapturedDataSize, self->Format.nBlockAlign, false); if(!self->Ring) return ALC_INVALID_VALUE; |