From 253a4abad43e0b8b19ff2da71434595162cc51d7 Mon Sep 17 00:00:00 2001 From: zakinadhif Date: Wed, 14 Dec 2022 14:53:45 +0700 Subject: [PATCH] Replace c-style casts & fix implicit conversion warnings. SFML/SFML#2297 --- src/SFML/Window/DRM/InputImplUDev.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SFML/Window/DRM/InputImplUDev.cpp b/src/SFML/Window/DRM/InputImplUDev.cpp index 242a7d2e..a45b836e 100644 --- a/src/SFML/Window/DRM/InputImplUDev.cpp +++ b/src/SFML/Window/DRM/InputImplUDev.cpp @@ -412,7 +412,7 @@ namespace event.key.shift = shiftDown(); event.key.system = systemDown(); - keyMap[kb] = inputEvent.value; + keyMap[static_cast(kb)] = inputEvent.value; if (special && inputEvent.value) doDeferredText = special; @@ -493,7 +493,7 @@ namespace // // We only clear the ICANON flag for the time of reading - newTerminalConfig.c_lflag &= ~(tcflag_t)ICANON; + newTerminalConfig.c_lflag &= ~static_cast(ICANON); tcsetattr(STDIN_FILENO, TCSANOW, &newTerminalConfig); timeval timeout; @@ -564,7 +564,7 @@ bool InputImpl::isKeyPressed(Keyboard::Key key) return false; update(); - return keyMap[key]; + return keyMap[static_cast(key)]; } @@ -692,8 +692,8 @@ void InputImpl::setTerminalConfig() tcgetattr(STDIN_FILENO, &newTerminalConfig); // get current terminal config oldTerminalConfig = newTerminalConfig; // create a backup - newTerminalConfig.c_lflag &= ~(tcflag_t)ECHO; // disable console feedback - newTerminalConfig.c_lflag &= ~(tcflag_t)ISIG; // disable signals + newTerminalConfig.c_lflag &= ~static_cast(ECHO); // disable console feedback + newTerminalConfig.c_lflag &= ~static_cast(ISIG); // disable signals newTerminalConfig.c_lflag |= ICANON; // disable noncanonical mode newTerminalConfig.c_iflag |= IGNCR; // ignore carriage return tcsetattr(STDIN_FILENO, TCSANOW, &newTerminalConfig); // set our new config