[Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_variables_rework into lp:widelands

2017-10-31 Thread bunnybot
Continuous integration builds have changed state:

Travis build 2725. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/295415518.
Appveyor build 2537. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_ai_variables_rework-2537.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_variables_rework/+merge/333041
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/ai_variables_rework into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/savegame-menu into lp:widelands

2017-10-31 Thread Jukka Pakarinen
I have been testing the branch and today got it crash.

This is how it crashes:

Single Player
New Game
Click Crater and then OK
Start game
Main Menu
Save Game
Write some Filename and then OK
Main Menu
Exit Game 
OK
Watch Replay
Choose the saved game and then OK
Wait until the end of replay and "End of repaly" message pops up.
Click OK
Game crashes, "Segmentation fault"




Here is few lines of what gdb says about it.



REPLAY: End of replay (gametime: 10434)

Thread 1 "widelands" received signal SIGSEGV, Segmentation fault.
0x5610c735 in UI::Button::set_enabled (this=0x0, on=false) at 
/usr/src/bzr/widelands-repo/savegame-menu/src/ui_basic/button.cc:128
128 if (enabled_ == on)
#0  0x5610c735 in UI::Button::set_enabled (this=0x0, on=false) at 
/usr/src/bzr/widelands-repo/savegame-menu/src/ui_basic/button.cc:128
#1  0x5611cdec in UI::WLMessageBox::clicked_ok (this=0x7fffa520) at 
/usr/src/bzr/widelands-repo/savegame-menu/src/ui_basic/messagebox.cc:150
#2  0x5611dc6f in boost::_mfi::mf0::operator() 
(this=0x5d6f5230, t=...) at /usr/include/boost/bind/mem_fn_template.hpp:70




I tested the same with trunk and it didn't crash.

-- 
https://code.launchpad.net/~widelands-dev/widelands/savegame-menu/+merge/322924
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/savegame-menu.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_variables_rework into lp:widelands

2017-10-31 Thread TiborB
TiborB has proposed merging lp:~widelands-dev/widelands/ai_variables_rework 
into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/ai_variables_rework/+merge/333041

This change is only about memory allocation for AI functions. The goal is to 
reduce intensity how AI allocated and returns memory for its data. I dont have 
a proof but on PCs with low memory the game can have problems with allocation, 
resulting to crashes. After this changes I BELIEVE the number of crashes is 
reduced. Also I believe it has tiny, but measurable positive effect on game 
speed.
So what it contains:
1. changing std::lists to std::deque
2. making some vectors static + using reserve()
3. making some of integers static

I believe no harm should be done with this change
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/ai_variables_rework into lp:widelands.
=== modified file 'src/ai/ai_help_structs.h'
--- src/ai/ai_help_structs.h	2017-09-29 16:10:25 +
+++ src/ai/ai_help_structs.h	2017-10-31 17:41:52 +
@@ -388,7 +388,7 @@
 	explicit EconomyObserver(Widelands::Economy& e);
 
 	Widelands::Economy& economy;
-	std::list flags;
+	std::deque flags;
 	int32_t dismantle_grace_time;
 };
 

=== modified file 'src/ai/defaultai.cc'
--- src/ai/defaultai.cc	2017-09-29 16:10:25 +
+++ src/ai/defaultai.cc	2017-10-31 17:41:52 +
@@ -162,43 +162,43 @@
 		});
 
 	// Subscribe to ShipNotes.
