aboutsummaryrefslogtreecommitdiff
path: root/src
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 /src
parentdb08329d8bc689ff14cbb9084814d652ae349621 (diff)
downloadfluxbox_paul-f859e78cb24cf69cc06e4395c58d804537f301c7.zip
fluxbox_paul-f859e78cb24cf69cc06e4395c58d804537f301c7.tar.bz2
Exceptions should be caught by reference.
Found using cppcheck.
Diffstat (limited to 'src')
-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
4 files changed, 4 insertions, 4 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;