[warnings] fix tautological unsigned zero compare

This commit is contained in:
akallabeth 2024-09-11 20:34:37 +02:00
parent 8ba7b65725
commit 31ef07ead7
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
2 changed files with 5 additions and 8 deletions

View File

@ -128,9 +128,10 @@ static DWORD WINAPI audin_alsa_thread_func(LPVOID arg)
DWORD status = 0; DWORD status = 0;
WLog_Print(alsa->log, WLOG_DEBUG, "in"); WLog_Print(alsa->log, WLOG_DEBUG, "in");
if ((error = snd_pcm_open(&capture_handle, alsa->device_name, SND_PCM_STREAM_CAPTURE, 0)) < 0) const int rc = snd_pcm_open(&capture_handle, alsa->device_name, SND_PCM_STREAM_CAPTURE, 0);
if (rc < 0)
{ {
WLog_Print(alsa->log, WLOG_ERROR, "snd_pcm_open (%s)", snd_strerror(error)); WLog_Print(alsa->log, WLOG_ERROR, "snd_pcm_open (%s)", snd_strerror(rc));
error = CHANNEL_RC_INITIALIZATION_ERROR; error = CHANNEL_RC_INITIALIZATION_ERROR;
goto out; goto out;
} }

View File

@ -330,14 +330,10 @@ static BOOL rdpsnd_oss_set_volume(rdpsndDevicePlugin* device, UINT32 value)
unsigned left = (((value & 0xFFFF) * 100) / 0xFFFF); unsigned left = (((value & 0xFFFF) * 100) / 0xFFFF);
unsigned right = ((((value >> 16) & 0xFFFF) * 100) / 0xFFFF); unsigned right = ((((value >> 16) & 0xFFFF) * 100) / 0xFFFF);
if (left < 0) if (left > 100)
left = 0;
else if (left > 100)
left = 100; left = 100;
if (right < 0) if (right > 100)
right = 0;
else if (right > 100)
right = 100; right = 100;
left |= (right << 8); left |= (right << 8);