← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/travis-clang-warnings into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/travis-clang-warnings into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/travis-clang-warnings/+merge/290697

Don't review this yet, I'm just triggering a clang build on travis.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/travis-clang-warnings into lp:widelands.
=== modified file 'src/ai/ai_help_structs.cc'
--- src/ai/ai_help_structs.cc	2016-03-13 21:04:41 +0000
+++ src/ai/ai_help_structs.cc	2016-04-01 12:22:40 +0000
@@ -155,9 +155,6 @@
 			  TerrainDescription::Is::kWater);
 }
 
-// Open water is field where all 6 adjacent triangles are water
-FindNodeOpenWater::FindNodeOpenWater(const World& world) : world_(world) {}
-
 bool FindNodeOpenWater::accept(const Map& /* map */, const FCoords& coord) const {
 	return !(coord.field->nodecaps() & MOVECAPS_WALK) && (coord.field->nodecaps() & MOVECAPS_SWIM);
 }

=== modified file 'src/ai/ai_help_structs.h'
--- src/ai/ai_help_structs.h	2016-03-12 20:06:24 +0000
+++ src/ai/ai_help_structs.h	2016-04-01 12:22:40 +0000
@@ -173,13 +173,12 @@
 };
 
 // This is to be used for shipyards to make sure the water is wide enough
+// Open water is a field where all 6 adjacent triangles are water
 struct FindNodeOpenWater {
-	FindNodeOpenWater(const World& world);
+	// 'world' is unused, but we need to fit the template.
+	FindNodeOpenWater(const World& /* world */) {}
 
 	bool accept(const Map& /* map */, const FCoords& coord) const;
-
-private:
-	const World& world_;
 };
 
 struct FindNodeWithFlagOrRoad {
@@ -351,8 +350,8 @@
 	uint16_t mines_percent;  // % of res it can mine
 	uint32_t current_stats;
 
-	std::vector<int16_t> inputs;
-	std::vector<int16_t> outputs;
+	std::vector<Widelands::DescriptionIndex> inputs;
+	std::vector<Widelands::DescriptionIndex> outputs;
 	std::vector<Widelands::DescriptionIndex> critical_building_material;
 
 	bool produces_building_material;

=== modified file 'src/ai/defaultai.cc'
--- src/ai/defaultai.cc	2016-03-19 12:51:22 +0000
+++ src/ai/defaultai.cc	2016-04-01 12:22:40 +0000
@@ -221,9 +221,6 @@
 					   break;
 				   }
 			   }
-			   	break;
-				default:
-					NEVER_HERE();
 		   }
 		});
 }
@@ -461,7 +458,7 @@
 				check_enemy_sites(gametime);
 				set_taskpool_task_time(gametime +   19 * 1000, SchedulerTaskId::kCheckEnemySites);
 				break;
-			default:
+			case SchedulerTaskId::kUnset :
 				NEVER_HERE();
 			}
 	}
@@ -5321,7 +5318,7 @@
 // NOTE: This is not needed anymore and it seems it is not missed neither
 bool DefaultAI::check_supply(const BuildingObserver& bo) {
 	size_t supplied = 0;
-	for (const int16_t& temp_inputs : bo.inputs) {
+	for (const Widelands::DescriptionIndex& temp_inputs : bo.inputs) {
 		for (const BuildingObserver& temp_building : buildings_) {
 			if (temp_building.cnt_built &&
 			    std::find(temp_building.outputs.begin(), temp_building.outputs.end(), temp_inputs) !=
@@ -5383,7 +5380,7 @@
 				defense += static_cast<float>(95 -  8 * soldier->get_defense_level()) / 100;
 				evade += static_cast<float>(70 - 16 * soldier->get_evade_level()) / 100;
 				break;
-			default:
+			case (Tribes::kNone):
 				NEVER_HERE();
 		}
 
@@ -5538,7 +5535,7 @@
 			case DefaultAI::Type::kWeak:
 				training_score = -4;
 				break;
-			default:
+			case DefaultAI::Type::kVeryWeak:
 				training_score = -2;
 			}
 	} else if (persistent_data->last_soldier_trained + 10 * 60 * 1000 < gametime) {
@@ -5550,7 +5547,7 @@
 			case DefaultAI::Type::kWeak:
 				training_score = -2;
 				break;
-			default:
+			case DefaultAI::Type::kVeryWeak:
 				training_score = -1;
 			}
 	}

=== modified file 'src/ai/defaultai.h'
--- src/ai/defaultai.h	2016-03-12 20:06:24 +0000
+++ src/ai/defaultai.h	2016-04-01 12:22:40 +0000
@@ -52,7 +52,7 @@
  * file. The higher the preciousness_, the more will defaultAI care for that ware
  * and will try to build up an infrastructure to create that ware.
  *
- * \NOTE Network safeness:
+ * \note Network safeness:
  * - The current implementation does not care about network safe randomness, as
  *   only the host is running the computer player code and sends it's player
  *   commands to all other players. If this network behaviour is changed,

=== modified file 'src/economy/economy.cc'
--- src/economy/economy.cc	2016-03-12 07:07:12 +0000
+++ src/economy/economy.cc	2016-04-01 12:22:40 +0000
@@ -618,7 +618,7 @@
 		e.worker_target_quantities_[worker_index] = worker_target_quantities_[worker_index];
 	}
 
