Fix gcc warning: use const references instead of pass by value for exceptions.

This commit is contained in:
Stephen Anthony 2020-11-28 22:25:22 -03:30
parent ceabffe52b
commit aa42c51709
5 changed files with 6 additions and 6 deletions

View File

@ -240,7 +240,7 @@ int JoyMap::loadMapping(const json& eventMappings, const EventMode mode)
);
i++;
} catch (json::exception) {
} catch (const json::exception&) {
Logger::error("ignoring invalid joystick event");
}
}

View File

@ -208,7 +208,7 @@ int KeyMap::loadMapping(const json& mappings, const EventMode mode) {
);
i++;
} catch (json::exception) {
} catch (const json::exception&) {
Logger::error("ignoring bad keyboard mapping");
}
}

View File

@ -47,7 +47,7 @@ PhysicalJoystickHandler::PhysicalJoystickHandler(
try {
mappings = json::parse(serializedMapping);
} catch (json::exception) {
} catch (const json::exception&) {
Logger::info("converting legacy joystick mappings");
mappings = convertLegacyMapping(serializedMapping);

View File

@ -74,7 +74,7 @@ void PhysicalKeyboardHandler::loadSerializedMappings(const string& serializedMap
try {
mapping = json::parse(serializedMapping);
} catch (json::exception) {
} catch (const json::exception&) {
Logger::info("converting legacy keyboard mappings");
mapping = KeyMap::convertLegacyMapping(serializedMapping);
@ -82,7 +82,7 @@ void PhysicalKeyboardHandler::loadSerializedMappings(const string& serializedMap
try {
myKeyMap.loadMapping(mapping, mode);
} catch (json::exception) {
} catch (const json::exception&) {
Logger::error("ignoring bad keyboard mappings");
}
}

View File

@ -87,7 +87,7 @@ bool PhysicalJoystick::setMap(const json& map)
try {
joyMap.loadMapping(entry.value(), eventModeFromJsonName(entry.key()));
} catch (json::exception) {
} catch (const json::exception&) {
Logger::error("ignoring invalid json mapping for " + entry.key());
}