-	shipnotes_subscriber_ =
-	   Notifications::subscribe([this](const NoteShipMessage& note) {
-
-		   // in a short time between start and late_initialization the player
-		   // can get notes that can not be processed.
-		   // It seems that this causes no problem, at least no substantial
-		   if (player_ == nullptr) {
-			   return;
-		   }
-		   if (note.ship->get_owner()->player_number() != player_->player_number()) {
-			   return;
-		   }
-
-		   switch (note.message) {
-
-		   case NoteShipMessage::Message::kGained:
-			   gain_ship(*note.ship, NewShip::kBuilt);
-			   break;
-
-		   case NoteShipMessage::Message::kLost:
-			   for (std::list::iterator i = allships.begin(); i != allships.end(); ++i) {
-   if (i->ship == note.ship) {
-	   allships.erase(i);
-	   break;
-   }
-			   }
-			   break;
-
-		   case NoteShipMessage::Message::kWaitingForCommand:
-			   for (std::list::iterator i = allships.begin(); i != allships.end(); ++i) {
-   if (i->ship == note.ship) {
-	   i->waiting_for_command_ = true;
-	   break;
-   }
-			   }
-		   }
-		});
+	shipnotes_subscriber_ = Notifications::subscribe([this](
+	   const NoteShipMessage& note) {
+
+		// in a short time between start and late_initialization the player
+		// can get notes that can not be processed.
+		// It seems that this causes no problem, at least no substantial
+		if (player_ == nullptr) {
+			return;
+		}
+		if (note.ship->get_owner()->player_number() != player_->player_number()) {
+			return;
+		}
+
+		switch (note.message) {
+
+		case NoteShipMessage::Message::kGained:
+			gain_ship(*note.ship, NewShip::kBuilt);
+			break;
+
+		case NoteShipMessage::Message::kLost:
+			for (std::deque::iterator i = allships.begin(); i != allships.end(); ++i) {
+if (i->ship == note.ship) {
+	allships.erase(i);
+	break;
+}
+			}
+			break;
+
+		case NoteShipMessage::Message::kWaitingForCommand:
+			for (std::deque::iterator i = allships.begin(); i != allships.end(); ++i) {
+if (i->ship == note.ship) {
+	i->waiting_for_command_ = true;
+	break;
+}
+			}
+		}
+	});
 }
 
 DefaultAI::~DefaultAI() {
@@ -1254,7 +1254,8 @@
 	}
 
 	// are we going to count resources now?
-	bool resource_count_now = false;
+	static bool resource_count_now = false;
+	resource_count_now = false;
 	// Testing in first 10 seconds or if last testing was more then 60 sec ago
 	if (field.last_resources_check_time < 1 ||
 	field.last_resources_check_time - gametime > 60 * 1000) {
@@ -1445,12 +1446,15 @@
 	field.unconnected_nearby = false;
 
 	// collect information about productionsites nearby
-	std::vector immovables;
+	static std::vector immovables;
+	immovables.reserve(50);
+	immovables.clear();
 	// Search in a radius of range
 	map.find_immovables(Area(field.coords, kProductionArea + 2), );
 
 	// function seems to return duplicates, so we will use serial numbers to filter them out
-	std::set unique_serials;
+	static std::set unique_serials;
+	unique_serials.clear();
 
 	for (uint32_t i = 0; i < immovables.size(); ++i) {
 		const BaseImmovable& base_immovable = *immovables.at(i).object;
@@ -1483,8 +1487,10 @@
 	map.find_immovables(Area(field.coords, actual_enemy_check_area), );
 
 	// We are interested in unconnected immovables, but we must be also close to connected ones
-	bool any_connected_imm = false;
-	bool any_unconnected_imm = false;
+	static bool any_connected_imm = false;
+	any_connected_imm 

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands-website/fix_code_in_blockquotes into lp:widelands-website

2017-10-31 Thread kaputtnik
Review: Needs Fixing

Does not work when quoting a quoted codeblock. 
Does not regard single lines containing tildes.


-- 
https://code.launchpad.net/~widelands-dev/widelands-website/fix_code_in_blockquotes/+merge/332966
Your team Widelands Developers is subscribed to branch lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/translation_stats into lp:widelands

2017-10-31 Thread bunnybot
Continuous integration builds have changed state:

Travis build 2722. State: failed. Details: 
https://travis-ci.org/widelands/widelands/builds/295046876.
Appveyor build 2534. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_translation_stats-2534.
-- 
https://code.launchpad.net/~widelands-dev/widelands/translation_stats/+merge/332029
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/translation_stats.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp