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
1=== modified file 'src/sound/sound_handler.cc'
2--- src/sound/sound_handler.cc 2014-04-16 08:46:08 +0000
3+++ src/sound/sound_handler.cc 2014-04-16 14:55:30 +0000
4@@ -236,7 +236,7 @@
5 const std::string & filename,
6 const std::string & fx_name)
7 {
8- filenameset_t dirs, files;
9+ filenameset_t files;
10 filenameset_t::const_iterator i;
11
12 assert(g_fs);
13@@ -509,7 +509,6 @@
14 assert(g_fs);
15
16 filenameset_t files;
17- filenameset_t::const_iterator i;
18
19 files = filter(g_fs->ListDirectory(dir), [&basename](const std::string& fn) {
20 const std::string only_filename = FileSystem::FS_Filename(fn.c_str());
21
22=== modified file 'src/wui/military_box.cc'
23--- src/wui/military_box.cc 2014-02-22 18:04:02 +0000
24+++ src/wui/military_box.cc 2014-04-16 14:55:30 +0000
25@@ -119,9 +119,8 @@
26 }
27
28 void MilitaryBox::init() {
29- char buf[10];
30-
31 { // Retreat line
32+ char buf[10];
33 UI::Box & linebox = *new UI::Box(this, 0, 0, UI::Box::Horizontal);
34 add(&linebox, UI::Box::AlignTop);
35
36
37=== modified file 'src/wui/shipwindow.cc'
38--- src/wui/shipwindow.cc 2014-03-03 20:50:30 +0000
39+++ src/wui/shipwindow.cc 2014-04-16 14:55:30 +0000
40@@ -247,13 +247,11 @@
41 */
42 m_btn_construct_port->set_enabled(can_act && (state == Ship::EXP_FOUNDPORTSPACE));
43 bool coast_nearby = false;
44- bool moveable = false;
45 for (Direction dir = 1; dir <= LAST_DIRECTION; ++dir) {
46 // NOTE buttons are saved in the format DIRECTION - 1
47 m_btn_scout[dir - 1]->set_enabled
48 (can_act && m_ship.exp_dir_swimable(dir) && (state != Ship::EXP_COLONIZING));
49 coast_nearby |= !m_ship.exp_dir_swimable(dir);
50- moveable |= m_ship.exp_dir_swimable(dir);
51 }
52 m_btn_explore_island_cw ->set_enabled(can_act && coast_nearby && (state != Ship::EXP_COLONIZING));
53 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: