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
c5f8191b7d
commit
897376d351
|
@ -240,7 +240,7 @@ int JoyMap::loadMapping(const json& eventMappings, const EventMode mode)
|
||||||
);
|
);
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
} catch (json::exception) {
|
} catch (const json::exception&) {
|
||||||
Logger::error("ignoring invalid joystick event");
|
Logger::error("ignoring invalid joystick event");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,7 +208,7 @@ int KeyMap::loadMapping(const json& mappings, const EventMode mode) {
|
||||||
);
|
);
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
} catch (json::exception) {
|
} catch (const json::exception&) {
|
||||||
Logger::error("ignoring bad keyboard mapping");
|
Logger::error("ignoring bad keyboard mapping");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ PhysicalJoystickHandler::PhysicalJoystickHandler(
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mappings = json::parse(serializedMapping);
|
mappings = json::parse(serializedMapping);
|
||||||
} catch (json::exception) {
|
} catch (const json::exception&) {
|
||||||
Logger::info("converting legacy joystick mappings");
|
Logger::info("converting legacy joystick mappings");
|
||||||
|
|
||||||
mappings = convertLegacyMapping(serializedMapping);
|
mappings = convertLegacyMapping(serializedMapping);
|
||||||
|
|
|
@ -74,7 +74,7 @@ void PhysicalKeyboardHandler::loadSerializedMappings(const string& serializedMap
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mapping = json::parse(serializedMapping);
|
mapping = json::parse(serializedMapping);
|
||||||
} catch (json::exception) {
|
} catch (const json::exception&) {
|
||||||
Logger::info("converting legacy keyboard mappings");
|
Logger::info("converting legacy keyboard mappings");
|
||||||
|
|
||||||
mapping = KeyMap::convertLegacyMapping(serializedMapping);
|
mapping = KeyMap::convertLegacyMapping(serializedMapping);
|
||||||
|
@ -82,7 +82,7 @@ void PhysicalKeyboardHandler::loadSerializedMappings(const string& serializedMap
|
||||||
|
|
||||||
try {
|
try {
|
||||||
myKeyMap.loadMapping(mapping, mode);
|
myKeyMap.loadMapping(mapping, mode);
|
||||||
} catch (json::exception) {
|
} catch (const json::exception&) {
|
||||||
Logger::error("ignoring bad keyboard mappings");
|
Logger::error("ignoring bad keyboard mappings");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ bool PhysicalJoystick::setMap(const json& map)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
joyMap.loadMapping(entry.value(), eventModeFromJsonName(entry.key()));
|
joyMap.loadMapping(entry.value(), eventModeFromJsonName(entry.key()));
|
||||||
} catch (json::exception) {
|
} catch (const json::exception&) {
|
||||||
Logger::error("ignoring invalid json mapping for " + entry.key());
|
Logger::error("ignoring invalid json mapping for " + entry.key());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue