← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-1520820 into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1520820 into lp:widelands.

Requested reviews:
  Tino (tino79)
Related bugs:
  Bug #1520820 in widelands: "trunk 7650 fails to compile on gcc 5.2.0"
  https://bugs.launchpad.net/widelands/+bug/1520820

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1520820/+merge/278898

Initialized some variables to fix error in gcc 5.2.0.

Tino, could you please check if this does fix it?
-- 
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1520820.
=== modified file 'src/logic/production_program.cc'
--- src/logic/production_program.cc	2015-11-28 13:56:45 +0000
+++ src/logic/production_program.cc	2015-11-28 21:50:45 +0000
@@ -1049,7 +1049,7 @@
 	assert(m_items.size());
 
 	std::vector<std::string> ware_descnames;
-	uint8_t count;
+	uint8_t count = 0;
 	for (const auto& item_pair : m_items) {
 		count = item_pair.second;
 		std::string ware_descname = tribe.get_ware_descr(item_pair.first)->descname();
@@ -1145,7 +1145,7 @@
 	const TribeDescr & tribe = ps.owner().tribe();
 	assert(m_items.size());
 	std::vector<std::string> worker_descnames;
-	uint8_t count;
+	uint8_t count = 0;
 	for (const auto& item_pair : m_items) {
 		count = item_pair.second;
 		std::string worker_descname = tribe.get_worker_descr(item_pair.first)->descname();


Follow ups