aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-04-20 00:12:52 +0200
committerGitHub <noreply@github.com>2017-04-20 00:12:52 +0200
commitf98bbe193e0093aca8d8957cec82fdbd28639915 (patch)
tree19879fbca595d4e8cddfa8d7d069b7f78016a713 /src/client
parentf3fe62a0bf9e775b3e6e838f104ab605a2238792 (diff)
downloadminetest-f98bbe193e0093aca8d8957cec82fdbd28639915.tar.gz
minetest-f98bbe193e0093aca8d8957cec82fdbd28639915.tar.bz2
minetest-f98bbe193e0093aca8d8957cec82fdbd28639915.zip
Fix various copy instead of const ref reported by cppcheck (part 3) (#5616)
* Also remove 2 non declared but defined functions * Make some functions around const ref changes const
Diffstat (limited to 'src/client')
-rw-r--r--src/client/joystick_controller.cpp3
-rw-r--r--src/client/joystick_controller.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/client/joystick_controller.cpp b/src/client/joystick_controller.cpp
index 3e1442793..cb9d64b9f 100644
--- a/src/client/joystick_controller.cpp
+++ b/src/client/joystick_controller.cpp
@@ -185,7 +185,8 @@ void JoystickController::onJoystickConnect(const std::vector<irr::SJoystickInfo>
m_joystick_id = id;
}
-void JoystickController::setLayoutFromControllerName(std::string name) {
+void JoystickController::setLayoutFromControllerName(const std::string &name)
+{
if (lowercase(name).find("xbox") != std::string::npos) {
m_layout = create_xbox_layout();
} else {
diff --git a/src/client/joystick_controller.h b/src/client/joystick_controller.h
index 867a0c3f2..2c0e7b90a 100644
--- a/src/client/joystick_controller.h
+++ b/src/client/joystick_controller.h
@@ -149,7 +149,7 @@ public:
f32 doubling_dtime;
private:
- void setLayoutFromControllerName(std::string name);
+ void setLayoutFromControllerName(const std::string &name);
JoystickLayout m_layout;