mirror of https://github.com/stella-emu/stella.git
Fix gcc warning: use const references instead of pass by value for exceptions.
This commit is contained in:
parent
ceabffe52b
commit
aa42c51709
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue