Skip to content

Commit

Permalink
Merge PR #2810: DirectSound.cpp: Fix MinGW compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrautz committed Feb 5, 2017
2 parents cef2324 + 6afeca6 commit 4ca6f2c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mumble/DirectSound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ void DXAudioInput::run() {
else
dwReadyBytes = dwReadPosition - dwLastReadPos;

if (static_cast<int>(dwReadyBytes) < sizeof(short) * iFrameSize) {
if (static_cast<size_t>(dwReadyBytes) < sizeof(short) * iFrameSize) {
double msecleft = 20.0 - (dwReadyBytes * 20.0) / (sizeof(short) * iFrameSize);

if (didsleep)
Expand All @@ -560,15 +560,15 @@ void DXAudioInput::run() {
didsleep = true;
firstsleep = false;
}
} while (static_cast<int>(dwReadyBytes) < sizeof(short) * iFrameSize);
} while (static_cast<size_t>(dwReadyBytes) < sizeof(short) * iFrameSize);

// Desynchonized?
if (dwReadyBytes > (dwBufferSize / 2)) {
qWarning("DXAudioInput: Lost synchronization");
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<unsigned long>(dwLastReadPos), sizeof(short) * iFrameSize, hr);
bRunning = false;
break;
}
Expand Down

0 comments on commit 4ca6f2c

Please sign in to comment.