-	for (const OPtr<Flag> temp_flag : flags) {
+	for (const OPtr<Flag>& temp_flag : flags) {
 		Flag & flag = *temp_flag.get(owner().egbase());
 		assert(flags_.size() > 1);  // We will not be deleted in remove_flag, right?
 		remove_flag(flag);

=== modified file 'src/editor/editorinteractive.cc'
--- src/editor/editorinteractive.cc	2016-03-24 18:19:47 +0000
+++ src/editor/editorinteractive.cc	2016-04-01 12:22:40 +0000
@@ -654,7 +654,7 @@
 				egbase.load_graphics(loader_ui);
 				loader_ui.step(std::string());
 			} else {
-				loader_ui.stepf(_("Loading map “%s”…"), filename.c_str());
+				loader_ui.step((boost::format(_("Loading map “%s”…")) % filename).str());
 				eia.load(filename);
 			}
 		}

=== modified file 'src/editor/ui_menus/editor_help.cc'
--- src/editor/ui_menus/editor_help.cc	2016-02-13 11:30:01 +0000
+++ src/editor/ui_menus/editor_help.cc	2016-04-01 12:22:40 +0000
@@ -205,8 +205,6 @@
 			cr->push_arg(descr->name());
 			break;
 		}
-		default:
-			throw wexception("EditorHelp: No Type defined for tab.");
 		}
 
 		cr->resume();

=== modified file 'src/editor/ui_menus/editor_main_menu_random_map.cc'
--- src/editor/ui_menus/editor_main_menu_random_map.cc	2016-03-26 18:42:32 +0000
+++ src/editor/ui_menus/editor_main_menu_random_map.cc	2016-04-01 12:22:40 +0000
@@ -367,9 +367,6 @@
 			players_.set_value(max_players_);
 		}
 		normalize_landmass(n);
-		break;
-	default:
-		NEVER_HERE();
 	}
 	nr_edit_box_changed();  // Update ID String
 }

=== modified file 'src/editor/ui_menus/editor_tool_change_resources_options_menu.cc'
--- src/editor/ui_menus/editor_tool_change_resources_options_menu.cc	2016-03-14 18:10:09 +0000
+++ src/editor/ui_menus/editor_tool_change_resources_options_menu.cc	2016-04-01 12:22:40 +0000
@@ -197,10 +197,7 @@
 	case Change_By_Increase: change_by += change_by < 63; break;
 	case Change_By_Decrease: change_by -= 1 < change_by;  break;
 	case    Set_To_Increase: set_to    += set_to    < 63; break;
-	case    Set_To_Decrease: set_to    -= 0 < set_to;     break;
-	default:
-		NEVER_HERE();
-		break;
+	case    Set_To_Decrease: set_to    -= 0 < set_to;
 	}
 	increase_tool_.set_change_by(change_by);
 	increase_tool_.decrease_tool().set_change_by(change_by);

