aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Pavlik <rpavlik@iastate.edu>2011-11-02 17:33:37 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2012-01-04 06:51:35 (GMT)
commitf859e78cb24cf69cc06e4395c58d804537f301c7 (patch)
treeafc547dd4762d262b59a3109cdb080cffc26dfbd
parentdb08329d8bc689ff14cbb9084814d652ae349621 (diff)
downloadfluxbox_paul-f859e78cb24cf69cc06e4395c58d804537f301c7.zip
fluxbox_paul-f859e78cb24cf69cc06e4395c58d804537f301c7.tar.bz2
Exceptions should be caught by reference.
Found using cppcheck.
-rw-r--r--src/Screen.cc2
-rw-r--r--src/ScreenPlacement.cc2
-rw-r--r--src/main.cc2
-rw-r--r--src/tests/StringUtiltest.cc2
-rw-r--r--util/fbrun/main.cc2
-rw-r--r--util/fbsetroot.cc2
6 files changed, 6 insertions, 6 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 86799da..309ee0d 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1548,7 +1548,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1548 "Focus New Windows", "Focus newly created windows"), 1548 "Focus New Windows", "Focus newly created windows"),
1549 m_resource_manager.getResource<bool>(name() + ".focusNewWindows"), 1549 m_resource_manager.getResource<bool>(name() + ".focusNewWindows"),
1550 saverc_cmd)); 1550 saverc_cmd));
1551 } catch (FbTk::ResourceException e) { 1551 } catch (FbTk::ResourceException & e) {
1552 cerr<<e.what()<<endl; 1552 cerr<<e.what()<<endl;
1553 } 1553 }
1554 1554
diff --git a/src/ScreenPlacement.cc b/src/ScreenPlacement.cc
index 73ddfa2..29c8b5f 100644
--- a/src/ScreenPlacement.cc
+++ b/src/ScreenPlacement.cc
@@ -99,7 +99,7 @@ bool ScreenPlacement::placeWindow(const FluxboxWindow &win, int head,
99 bool placed = false; 99 bool placed = false;
100 try { 100 try {
101 placed = m_strategy->placeWindow(win, head, place_x, place_y); 101 placed = m_strategy->placeWindow(win, head, place_x, place_y);
102 } catch (std::bad_cast cast) { 102 } catch (std::bad_cast & cast) {
103 // This should not happen. 103 // This should not happen.
104 // If for some reason we change the PlacementStrategy in Screen 104 // If for some reason we change the PlacementStrategy in Screen
105 // from ScreenPlacement to something else then we might get 105 // from ScreenPlacement to something else then we might get
diff --git a/src/main.cc b/src/main.cc
index 8aea835..2afef3f 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -511,7 +511,7 @@ int main(int argc, char **argv) {
511 << _FB_CONSOLETEXT(main, ErrorStandardException, "Standard Exception", "Error message") 511 << _FB_CONSOLETEXT(main, ErrorStandardException, "Standard Exception", "Error message")
512 << ": " 512 << ": "
513 << e.what() << endl; 513 << e.what() << endl;
514 } catch (string error_str) { 514 } catch (string & error_str) {
515 cerr << _FB_CONSOLETEXT(Common, Error, "Error", "Error message header") 515 cerr << _FB_CONSOLETEXT(Common, Error, "Error", "Error message header")
516 << ": " 516 << ": "
517 << error_str << endl; 517 << error_str << endl;
diff --git a/src/tests/StringUtiltest.cc b/src/tests/StringUtiltest.cc
index a8d8d57..b723eef 100644
--- a/src/tests/StringUtiltest.cc
+++ b/src/tests/StringUtiltest.cc
@@ -137,7 +137,7 @@ int main() {
137 137
138 cerr<<"original = "<<replaceme<<endl; 138 cerr<<"original = "<<replaceme<<endl;
139 cerr<<"newstr = "<<newstr<<endl; 139 cerr<<"newstr = "<<newstr<<endl;
140 } catch (std::exception e) { 140 } catch (std::exception & e) {
141 cerr<<"exception: "<<e.what()<<endl; 141 cerr<<"exception: "<<e.what()<<endl;
142 } 142 }
143 cerr<<"Testing stringtok."<<endl; 143 cerr<<"Testing stringtok."<<endl;
diff --git a/util/fbrun/main.cc b/util/fbrun/main.cc
index edb88ff..af059d6 100644
--- a/util/fbrun/main.cc
+++ b/util/fbrun/main.cc
@@ -227,7 +227,7 @@ int main(int argc, char **argv) {
227 227
228 application.eventLoop(); 228 application.eventLoop();
229 229
230 } catch (string errstr) { 230 } catch (string & errstr) {
231 cerr<<"Error: "<<errstr<<endl; 231 cerr<<"Error: "<<errstr<<endl;
232 } 232 }
233} 233}
diff --git a/util/fbsetroot.cc b/util/fbsetroot.cc
index 71ff34d..4e7981f 100644
--- a/util/fbsetroot.cc
+++ b/util/fbsetroot.cc
@@ -407,7 +407,7 @@ int main(int argc, char **argv) {
407 407
408 try { 408 try {
409 fbsetroot app(argc, argv, display_name); 409 fbsetroot app(argc, argv, display_name);
410 } catch (string error_str) { 410 } catch (string & error_str) {
411 _FB_USES_NLS; 411 _FB_USES_NLS;
412 cerr<<_FB_CONSOLETEXT(Common, Error, "Error", "Error message header")<<": "<<error_str<<endl; 412 cerr<<_FB_CONSOLETEXT(Common, Error, "Error", "Error message header")<<": "<<error_str<<endl;
413 } 413 }