Use the new SDL_clamp() macro where sensible

There were a few places throughout the SDL code where values were
clamped using SDL_min() and SDL_max(). Now that we have an SDL_clamp()
macro, use this instead.
This commit is contained in:
David Gow
2021-08-14 22:29:05 +08:00
committed by Sam Lantinga
parent 35c1bbfa49
commit fbc364908a
4 changed files with 11 additions and 11 deletions

View File

@@ -925,7 +925,7 @@ keyboard_handle_repeat_info(void *data, struct wl_keyboard *wl_keyboard,
int32_t rate, int32_t delay)
{
struct SDL_WaylandInput *input = data;
input->keyboard_repeat.repeat_rate = SDL_max(0, SDL_min(rate, 1000));
input->keyboard_repeat.repeat_rate = SDL_clamp(rate, 0, 1000);
input->keyboard_repeat.repeat_delay = delay;
input->keyboard_repeat.is_initialized = SDL_TRUE;
}