=== modified file 'src/editor/ui_menus/editor_tool_menu.cc'
--- src/editor/ui_menus/editor_tool_menu.cc	2016-01-31 21:03:15 +0000
+++ src/editor/ui_menus/editor_tool_menu.cc	2016-04-01 12:22:40 +0000
@@ -142,7 +142,6 @@
 		break;
 	default:
 		NEVER_HERE();
-		break;
 	}
 
 	parent.select_tool(*current_tool_pointer, EditorTool::First);

=== modified file 'src/graphic/gl/fill_rect_program.cc'
--- src/graphic/gl/fill_rect_program.cc	2016-03-27 20:59:45 +0000
+++ src/graphic/gl/fill_rect_program.cc	2016-04-01 12:22:40 +0000
@@ -75,7 +75,7 @@
 			glDisable(GL_BLEND);
 			break;
 
-		default:
+		case BlendMode::Default:
 			break;
 		}
 
@@ -168,7 +168,7 @@
 			glEnable(GL_BLEND);
 			break;
 
-		default:
+		case BlendMode::Default:
 			break;
 		}
 	}

=== modified file 'src/logic/findimmovable.h'
--- src/logic/findimmovable.h	2016-02-16 13:15:29 +0000
+++ src/logic/findimmovable.h	2016-04-01 12:22:40 +0000
@@ -82,6 +82,8 @@
 	}
 };
 
+const FindImmovable & find_immovable_always_true();
+
 // FindImmovable functor
 struct FindImmovableSize {
 	FindImmovableSize(int32_t const init_min, int32_t const init_max)

=== modified file 'src/logic/map.h'
--- src/logic/map.h	2016-03-22 01:12:29 +0000
+++ src/logic/map.h	2016-04-01 12:22:40 +0000
@@ -30,6 +30,7 @@
 #include "base/i18n.h"
 #include "economy/itransport_cost_calculator.h"
 #include "logic/field.h"
+#include "logic/findimmovable.h"
 #include "logic/description_maintainer.h"
 #include "logic/map_revision.h"
 #include "logic/objective.h"
@@ -99,8 +100,6 @@
 
 Predicates used in path finding and find functions.
 */
-struct FindImmovable;
-const FindImmovable & find_immovable_always_true();
 
 struct FindBob {
 	//  Return true if this bob should be returned by find_bobs.

=== modified file 'src/logic/map_objects/bob.cc'
--- src/logic/map_objects/bob.cc	2016-03-31 06:56:28 +0000
+++ src/logic/map_objects/bob.cc	2016-04-01 12:22:40 +0000
@@ -712,7 +712,7 @@
 	// Slowing down a ship if two or more on same spot
 	// Using probability of 1/8 and pausing it for 5, 10 or 15 seconds
 	if (game.logic_rand() % 8 == 0) {
-		if (upcast(Ship, ship, this)) {
+		if (is_a(Ship, this)) {
 			Map& map = game.map();
 			const uint32_t ships_count
 				= map.find_bobs(Widelands::Area<Widelands::FCoords>(get_position(), 0), nullptr, FindBobShip());

=== modified file 'src/logic/map_objects/tribes/building.cc'
--- src/logic/map_objects/tribes/building.cc	2016-03-21 05:45:29 +0000
+++ src/logic/map_objects/tribes/building.cc	2016-04-01 12:22:40 +0000
@@ -495,9 +495,6 @@
 		if (upcast(ProductionSite const, productionsite, this)) {
 			result = productionsite->production_result();
 		}
-		break;
-	default:
-		NEVER_HERE();
 	}
 	return result;
 }

=== modified file 'src/logic/map_objects/tribes/production_program.cc'
--- src/logic/map_objects/tribes/production_program.cc	2016-03-12 07:07:12 +0000
+++ src/logic/map_objects/tribes/production_program.cc	2016-04-01 12:22:40 +0000
@@ -1385,7 +1385,9 @@
 		ps.set_production_result(_("No soldier to train!"));
 		return ps.program_end(game, Skipped);
 	}
-	ps.molog("  Checking soldier (%u) level %d)\n", attribute, level);
+	ps.molog("  Checking soldier (%u) level %d)\n",
+				static_cast<unsigned int>(attribute),
+				static_cast<unsigned int>(level));
 
 	const std::vector<Soldier *>::const_iterator soldiers_end = soldiers.end();
 	for (std::vector<Soldier *>::const_iterator it = soldiers.begin();; ++it) {
@@ -1471,7 +1473,9 @@
 
 	ps.molog
 		("  Training soldier's %u (%d to %d)",
-		 attribute, level, target_level);
+		 static_cast<unsigned int>(attribute),
+		 static_cast<unsigned int>(level),
+		 static_cast<unsigned int>(target_level));
 
 	for (;; ++it) {
 		if (it == soldiers_end) {

=== modified file 'src/logic/map_objects/tribes/requirements.cc'
--- src/logic/map_objects/tribes/requirements.cc	2016-02-21 19:43:07 +0000
+++ src/logic/map_objects/tribes/requirements.cc	2016-04-01 12:22:40 +0000
@@ -244,11 +244,11 @@
 			(
 			 "expected kHealth (%u), kAttack (%u), kDefense (%u), kEvade "
 			 "(%u) or kTotal (%u) but found unknown attribute value (%u)",
-				TrainingAttribute::kHealth,
-				TrainingAttribute::kAttack,
-				TrainingAttribute::kDefense,
-				TrainingAttribute::kEvade,
-				TrainingAttribute::kTotal,
+				static_cast<unsigned int>(TrainingAttribute::kHealth),
+				static_cast<unsigned int>(TrainingAttribute::kAttack),
+				static_cast<unsigned int>(TrainingAttribute::kDefense),
+				static_cast<unsigned int>(TrainingAttribute::kEvade),
+				static_cast<unsigned int>(TrainingAttribute::kTotal),
 				temp_at);
 	}
 	TrainingAttribute const at  = static_cast<TrainingAttribute>(temp_at);

=== modified file 'src/logic/map_objects/tribes/ship.cc'
--- src/logic/map_objects/tribes/ship.cc	2016-03-21 10:36:49 +0000
+++ src/logic/map_objects/tribes/ship.cc	2016-04-01 12:22:40 +0000
@@ -694,7 +694,10 @@
 		}
 	}
 
-	default: {
+	case ShipStates::kExpeditionWaiting:
+	case ShipStates::kExpeditionPortspaceFound:
+	case ShipStates::kSinkRequest:
+	case ShipStates::kSinkAnimation: {
 		// wait for input
 		start_task_idle(game, descr().main_animation(), 1500);
 		return;
@@ -975,8 +978,6 @@
 		case (ShipStates::kSinkRequest):
 		case (ShipStates::kSinkAnimation):
 			break;
-		default:
-			NEVER_HERE();
 		}
 		statistics_string = (boost::format("<font color=%s>%s</font>")
 									% UI_FONT_CLR_OK.hex_value()
@@ -1006,8 +1007,8 @@
 				 % lastdock_.get(egbase)->get_positions(egbase)[0].y).str().c_str() :
 				"-");
 
-	molog("In state: %d (%s)\n",
-		ship_state_,
+	molog("In state: %u (%s)\n",
+		static_cast<unsigned int>(ship_state_),
 		(expedition_) ? "expedition": "transportation");
 
 	if (destination_.is_set() && get_position().field->get_immovable() == destination_.get(egbase)) {

=== modified file 'src/logic/map_objects/tribes/trainingsite.cc'
--- src/logic/map_objects/tribes/trainingsite.cc	2016-02-17 22:13:21 +0000
+++ src/logic/map_objects/tribes/trainingsite.cc	2016-04-01 12:22:40 +0000
@@ -537,7 +537,9 @@
 				if (tstep ==  training_failure_count_.end())
 					{
 						log("\nTrainingSite::drop_stalled_soldiers: ");
-						log("training step %d,%d not found in this school!\n", upgrade.attribute, level);
+						log("training step %d,%d not found in this school!\n",
+							 static_cast<unsigned int>(upgrade.attribute),
+							 level);
 						break;
 					}
 

=== modified file 'src/logic/single_player_game_settings_provider.cc'
--- src/logic/single_player_game_settings_provider.cc	2016-02-18 18:27:52 +0000
+++ src/logic/single_player_game_settings_provider.cc	2016-04-01 12:22:40 +0000
@@ -166,7 +166,7 @@
 		actual_tribe = s.tribes.at(random).name;
 	}
 
-	for (const TribeBasicInfo tmp_tribe : s.tribes)
+	for (const TribeBasicInfo& tmp_tribe : s.tribes)
 	{
 		if (tmp_tribe.name == player.tribe) {
 			s.players[number].tribe = actual_tribe;
@@ -181,7 +181,7 @@
 	if (number >= s.players.size())
 		return;
 
-	for (const TribeBasicInfo tmp_tribe : s.tribes)
+	for (const TribeBasicInfo& tmp_tribe : s.tribes)
 	{
 		if (tmp_tribe.name == s.players[number].tribe) {
 			if (index < tmp_tribe.initializations.size())

=== modified file 'src/map_io/map_buildingdata_packet.cc'
--- src/map_io/map_buildingdata_packet.cc	2016-03-12 07:07:12 +0000
+++ src/map_io/map_buildingdata_packet.cc	2016-04-01 12:22:40 +0000
@@ -844,11 +844,11 @@
 						(
 						 "expected kHealth (%u), kAttack (%u), kDefense (%u), kEvade "
 						 "(%u) or kTotal (%u) but found unknown attribute value (%u)",
-							TrainingAttribute::kHealth,
-							TrainingAttribute::kAttack,
-							TrainingAttribute::kDefense,
-							TrainingAttribute::kEvade,
-							TrainingAttribute::kTotal,
+							static_cast<unsigned int>(TrainingAttribute::kHealth),
+							static_cast<unsigned int>(TrainingAttribute::kAttack),
+							static_cast<unsigned int>(TrainingAttribute::kDefense),
+							static_cast<unsigned int>(TrainingAttribute::kEvade),
+							static_cast<unsigned int>(TrainingAttribute::kTotal),
 							temp_traintype);
 				}
 				TrainingAttribute traintype  = static_cast<TrainingAttribute>(temp_traintype);

=== modified file 'src/scripting/lua_globals.cc'
--- src/scripting/lua_globals.cc	2015-02-28 17:43:48 +0000
+++ src/scripting/lua_globals.cc	2016-04-01 12:22:40 +0000
@@ -104,7 +104,6 @@
 				case LUA_TTHREAD:
 				case LUA_TLIGHTUSERDATA:
 					report_error(L, "Cannot format the given type %s at index %i", lua_typename(L, i), i);
-					break;
 
 				default:
 					{

=== modified file 'src/scripting/lua_map.cc'
--- src/scripting/lua_map.cc	2016-03-19 12:51:22 +0000
+++ src/scripting/lua_map.cc	2016-04-01 12:22:40 +0000
@@ -345,7 +345,7 @@
 	}
 
 	// The idea is to change as little as possible
-	for (const WorkersMap::value_type sp : setpoints) {
+	for (const WorkersMap::value_type& sp : setpoints) {
 		const WorkerDescr* wdes = tribe.get_worker_descr(sp.first);
 		if (!valid_workers.count(sp.first))
 			report_error(L, "<%s> can't be employed here!", wdes->name().c_str());
@@ -665,7 +665,11 @@
 		return CAST_TO_LUA(MilitarySite);
 	case MapObjectType::TRAININGSITE:
 		return CAST_TO_LUA(TrainingSite);
-
+	case (MapObjectType::MAPOBJECT):
+	case (MapObjectType::BATTLE):
+	case (MapObjectType::BOB):
+	case (MapObjectType::FLEET):
+	case (MapObjectType::WARE):
 	default:
 		throw LuaError((boost::format("upcasted_map_object_to_lua: Unknown %i") %
 		                static_cast<int>(mo->descr().type())).str());
@@ -1539,9 +1543,6 @@
 		break;
 	case MapObjectDescr::OwnerType::kTribe:
 		lua_pushstring(L, "tribe");
-		break;
-	default:
-		NEVER_HERE();
 	}
 	return 1;
 }
@@ -3139,7 +3140,19 @@
 		case (MapObjectType::IMMOVABLE):
 			return CAST_TO_LUA(ImmovableDescr, LuaImmovableDescription);
 		case (MapObjectType::WORKER):
+		case (MapObjectType::CARRIER):
+		case (MapObjectType::SOLDIER):
 			return CAST_TO_LUA(WorkerDescr, LuaWorkerDescription);
+		case (MapObjectType::MAPOBJECT):
+		case (MapObjectType::BATTLE):
+		case (MapObjectType::BOB):
+		case (MapObjectType::CRITTER):
+		case (MapObjectType::FLEET):
+		case (MapObjectType::SHIP):
+		case (MapObjectType::FLAG):
+		case (MapObjectType::ROAD):
+		case (MapObjectType::PORTDOCK):
+		case (MapObjectType::WARE):
 		default:
 			return CAST_TO_LUA(MapObjectDescr, LuaMapObjectDescription);
 	}
@@ -4462,10 +4475,6 @@
 				break;
 			case Ship::ShipStates::kSinkAnimation:
 				lua_pushstring(L, "sink_animation");
-				break;
-			default:
-				lua_pushnil(L);
-				return 0;
 			}
 		return 1;
 	}

=== modified file 'src/sound/sound_handler.cc'
--- src/sound/sound_handler.cc	2016-03-12 07:07:12 +0000
+++ src/sound/sound_handler.cc	2016-04-01 12:22:40 +0000
@@ -506,7 +506,7 @@
  * This just registers the song, actual loading takes place when
  * \ref Songset::get_song() is called, i.e. when the song is about to be
  * played. The song will automatically be removed from memory when it has
- * finished playing.\n
+ * finished playing.
 */
 void SoundHandler::register_song
 	(const std::string & dir, const std::string & basename)
@@ -688,7 +688,7 @@
 }
 
 /** Callback to notify \ref SoundHandler that a song has finished playing.
- * Usually, another song from the same songset will be started.\n
+ * Usually, another song from the same songset will be started.
  * There is a special case for the intro screen's music: only one song will be
  * played. If the user has not clicked the mouse or pressed escape when the song
  * finishes, Widelands will automatically go on to the main menu.

=== modified file 'src/ui_basic/box.cc'
--- src/ui_basic/box.cc	2016-03-25 17:01:05 +0000
+++ src/ui_basic/box.cc	2016-04-01 12:22:40 +0000
@@ -390,11 +390,6 @@
 			maxbreadth = get_inner_w();
 		}
 		switch (it.u.panel.align) {
-		case UI::Align::kLeft:
-		default:
-			breadth = 0;
-			break;
-
 		case UI::Align::kHCenter:
 			breadth = (maxbreadth - breadth) / 2;
 			break;
@@ -402,6 +397,9 @@
 		case UI::Align::kRight:
 			breadth = maxbreadth - breadth;
 			break;
+		case UI::Align::kLeft:
+		default:
+			breadth = 0;
 		}
 
 		if (orientation_ == Horizontal)

=== modified file 'src/ui_basic/editbox.cc'
--- src/ui_basic/editbox.cc	2016-03-10 15:00:32 +0000
+++ src/ui_basic/editbox.cc	2016-04-01 12:22:40 +0000
@@ -470,7 +470,6 @@
 		break;
 	default:
 		caretpos = kMargin + m_->scrolloffset + leftw;
-		break;
 	}
 
 	if (caretpos < kMargin)

=== modified file 'src/ui_basic/multilinetextarea.cc'
--- src/ui_basic/multilinetextarea.cc	2016-03-25 17:01:05 +0000
+++ src/ui_basic/multilinetextarea.cc	2016-04-01 12:22:40 +0000
@@ -163,7 +163,6 @@
 				break;
 			default:
 				anchor = RICHTEXT_MARGIN;
-				break;
 			}
 
 			dst.blitrect_scale(

=== modified file 'src/ui_basic/multilinetextarea.h'
--- src/ui_basic/multilinetextarea.h	2016-03-25 17:01:05 +0000
+++ src/ui_basic/multilinetextarea.h	2016-04-01 12:22:40 +0000
@@ -74,7 +74,7 @@
 
 	/**
 	 * This prepares a non-richtext text for rendering. It escapes the source text and
-	 * turns \n into <br> tags as needed, then creates the richtext style wrappers.
+	 * turns '\\n' into '<br>' tags as needed, then creates the richtext style wrappers.
 	 */
 	std::string make_richtext();
 

=== modified file 'src/ui_basic/progresswindow.cc'
--- src/ui_basic/progresswindow.cc	2016-03-02 17:11:16 +0000
+++ src/ui_basic/progresswindow.cc	2016-04-01 12:22:40 +0000
@@ -126,21 +126,6 @@
 
 }
 
