From c7065bf42f02e8a4c4f974218efad82706f4a72c Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 9 Nov 2021 11:31:29 +0100 Subject: [PATCH] Fix warning: declaration shadows a local variable --- src/timer/unix/SDL_systimer.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/timer/unix/SDL_systimer.c b/src/timer/unix/SDL_systimer.c index ba9dfc714..fb5053b0f 100644 --- a/src/timer/unix/SDL_systimer.c +++ b/src/timer/unix/SDL_systimer.c @@ -107,8 +107,6 @@ SDL_TicksQuit(void) Uint64 SDL_GetTicks64(void) { - struct timeval now; - if (!ticks_started) { SDL_TicksInit(); } @@ -125,10 +123,11 @@ SDL_GetTicks64(void) SDL_assert(SDL_FALSE); return 0; #endif + } else { + struct timeval now; + gettimeofday(&now, NULL); + return (Uint64)(((Sint64)(now.tv_sec - start_tv.tv_sec) * 1000) + ((now.tv_usec - start_tv.tv_usec) / 1000)); } - - gettimeofday(&now, NULL); - return (Uint64)(((Sint64)(now.tv_sec - start_tv.tv_sec) * 1000) + ((now.tv_usec - start_tv.tv_usec) / 1000)); } Uint64