Merge lp:~hjd/widelands/code-cleanup into lp:widelands

Proposed by Hans Joachim Desserud
Status: Merged
Merged at revision: 6947
Proposed branch: lp:~hjd/widelands/code-cleanup
Merge into: lp:widelands
Diff against target: 53 lines (+2/-6)
3 files modified
src/sound/sound_handler.cc (+1/-2)
src/wui/military_box.cc (+1/-2)
src/wui/shipwindow.cc (+0/-2)
To merge this branch: bzr merge lp:~hjd/widelands/code-cleanup
Reviewer Review Type Date Requested Status
SirVer Approve
Review via email: mp+216125@code.launchpad.net

Description of the change

Some clean-ups suggested by cppcheck.

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

:shipit:

review: Approve
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Has now been merged.

(Please ignore, test comment)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/sound/sound_handler.cc'
--- src/sound/sound_handler.cc 2014-04-16 08:46:08 +0000
+++ src/sound/sound_handler.cc 2014-04-16 14:55:30 +0000
@@ -236,7 +236,7 @@
236 const std::string & filename,236 const std::string & filename,
237 const std::string & fx_name)237 const std::string & fx_name)
238{238{
239 filenameset_t dirs, files;239 filenameset_t files;
240 filenameset_t::const_iterator i;240 filenameset_t::const_iterator i;
241241
242 assert(g_fs);242 assert(g_fs);
@@ -509,7 +509,6 @@
509 assert(g_fs);509 assert(g_fs);
510510
511 filenameset_t files;511 filenameset_t files;
512 filenameset_t::const_iterator i;
513512
514 files = filter(g_fs->ListDirectory(dir), [&basename](const std::string& fn) {513 files = filter(g_fs->ListDirectory(dir), [&basename](const std::string& fn) {
515 const std::string only_filename = FileSystem::FS_Filename(fn.c_str());514 const std::string only_filename = FileSystem::FS_Filename(fn.c_str());
516515
=== modified file 'src/wui/military_box.cc'
--- src/wui/military_box.cc 2014-02-22 18:04:02 +0000
+++ src/wui/military_box.cc 2014-04-16 14:55:30 +0000
@@ -119,9 +119,8 @@
119}119}
120120
121void MilitaryBox::init() {121void MilitaryBox::init() {
122 char buf[10];
123
124 { // Retreat line122 { // Retreat line
123 char buf[10];
125 UI::Box & linebox = *new UI::Box(this, 0, 0, UI::Box::Horizontal);124 UI::Box & linebox = *new UI::Box(this, 0, 0, UI::Box::Horizontal);
126 add(&linebox, UI::Box::AlignTop);125 add(&linebox, UI::Box::AlignTop);
127126
128127
=== modified file 'src/wui/shipwindow.cc'
--- src/wui/shipwindow.cc 2014-03-03 20:50:30 +0000
+++ src/wui/shipwindow.cc 2014-04-16 14:55:30 +0000
@@ -247,13 +247,11 @@
247 */247 */
248 m_btn_construct_port->set_enabled(can_act && (state == Ship::EXP_FOUNDPORTSPACE));248 m_btn_construct_port->set_enabled(can_act && (state == Ship::EXP_FOUNDPORTSPACE));
249 bool coast_nearby = false;249 bool coast_nearby = false;
250 bool moveable = false;
251 for (Direction dir = 1; dir <= LAST_DIRECTION; ++dir) {250 for (Direction dir = 1; dir <= LAST_DIRECTION; ++dir) {
252 // NOTE buttons are saved in the format DIRECTION - 1251 // NOTE buttons are saved in the format DIRECTION - 1
253 m_btn_scout[dir - 1]->set_enabled252 m_btn_scout[dir - 1]->set_enabled
254 (can_act && m_ship.exp_dir_swimable(dir) && (state != Ship::EXP_COLONIZING));253 (can_act && m_ship.exp_dir_swimable(dir) && (state != Ship::EXP_COLONIZING));
255 coast_nearby |= !m_ship.exp_dir_swimable(dir);254 coast_nearby |= !m_ship.exp_dir_swimable(dir);
256 moveable |= m_ship.exp_dir_swimable(dir);
257 }255 }
258 m_btn_explore_island_cw ->set_enabled(can_act && coast_nearby && (state != Ship::EXP_COLONIZING));256 m_btn_explore_island_cw ->set_enabled(can_act && coast_nearby && (state != Ship::EXP_COLONIZING));
259 m_btn_explore_island_ccw->set_enabled(can_act && coast_nearby && (state != Ship::EXP_COLONIZING));257 m_btn_explore_island_ccw->set_enabled(can_act && coast_nearby && (state != Ship::EXP_COLONIZING));

Subscribers

People subscribed via source and target branches

to status/vote changes: