← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~aber/widelands/static into lp:widelands

 

David Allwicher has proposed merging lp:~aber/widelands/static into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~aber/widelands/static/+merge/87053

Values that are never read. 
-- 
https://code.launchpad.net/~aber/widelands/static/+merge/87053
Your team Widelands Developers is requested to review the proposed merge of lp:~aber/widelands/static into lp:widelands.
=== modified file 'src/editor/tools/editor_set_resources_tool.cc'
--- src/editor/tools/editor_set_resources_tool.cc	2011-11-30 21:38:37 +0000
+++ src/editor/tools/editor_set_resources_tool.cc	2011-12-28 23:40:31 +0000
@@ -44,10 +44,9 @@
 		 	(map.get_fcoords(center.node), parent.get_sel_radius()));
 	do {
 		int32_t res        = mr.location().field->get_resources();
-		int32_t amount     = mr.location().field->get_resources_amount();
+		int32_t amount     = m_set_to;
 		int32_t max_amount = world.get_resource(m_cur_res)->get_max_amount();
 
-		amount = m_set_to;
 		if (amount < 0)
 			amount = 0;
 		if (amount > max_amount)

=== modified file 'src/editor/ui_menus/editor_main_menu_load_map.cc'
--- src/editor/ui_menus/editor_main_menu_load_map.cc	2011-11-30 21:38:37 +0000
+++ src/editor/ui_menus/editor_main_menu_load_map.cc	2011-12-28 23:40:31 +0000
@@ -110,7 +110,6 @@
 			 get_inner_h() - posy - spacing - 40,
 			 "---", UI::Align_CenterLeft);
 
-	posx = 5;
 	posy = get_inner_h() - 30;
 
 	m_ok_btn = new UI::Button
@@ -124,7 +123,7 @@
 
 	UI::Button * cancelbtn = new UI::Button
 		(this, "cancel",
-		 get_inner_w() / 2 + spacing, posy, 80, 20,
+		 posx, posy, 80, 20,
 		 g_gr->get_picture(PicMod_UI, "pics/but1.png"),
 		 _("Cancel"));
 	cancelbtn->sigclicked.connect(boost::bind(&Main_Menu_Load_Map::die, this));

=== modified file 'src/editor/ui_menus/editor_main_menu_save_map.cc'
--- src/editor/ui_menus/editor_main_menu_save_map.cc	2011-11-30 21:38:37 +0000
+++ src/editor/ui_menus/editor_main_menu_save_map.cc	2011-12-28 23:40:31 +0000
@@ -124,7 +124,6 @@
 			 "---", UI::Align_CenterLeft);
 
 
-	posx = 5;
 	posy = get_inner_h() - 30;
 
 	m_ok_btn = new UI::Button
@@ -136,7 +135,7 @@
 
 	UI::Button * cancelbtn = new UI::Button
 		(this, "cancel",
-		 get_inner_w() / 2 + spacing, posy, 80, 20,
+		 posx, posy, 80, 20,
 		 g_gr->get_picture(PicMod_UI, "pics/but1.png"),
 		 _("Cancel"));
 	cancelbtn->sigclicked.connect(boost::bind(&Main_Menu_Save_Map::die, boost::ref(*this)));

=== modified file 'src/journal.cc'
--- src/journal.cc	2011-11-30 21:38:37 +0000
+++ src/journal.cc	2011-12-28 23:40:31 +0000
@@ -74,9 +74,6 @@
 /// \sa read(SDLMod &v)
 void Journal::write(SDLKey v)
 {
-	Uint32 vv;
-
-	vv = Little32(static_cast<Uint32>(v));
 	m_recordstream.write(reinterpret_cast<char *>(&v), sizeof(v));
 }
 
@@ -86,9 +83,6 @@
  */
 void Journal::write(SDLMod v)
 {
-	Uint32 vv;
-
-	vv = Little32(static_cast<Uint32>(v));
 	m_recordstream.write(reinterpret_cast<char *>(&v), sizeof(v));
 }
 

=== modified file 'src/logic/productionsite.cc'
--- src/logic/productionsite.cc	2011-11-30 21:38:37 +0000
+++ src/logic/productionsite.cc	2011-12-28 23:40:31 +0000
@@ -539,18 +539,20 @@
 		}
 	}
 	while (!worker_placed) {
-		uint8_t nwp = psite.descr().nr_working_positions();
-		uint8_t pos = 0;
-		for (Working_Position * wp = psite.m_working_positions; pos < nwp; ++wp) {
-			// Find a fitting slot
-			if (!wp->worker && !worker_placed)
-				if (wp->worker_request->get_index() == idx) {
-					delete wp->worker_request;
-					*wp = Working_Position(0, w);
-					worker_placed = true;
-					break;
-				}
-			++pos;
+		{
+			uint8_t nwp = psite.descr().nr_working_positions();
+			uint8_t pos = 0;
+			Working_Position * wp = psite.m_working_positions;
+			for (; pos < nwp; ++wp, ++pos) {
+				// Find a fitting slot
+				if (!wp->worker && !worker_placed)
+					if (wp->worker_request->get_index() == idx) {
+						delete wp->worker_request;
+						*wp = Working_Position(0, w);
+						worker_placed = true;
+						break;
+					}
+			}
 		}
 		if (!worker_placed) {
 			// Find the next smaller version of this worker
@@ -569,7 +571,6 @@
 						("Something went wrong! No fitting place for worker %s in %s at (%u, %u) found!",
 						 w->descr().descname().c_str(), psite.descr().descname().c_str(),
 						 psite.get_position().x, psite.get_position().y);
-			pos = 0;
 		}
 	}
 
@@ -851,13 +852,9 @@
 
 	std::string const & program_name = top_state().program->name();
 
-	uint32_t dt = m_post_timer;
-
 	m_stack.pop_back();
 	if (m_stack.size())
 		top_state().phase = result;
-	else // This was the last program. Relax for a bit before trying to work again
-		dt = std::max(dt, 10000U);
 
 	switch (result) {
 	case Failed:

=== modified file 'src/ui_fsmenu/campaign_select.cc'
--- src/ui_fsmenu/campaign_select.cc	2011-11-30 21:38:37 +0000
+++ src/ui_fsmenu/campaign_select.cc	2011-12-28 23:40:31 +0000
@@ -157,9 +157,7 @@
 		sprintf(cdescription, "campdesc%u", i);
 		sprintf(cdif_descr, "campdiffdescr%u", i);
 
-		uint32_t dif = s.get_natural(cdifficulty);
-		if (dif > 3)
-			dif = 0;
+		s.get_natural(cdifficulty);
 
 		std::string dif_description = s.get_string
 			(cdif_descr, _("[No value found]"));

=== modified file 'src/wlapplication.cc'
--- src/wlapplication.cc	2011-12-26 08:44:36 +0000
+++ src/wlapplication.cc	2011-12-28 23:40:31 +0000
@@ -631,12 +631,6 @@
 				break;
 			}
 			if (cb && cb->key) {
-				int16_t c = ev.key.keysym.unicode;
-
-				//TODO: this kills international characters
-				if (c < 32 || c >= 128)
-					c = 0;
-
 				cb->key(ev.type == SDL_KEYDOWN, ev.key.keysym);
 			}
 			break;
@@ -972,13 +966,14 @@
 	videomode.push_back("Quartz");
 #endif
 	//if a video mode is given on the command line, add that one first
-	const char * videodrv;
-	videodrv = getenv("SDL_VIDEODRIVER");
-	if (videodrv) {
-		log("Also adding video driver %s\n", videodrv);
-		videomode.push_back(videodrv);
+	{
+		const char * videodrv;
+		videodrv = getenv("SDL_VIDEODRIVER");
+		if (videodrv) {
+			log("Also adding video driver %s\n", videodrv);
+			videomode.push_back(videodrv);
+		}
 	}
-
 	char videodrvused[26];
 	strcpy(videodrvused, "SDL_VIDEODRIVER=\0");
 	wout << videodrvused << "&" << std::endl;
@@ -986,8 +981,6 @@
 		strcpy(videodrvused + 16, videomode[i].c_str());
 		videodrvused[16 + videomode[i].size()] = '\0';
 		putenv(videodrvused);
-		//SDL_VideoDriverName(videodrvused, 16);
-		videodrv = getenv("SDL_VIDEODRIVER");
 		log
 			("Graphics: Trying Video driver: %i %s %s\n",
 			 i, videomode[i].c_str(), videodrvused);
@@ -2350,7 +2343,7 @@
 	if (!newfp) return false;
 	/* Redirect standard error */
 	std::string stderrfile = path + "/stderr.txt";
-	newfp = freopen(stderrfile.c_str(), "w", stderr);
+	freopen(stderrfile.c_str(), "w", stderr);
 
 	/* Line buffered */
 	setvbuf(stdout, NULL, _IOLBF, BUFSIZ);


Follow ups