Exceptions should be caught by reference.
Found using cppcheck.
This commit is contained in:
parent
db08329d8b
commit
f859e78cb2
6 changed files with 6 additions and 6 deletions
|
@ -1548,7 +1548,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
|
|||
"Focus New Windows", "Focus newly created windows"),
|
||||
m_resource_manager.getResource<bool>(name() + ".focusNewWindows"),
|
||||
saverc_cmd));
|
||||
} catch (FbTk::ResourceException e) {
|
||||
} catch (FbTk::ResourceException & e) {
|
||||
cerr<<e.what()<<endl;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ bool ScreenPlacement::placeWindow(const FluxboxWindow &win, int head,
|
|||
bool placed = false;
|
||||
try {
|
||||
placed = m_strategy->placeWindow(win, head, place_x, place_y);
|
||||
} catch (std::bad_cast cast) {
|
||||
} catch (std::bad_cast & cast) {
|
||||
// This should not happen.
|
||||
// If for some reason we change the PlacementStrategy in Screen
|
||||
// from ScreenPlacement to something else then we might get
|
||||
|
|
|
@ -511,7 +511,7 @@ int main(int argc, char **argv) {
|
|||
<< _FB_CONSOLETEXT(main, ErrorStandardException, "Standard Exception", "Error message")
|
||||
<< ": "
|
||||
<< e.what() << endl;
|
||||
} catch (string error_str) {
|
||||
} catch (string & error_str) {
|
||||
cerr << _FB_CONSOLETEXT(Common, Error, "Error", "Error message header")
|
||||
<< ": "
|
||||
<< error_str << endl;
|
||||
|
|
|
@ -137,7 +137,7 @@ int main() {
|
|||
|
||||
cerr<<"original = "<<replaceme<<endl;
|
||||
cerr<<"newstr = "<<newstr<<endl;
|
||||
} catch (std::exception e) {
|
||||
} catch (std::exception & e) {
|
||||
cerr<<"exception: "<<e.what()<<endl;
|
||||
}
|
||||
cerr<<"Testing stringtok."<<endl;
|
||||
|
|
|
@ -227,7 +227,7 @@ int main(int argc, char **argv) {
|
|||
|
||||
application.eventLoop();
|
||||
|
||||
} catch (string errstr) {
|
||||
} catch (string & errstr) {
|
||||
cerr<<"Error: "<<errstr<<endl;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -407,7 +407,7 @@ int main(int argc, char **argv) {
|
|||
|
||||
try {
|
||||
fbsetroot app(argc, argv, display_name);
|
||||
} catch (string error_str) {
|
||||
} catch (string & error_str) {
|
||||
_FB_USES_NLS;
|
||||
cerr<<_FB_CONSOLETEXT(Common, Error, "Error", "Error message header")<<": "<<error_str<<endl;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue