← Back to team overview

widelands-dev team mailing list archive

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

 

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

Requested reviews:
  SirVer (sirver)
Related bugs:
  Bug #1375579 in widelands: "Code cleanup: get rid of "using namespace""
  https://bugs.launchpad.net/widelands/+bug/1375579

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

Removed "using namespace" statements from header files.

I have a NOCOM comment; once this is addressed, I could add a CodeCheck rule.
-- 
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1375579.
=== modified file 'src/graphic/gl/system_headers.h'
--- src/graphic/gl/system_headers.h	2015-03-01 09:21:20 +0000
+++ src/graphic/gl/system_headers.h	2015-07-28 07:15:08 +0000
@@ -38,6 +38,7 @@
 #ifdef USE_GLBINDING
 #   include <glbinding/gl/gl.h>
 #   include <glbinding/Binding.h>
+// NOCOM(GunChleoc): Can this go? I could compile and run without this, but I don't know if I'm reaching this part of the code on my machine.
 using namespace gl;
 #else
 #   include <GL/glew.h>

=== modified file 'src/wui/building_statistics_menu.cc'
--- src/wui/building_statistics_menu.cc	2015-06-08 15:11:05 +0000
+++ src/wui/building_statistics_menu.cc	2015-07-28 07:15:08 +0000
@@ -44,6 +44,8 @@
 
 constexpr int32_t kUpdateTime = 1000;  //  1 second, gametime
 
+using namespace Widelands;
+
 namespace {
 void set_label_font(UI::Textarea* label) {
 	label->set_font(UI::g_fh1->fontset().serif(), kLabelFontSize, UI_FONT_CLR_FG);

=== modified file 'src/wui/building_statistics_menu.h'
--- src/wui/building_statistics_menu.h	2015-06-03 10:10:15 +0000
+++ src/wui/building_statistics_menu.h	2015-07-28 07:15:08 +0000
@@ -34,8 +34,6 @@
 #include "ui_basic/unique_window.h"
 #include "wui/interactive_player.h"
 
-using namespace Widelands;
-
 namespace {
 
 constexpr int kNoOfBuildingTabs = 5;
@@ -71,7 +69,7 @@
 	/// Adds a button for the building type belonging to the id and descr to the tab.
 	/// Returns true when a new row needs to be created.
 	bool add_button(
-	   BuildingIndex id, const BuildingDescr& descr, int tab_index, UI::Box& row, int* column);
+		Widelands::BuildingIndex id, const Widelands::BuildingDescr& descr, int tab_index, UI::Box& row, int* column);
 
 	/// Jumps to the next / previous appropriate building
 	void jump_building(JumpTarget target, bool reverse);
@@ -82,7 +80,7 @@
 	                            const RGBColor& color);
 
 	/// Sets the current building type for the bottom navigation
-	void set_current_building_type(BuildingIndex id);
+	void set_current_building_type(Widelands::BuildingIndex id);
 
 	/// Change the percentage where buildings are deemed unproductive
 	void low_production_changed();
@@ -123,11 +121,11 @@
 	UI::Textarea no_unproductive_label_;
 
 	/// The building type we are currently navigating
-	BuildingIndex current_building_type_;
+	Widelands::BuildingIndex current_building_type_;
 	/// The last building that was jumped to
 	int32_t last_building_index_;
 	/// The type of last building that was jumped to
-	BuildingIndex last_building_type_;
+	Widelands::BuildingIndex last_building_type_;
 	/// The last time the information in this Panel got updated
 	uint32_t lastupdate_;
 


Follow ups