-/**
- * Display a loader step description
- * std:string style format broke format argument list
- * on windows visual studio.
- */
-// TODO(sirver): this should just take a string.
-void ProgressWindow::stepf(const char * format, ...) {
-	char buffer[1024];
-	va_list va;
-	va_start(va, format);
-	vsnprintf(buffer, sizeof(buffer), format, va);
-	va_end(va);
-	step (buffer);
-}
-
 /// Register additional visualization (tips/hints, animation, etc)
 void ProgressWindow::add_visualization(IProgressVisualization * const instance)
 {

=== modified file 'src/ui_basic/progresswindow.h'
--- src/ui_basic/progresswindow.h	2016-02-03 18:09:15 +0000
+++ src/ui_basic/progresswindow.h	2016-04-01 12:22:40 +0000
@@ -58,7 +58,6 @@
 
 	/// Display a progress step description.
 	void step(const std::string & description);
-	void stepf(char const * format, ...);
 
 private:
 	using VisualizationArray = std::vector<IProgressVisualization *>;

=== modified file 'src/ui_basic/spinbox.cc'
--- src/ui_basic/spinbox.cc	2016-03-28 10:54:16 +0000
+++ src/ui_basic/spinbox.cc	2016-04-01 12:22:40 +0000
@@ -26,6 +26,7 @@
 
 #include "base/i18n.h"
 #include "base/log.h"
+#include "base/macros.h"
 #include "base/wexception.h"
 #include "graphic/font_handler1.h"
 #include "graphic/text/font_set.h"

=== modified file 'src/ui_fsmenu/launch_mpg.cc'
--- src/ui_fsmenu/launch_mpg.cc	2016-03-28 10:37:09 +0000
+++ src/ui_fsmenu/launch_mpg.cc	2016-04-01 12:22:40 +0000
@@ -318,7 +318,7 @@
 			std::unique_ptr<Widelands::MapLoader> ml =
 					map.get_correct_loader(settings_->settings().mapfilename);
 			ml->preload_map(true);
-			for (const std::string map_tag : t->get_table("map_tags")->array_entries<std::string>()) {
+			for (const std::string& map_tag : t->get_table("map_tags")->array_entries<std::string>()) {
 				if (!map.has_tag(map_tag)) {
 					is_usable = false;
 					break;

=== modified file 'src/ui_fsmenu/launch_spg.cc'
--- src/ui_fsmenu/launch_spg.cc	2016-02-07 16:31:06 +0000
+++ src/ui_fsmenu/launch_spg.cc	2016-04-01 12:22:40 +0000
@@ -263,7 +263,7 @@
 			std::unique_ptr<Widelands::MapLoader> ml =
 					map.get_correct_loader(settings_->settings().mapfilename);
 			ml->preload_map(true);
-			for (const std::string map_tag : t->get_table("map_tags")->array_entries<std::string>()) {
+			for (const std::string& map_tag : t->get_table("map_tags")->array_entries<std::string>()) {
 				if (!map.has_tag(map_tag)) {
 					is_usable = false;
 					break;

=== modified file 'src/wlapplication.cc'
--- src/wlapplication.cc	2016-02-22 07:36:10 +0000
+++ src/wlapplication.cc	2016-04-01 12:22:40 +0000
@@ -1042,8 +1042,8 @@
 			case FullscreenMenuBase::MenuTarget::kEditor:
 				EditorInteractive::run_editor(filename_, script_to_run_);
 				break;
-			default:
 			case FullscreenMenuBase::MenuTarget::kExit:
+			default:
 				return;
 			}
 		} catch (const WLWarning & e) {


Follow ups