summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-12-22 17:46:20 +0300
committerAndrei Karas <akaras@inbox.ru>2015-12-22 17:46:20 +0300
commitf4d4fb031a17c502a28d60a241c4fa6e838519f2 (patch)
treec2f04afee935016b5467268911e63badf6fc06aa /src/input
parent505d65fa57be4af4ecf5b1b5c6582403e984bc19 (diff)
downloadmv-f4d4fb031a17c502a28d60a241c4fa6e838519f2.tar.gz
mv-f4d4fb031a17c502a28d60a241c4fa6e838519f2.tar.bz2
mv-f4d4fb031a17c502a28d60a241c4fa6e838519f2.tar.xz
mv-f4d4fb031a17c502a28d60a241c4fa6e838519f2.zip
Improve a bit inputmanager.
Diffstat (limited to 'src/input')
-rw-r--r--src/input/inputmanager.cpp8
-rw-r--r--src/input/inputmanager.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp
index 94cac4b05..48efe4719 100644
--- a/src/input/inputmanager.cpp
+++ b/src/input/inputmanager.cpp
@@ -971,11 +971,13 @@ InputActionT InputManager::getActionByKey(const SDL_Event &event) const
return InputAction::NO_VALUE;
}
-void InputManager::addChatCommands(std::list<std::string> &arr)
+void InputManager::addChatCommands(std::list<std::string> &restrict arr)
+ restrict
{
- for (int i = 0; i < static_cast<int>(InputAction::TOTAL); i++)
+ const int sz = static_cast<int>(InputAction::TOTAL);
+ for (int i = 0; i < sz; i++)
{
- const InputActionData &ad = inputActionData[i];
+ const InputActionData &restrict ad = inputActionData[i];
std::string cmd = ad.chatCommand;
if (!cmd.empty())
{
diff --git a/src/input/inputmanager.h b/src/input/inputmanager.h
index b32c0f37e..09ce00fed 100644
--- a/src/input/inputmanager.h
+++ b/src/input/inputmanager.h
@@ -144,7 +144,7 @@ class InputManager final
const std::string &args,
ChatTab *const tab);
- void addChatCommands(std::list<std::string> &arr);
+ void addChatCommands(std::list<std::string> &restrict arr) restrict;
protected:
void resetKey(const InputActionT i);