From 6afeca63fceba8b3e6986937bc76244984ce261b Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Sat, 4 Feb 2017 20:55:37 +0100 Subject: [PATCH] DirectSound.cpp: Fix MinGW compilation warnings DirectSound.cpp:548:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (static_cast(dwReadyBytes) < sizeof(short) * iFrameSize) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ DirectSound.cpp:563:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] } while (static_cast(dwReadyBytes) < sizeof(short) * iFrameSize); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ DirectSound.cpp:571:120: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long long unsigned int' [-Wformat=] qWarning("DXAudioInput: Lock from %ld (%d bytes) failed: hr=0x%08lx",dwLastReadPos, sizeof(short) * iFrameSize, hr); ^ --- src/mumble/DirectSound.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mumble/DirectSound.cpp b/src/mumble/DirectSound.cpp index 2842bfa64..4e53b0ab8 100644 --- a/src/mumble/DirectSound.cpp +++ b/src/mumble/DirectSound.cpp @@ -545,7 +545,7 @@ void DXAudioInput::run() { else dwReadyBytes = dwReadPosition - dwLastReadPos; - if (static_cast(dwReadyBytes) < sizeof(short) * iFrameSize) { + if (static_cast(dwReadyBytes) < sizeof(short) * iFrameSize) { double msecleft = 20.0 - (dwReadyBytes * 20.0) / (sizeof(short) * iFrameSize); if (didsleep) @@ -560,7 +560,7 @@ void DXAudioInput::run() { didsleep = true; firstsleep = false; } - } while (static_cast(dwReadyBytes) < sizeof(short) * iFrameSize); + } while (static_cast(dwReadyBytes) < sizeof(short) * iFrameSize); // Desynchonized? if (dwReadyBytes > (dwBufferSize / 2)) { @@ -568,7 +568,7 @@ void DXAudioInput::run() { dwLastReadPos = dwReadPosition; } else if (bRunning) { if (FAILED(hr = pDSCaptureBuffer->Lock(dwLastReadPos, sizeof(short) * iFrameSize, &aptr1, &nbytes1, &aptr2, &nbytes2, 0))) { - qWarning("DXAudioInput: Lock from %ld (%d bytes) failed: hr=0x%08lx",dwLastReadPos, sizeof(short) * iFrameSize, hr); + qWarning("DXAudioInput: Lock from %lu (%zu bytes) failed: hr=0x%08lx", static_cast(dwLastReadPos), sizeof(short) * iFrameSize, hr); bRunning = false; break; }