widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #09242
[Merge] lp:~hjd/widelands/some-cppcheck-fixes into lp:widelands
Hans Joachim Desserud has proposed merging lp:~hjd/widelands/some-cppcheck-fixes into lp:widelands.
Requested reviews:
Widelands Developers (widelands-dev)
For more details, see:
https://code.launchpad.net/~hjd/widelands/some-cppcheck-fixes/+merge/313940
Fixes for some issues found by Cppcheck
--
Your team Widelands Developers is requested to review the proposed merge of lp:~hjd/widelands/some-cppcheck-fixes into lp:widelands.
=== modified file 'src/logic/map_objects/immovable.cc'
--- src/logic/map_objects/immovable.cc 2016-12-18 17:02:44 +0000
+++ src/logic/map_objects/immovable.cc 2017-01-01 20:26:21 +0000
@@ -867,7 +867,7 @@
if (bob) {
game.create_ship(c, type_name, player);
} else {
- Immovable& imm = game.create_immovable_with_name(
+ game.create_immovable_with_name(
c, type_name, owner_type, player, nullptr /* former_building_descr */);
}
} else
=== modified file 'src/logic/map_objects/tribes/tribes.cc'
--- src/logic/map_objects/tribes/tribes.cc 2016-08-04 15:49:05 +0000
+++ src/logic/map_objects/tribes/tribes.cc 2017-01-01 20:26:21 +0000
@@ -67,7 +67,6 @@
}
}
throw GameDataError("The tribe '%s'' does not exist.", tribename.c_str());
- NEVER_HERE();
}
bool Tribes::tribe_exists(const std::string& tribename) {
@@ -315,8 +314,6 @@
}
void Tribes::load_graphics() {
- // These will be deleted at the end of the method.
- std::vector<std::unique_ptr<Texture>> individual_textures_;
for (size_t tribeindex = 0; tribeindex < nrtribes(); ++tribeindex) {
TribeDescr* tribe = tribes_->get_mutable(tribeindex);
for (const std::string& texture_path : tribe->normal_road_paths()) {
=== modified file 'src/network/nethost.cc'
--- src/network/nethost.cc 2016-12-03 13:32:28 +0000
+++ src/network/nethost.cc 2017-01-01 20:26:21 +0000
@@ -1739,7 +1739,6 @@
void NetHost::check_hung_clients() {
assert(d->game != nullptr);
- int nrready = 0;
int nrdelayed = 0;
int nrhung = 0;
@@ -1750,7 +1749,6 @@
int32_t const delta = d->committed_networktime - d->clients.at(i).time;
if (delta == 0) {
- ++nrready;
// reset the hung_since time
d->clients.at(i).hung_since = 0;
} else {
Follow ups