all repos — fluxbox @ f859e78cb24cf69cc06e4395c58d804537f301c7

custom fork of the fluxbox windowmanager

Exceptions should be caught by reference.

Found using cppcheck.
Ryan Pavlik rpavlik@iastate.edu
commit

f859e78cb24cf69cc06e4395c58d804537f301c7

parent

db08329d8bc689ff14cbb9084814d652ae349621

M src/Screen.ccsrc/Screen.cc

@@ -1548,7 +1548,7 @@ focus_menu->insert(new FbTk::BoolMenuItem(_FB_XTEXT(Configmenu, FocusNew,

"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; }
M src/ScreenPlacement.ccsrc/ScreenPlacement.cc

@@ -99,7 +99,7 @@

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
M src/main.ccsrc/main.cc

@@ -511,7 +511,7 @@ cerr << "Fluxbox: "

<< _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;
M src/tests/StringUtiltest.ccsrc/tests/StringUtiltest.cc

@@ -137,7 +137,7 @@ newstr = StringUtil::replaceString(newstr, "be", "not be");

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;
M util/fbrun/main.ccutil/fbrun/main.cc

@@ -227,7 +227,7 @@ fbrun.show();

application.eventLoop(); - } catch (string errstr) { + } catch (string & errstr) { cerr<<"Error: "<<errstr<<endl; } }
M util/fbsetroot.ccutil/fbsetroot.cc

@@ -407,7 +407,7 @@ }

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; }