mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Replace c-style casts & fix implicit conversion warnings. SFML/SFML#2297
This commit is contained in:
parent
ed6d944810
commit
253a4abad4
@ -412,7 +412,7 @@ namespace
|
||||
event.key.shift = shiftDown();
|
||||
event.key.system = systemDown();
|
||||
|
||||
keyMap[kb] = inputEvent.value;
|
||||
keyMap[static_cast<std::size_t>(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<tcflag_t>(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<std::size_t>(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<tcflag_t>(ECHO); // disable console feedback
|
||||
newTerminalConfig.c_lflag &= ~static_cast<tcflag_t>(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
|
||||
|
Loading…
Reference in New Issue
Block a user