mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-06-13 11:05:31 +00:00
Fixed compiler warning
``` ./src/thread/pthread/SDL_syssem.c:140:12: warning: variable 'retval' is used uninitialized whenever 'while' loop exits because its condition is false [-Wsometimes-uninitialized] while (sem_trywait(&sem->sem) != 0) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ./src/thread/pthread/SDL_syssem.c:149:12: note: uninitialized use occurs here return retval; ^~~~~~ ./src/thread/pthread/SDL_syssem.c:140:12: note: remove the condition if it is always true while (sem_trywait(&sem->sem) != 0) { ``` This was a legitimate bug, thank you clang! Fixes https://github.com/libsdl-org/SDL/issues/6830 (cherry picked from commit b678a9802435152324e0603055e4bb190d0ae526)
This commit is contained in:
parent
3b0cd44158
commit
187708e542
|
@ -100,7 +100,7 @@ int SDL_SemWait(SDL_sem *sem)
|
||||||
|
|
||||||
int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
|
int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval = 0;
|
||||||
#ifdef HAVE_SEM_TIMEDWAIT
|
#ifdef HAVE_SEM_TIMEDWAIT
|
||||||
#ifndef HAVE_CLOCK_GETTIME
|
#ifndef HAVE_CLOCK_GETTIME
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
|
|
Loading…
Reference in a new issue