Refactorization with no functional changes.
Instead of `next_repeat_ms` containing a timestamp based on SDL ticks, we make
it zero-based relative to the key press time, and we store the key press time in
SDL ticks in a new field.
This refactorization is groundwork for future commits which need to use the
key press and release timestamps provided by the Wayland API, which are also
expressed in milliseconds, but whose base does not match the one for SDL ticks.
Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
If `repeat_info->next_repeat_ms` overflows, many key presses will be generated.
In the worst case, `now = 0xFFFFFFFFU` and the loop will never terminate.
Rearrange the comparison in order to gracefully handle the overflow case.
Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
This makes it so that the generated targets are not interdependent,
which allows Linux distributions to split libraries into the
appropriate subpackages as needed.
src/render/psp/SDL_render_psp.c: In function 'PSP_RunCommandQueue':
src/render/psp/SDL_render_psp.c:1200: warning: passing argument 1 of 'PSP_SetBlendState' from incompatible pointer type
src/filesystem/psp/SDL_sysfilesystem.c: In function 'SDL_GetPrefPath':
src/filesystem/psp/SDL_sysfilesystem.c:71: warning: passing argument 1 of 'free' discards qualifiers from pointer target type
This reverts commit c477768e6f.
We want to add the sentinel anytime we pump inside SDL_WaitEventTimeout() to avoid pumping again the next time through, as a performance optimization.
We don't want to catch explicit SDL_PumpEvents() calls by the application with
our polling check to avoid stale data. If the call to SDL_PumpEvents() produced
no events, there will be a sentinel sitting in the queue that will cause
SDL_PollEvent() to immediately return 0 next time it is called.
Our SDL_WaitEventTimeout() implementation avoids this issue by always popping
an event after calling SDL_PumpEvents(). This will remove the new sentinel if
we didn't get any new events.