← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/include_order_fixes into lp:widelands

 

SirVer has proposed merging lp:~widelands-dev/widelands/include_order_fixes into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

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

This is not really a proposal for merging but rather a request for help. Doing all those code reviews lately made me realize how terrible fragmented our code base is and that we really should force a unique style through codechecks more aggressively - this is a push starting to fix one thing at a time. Here we start out with include orderings.

This introduces a new code checking rule that tries to unify the way includes are handled. They should always be 

#include "file.h"  // if we are in file.cc and file.h exists

#include <memory>  // and other cxx headers, sorted

#include <stdint.h>  // and other c headers or library headers, sorted

#include "widelands.h"  // and all other widelands headers sorted.


I am not sure if there are places where we cannot apply this ruleset in the codebase, but there are plenty where we could but currently do not. Please help me by fixing the many places where the headers are out of order currently - just contribute a commit or two fixing a bunch of files and I'll be a happy camper. Also bug reports in the rule would be appreciated.

-- 
https://code.launchpad.net/~widelands-dev/widelands/include_order_fixes/+merge/177045
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/include_order_fixes into lp:widelands.
=== added file 'cmake/codecheck/rules/correct_include_order'
--- cmake/codecheck/rules/correct_include_order	1970-01-01 00:00:00 +0000
+++ cmake/codecheck/rules/correct_include_order	2013-07-25 21:12:27 +0000
@@ -0,0 +1,104 @@
+#!/usr/bin/python -tt
+
+import re
+import os
+import sys
+
+class EvalMatches( object ):
+    _include_regexp = re.compile(r'^#include *([<"])([^">]+)[>"]')
+
+    def __call__(self, lines, fn):
+        blocks = []
+
+        cur_block = []
+        for lineno, line in enumerate(lines, 1):
+            m = self._include_regexp.match(line)
+            if m:
+                cur_block.append((lineno, m.group(1), m.group(2)))
+            elif line.startswith('#'):
+                continue
+            elif cur_block:
+                blocks.append(cur_block)
+                cur_block = []
+        if cur_block:
+            blocks.append(cur_block)
+
+        errors = []
+
+        for block in blocks:
+            includes = [entry[2] for entry in block]
+            delims = set(entry[1] for entry in block)
+            if len(delims) != 1:
+                errors.append((fn, block[0][0], """Use either '"' or '<' for all includes in a block."""))
+            if sorted(includes) != includes:
+                errors.append((fn, block[0][0], "Include block is not sorted alphabetically."))
+                return errors
+
+        if ".cc" in fn:
+            base_file = os.path.basename(fn)[:-3]
+            if len(blocks[0]) != 1 or base_file != blocks[0][0][2][:-2]:
+                if os.path.exists(os.path.abspath(fn)[:-3] + '.h'):
+                    errors.append((fn, blocks[0][0][0], "In a .cc file, include the corresponding header first in a line of its own it exists."))
+                return errors
+            else:
+                blocks.pop(0)
+
+        if blocks:
+            if blocks[0][0][1] == "<" and ".h" not in blocks[0][0][2]:  # cxx includes.
+                for lineno, delimiter, header in blocks[0]:
+                    if '.h' in header or delimiter != "<":
+                        errors.append((fn, lineno, "This include block must only contain C++ headers and must come first."))
+                        return errors
+                blocks.pop(0)
+
+        if blocks and blocks[0][0][1] == "<":  # library includes.
+            for lineno, delimiter, header in blocks[0]:
+                if '.h' not in header or delimiter != "<":
+                    errors.append((fn, lineno, "This include block must only contain library headers (e.g. SDL)."))
+                    return errors
+            blocks.pop(0)
+
+        if blocks:  # Widelands includes.
+            for lineno, delimiter, header in blocks[0]:
+                if not header.endswith('.h') or delimiter != '"':
+                    errors.append((fn, lineno, "This include block must contain all Widelands includes and must come last."))
+                    return errors
+            blocks.pop(0)
+
+        if blocks:
+            errors.append((fn, blocks[0][0][0], """Unexpected include block after Widelands includes. Ordering of blocks should be <file.h>, c++, libraries then Widelands includes."""))
+        return errors
+
+
+strip_comments_and_strings = False
+
+evaluate_matches = EvalMatches()
+
+
+#################
+# ALLOWED TESTS #
+#################
+allowed = [
+"""#include <memory>
+
+#include <SDL.h>
+"""
+]
+
+
+###################
+# FORBIDDEN TESTS #
+###################
+forbidden = [
+"""
+#include <SDL.h>
+
+#include <memory>
+""",
+
+"""
+#include <memory>
+#include <SDL.h>
+"""
+]
+

=== modified file 'src/economy/economy_data_packet.cc'
--- src/economy/economy_data_packet.cc	2013-02-10 19:36:24 +0000
+++ src/economy/economy_data_packet.cc	2013-07-25 21:12:27 +0000
@@ -20,12 +20,10 @@
 #include "economy_data_packet.h"
 
 #include "economy.h"
+#include "logic/player.h"
+#include "logic/tribe.h"
+#include "map_io/widelands_map_map_object_loader.h"
 #include "map_io/widelands_map_map_object_saver.h"
-#include "map_io/widelands_map_map_object_loader.h"
-
-#include "logic/tribe.h"
-#include "logic/player.h"
-
 
 #define CURRENT_ECONOMY_VERSION 3
 

=== modified file 'src/economy/flag.cc'
--- src/economy/flag.cc	2013-07-21 08:25:22 +0000
+++ src/economy/flag.cc	2013-07-25 21:12:27 +0000
@@ -19,24 +19,22 @@
 
 #include "flag.h"
 
-// Package includes
-#include "portdock.h"
-#include "road.h"
+#include "container_iterate.h"
 #include "economy.h"
-#include "ware_instance.h"
-
 #include "logic/building.h"
 #include "logic/editor_game_base.h"
 #include "logic/game.h"
 #include "logic/instances.h"
 #include "logic/player.h"
+#include "logic/tribe.h"
+#include "logic/warehouse.h"
+#include "logic/worker.h"
+#include "portdock.h"
 #include "request.h"
-#include "logic/tribe.h"
+#include "road.h"
 #include "upcast.h"
+#include "ware_instance.h"
 #include "wexception.h"
-#include "logic/warehouse.h"
-#include "logic/worker.h"
-#include "container_iterate.h"
 
 namespace Widelands {
 

=== modified file 'src/economy/flag.h'
--- src/economy/flag.h	2013-07-14 10:38:26 +0000
+++ src/economy/flag.h	2013-07-25 21:12:27 +0000
@@ -20,8 +20,8 @@
 #ifndef FLAG_H
 #define FLAG_H
 
+#include <list>
 #include <vector>
-#include <list>
 
 #include "logic/immovable.h"
 #include "routing_node.h"

=== modified file 'src/economy/request.cc'
--- src/economy/request.cc	2013-04-22 20:15:00 +0000
+++ src/economy/request.cc	2013-07-25 21:12:27 +0000
@@ -19,23 +19,21 @@
 
 #include "request.h"
 
-// Package includes
 #include "economy.h"
-#include "transfer.h"
-#include "ware_instance.h"
-
 #include "logic/constructionsite.h"
 #include "logic/game.h"
+#include "logic/legacy.h"
 #include "logic/player.h"
 #include "logic/productionsite.h"
 #include "logic/soldier.h"
 #include "logic/tribe.h"
-#include "upcast.h"
+#include "logic/warehouse.h"
+#include "logic/worker.h"
 #include "map_io/widelands_map_map_object_loader.h"
 #include "map_io/widelands_map_map_object_saver.h"
-#include "logic/legacy.h"
-#include "logic/warehouse.h"
-#include "logic/worker.h"
+#include "transfer.h"
+#include "upcast.h"
+#include "ware_instance.h"
 
 
 namespace Widelands {

=== modified file 'src/economy/request.h'
--- src/economy/request.h	2013-04-22 20:15:00 +0000
+++ src/economy/request.h	2013-07-25 21:12:27 +0000
@@ -21,11 +21,11 @@
 #define REQUEST_H
 
 #include "logic/requirements.h"
-#include "trackptr.h"
 #include "logic/wareworker.h"
 #include "logic/widelands.h"
 #include "logic/widelands_fileread.h"
 #include "logic/widelands_filewrite.h"
+#include "trackptr.h"
 
 namespace Widelands {
 

=== modified file 'src/economy/route.h'
--- src/economy/route.h	2013-02-10 19:36:24 +0000
+++ src/economy/route.h	2013-07-25 21:12:27 +0000
@@ -22,11 +22,9 @@
 
 #include <vector>
 
-// Needed for OPtr
+#include "iroute.h"
 #include "logic/instances.h"
 
-#include "iroute.h"
-
 
 namespace Widelands {
 

=== modified file 'src/economy/routeastar.cc'
--- src/economy/routeastar.cc	2011-11-30 21:38:37 +0000
+++ src/economy/routeastar.cc	2013-07-25 21:12:27 +0000
@@ -19,8 +19,8 @@
 
 #include "routeastar.h"
 
+#include "iroute.h"
 #include "router.h"
-#include "iroute.h"
 
 namespace Widelands {
 

=== modified file 'src/economy/router.cc'
--- src/economy/router.cc	2012-02-15 21:25:34 +0000
+++ src/economy/router.cc	2013-07-25 21:12:27 +0000
@@ -19,15 +19,15 @@
 
 #include "router.h"
 
-#include "routeastar.h"
-#include "routing_node.h"
-#include "iroute.h"
-#include "itransport_cost_calculator.h"
-
 #include <cassert>
 #include <cstdio>
 #include <cstdlib>
 
+#include "iroute.h"
+#include "itransport_cost_calculator.h"
+#include "routeastar.h"
+#include "routing_node.h"
+
 namespace Widelands {
 
 /*************************************************************************/

=== modified file 'src/economy/test/test_economy.cc'
--- src/economy/test/test_economy.cc	2012-02-15 21:25:34 +0000
+++ src/economy/test/test_economy.cc	2013-07-25 21:12:27 +0000
@@ -18,6 +18,7 @@
  */
 
 #include <exception>
+
 #include <boost/test/unit_test.hpp>
 
 

=== modified file 'src/editor/editorinteractive.cc'
--- src/editor/editorinteractive.cc	2013-07-21 08:27:10 +0000
+++ src/editor/editorinteractive.cc	2013-07-25 21:12:27 +0000
@@ -19,6 +19,8 @@
 
 #include "editorinteractive.h"
 
+#include <SDL_keysym.h>
+
 #include "graphic/graphic.h"
 #include "i18n.h"
 #include "logic/map.h"
@@ -42,7 +44,6 @@
 #include "wui/interactive_base.h"
 #include "wui/overlay_manager.h"
 
-#include <SDL_keysym.h>
 
 using Widelands::Building;
 

=== modified file 'src/editor/editorinteractive.h'
--- src/editor/editorinteractive.h	2013-05-20 19:40:13 +0000
+++ src/editor/editorinteractive.h	2013-07-25 21:12:27 +0000
@@ -20,10 +20,7 @@
 #ifndef EDITORINTERACTIVE_H
 #define EDITORINTERACTIVE_H
 
-#include "ui_basic/button.h"
-#include "ui_basic/unique_window.h"
-#include "wui/interactive_base.h"
-
+#include "tools/editor_history.h"
 #include "tools/editor_increase_height_tool.h"
 #include "tools/editor_increase_resources_tool.h"
 #include "tools/editor_info_tool.h"
@@ -35,8 +32,9 @@
 #include "tools/editor_set_port_space_tool.h"
 #include "tools/editor_set_starting_pos_tool.h"
 #include "tools/editor_set_terrain_tool.h"
-#include "tools/editor_history.h"
-
+#include "ui_basic/button.h"
+#include "ui_basic/unique_window.h"
+#include "wui/interactive_base.h"
 
 class Editor;
 class Editor_Tool;

=== modified file 'src/editor/tools/editor_decrease_resources_tool.h'
--- src/editor/tools/editor_decrease_resources_tool.h	2012-02-21 13:52:14 +0000
+++ src/editor/tools/editor_decrease_resources_tool.h	2013-07-25 21:12:27 +0000
@@ -21,7 +21,6 @@
 #define EDITOR_DECREASE_RESOURCES_TOOL_H
 
 #include "editor_tool.h"
-
 #include "logic/world.h"
 
 ///  Decreases the resources of a node by a value.

=== modified file 'src/editor/tools/editor_delete_immovable_tool.cc'
--- src/editor/tools/editor_delete_immovable_tool.cc	2012-02-21 13:52:14 +0000
+++ src/editor/tools/editor_delete_immovable_tool.cc	2013-07-25 21:12:27 +0000
@@ -19,11 +19,10 @@
 
 #include "editor_delete_immovable_tool.h"
 
+#include "editor/editorinteractive.h"
 #include "logic/field.h"
-#include "editor/editorinteractive.h"
 #include "logic/immovable.h"
 #include "logic/mapregion.h"
-
 #include "upcast.h"
 
 /**

=== modified file 'src/editor/tools/editor_history.cc'
--- src/editor/tools/editor_history.cc	2012-09-21 21:36:07 +0000
+++ src/editor/tools/editor_history.cc	2013-07-25 21:12:27 +0000
@@ -17,11 +17,12 @@
  *
  */
 
+#include <string>
+
+#include "editor/editorinteractive.h"
+#include "editor_action_args.h"
 #include "editor_history.h"
 #include "editor_tool_action.h"
-#include "editor_action_args.h"
-#include "editor/editorinteractive.h"
-#include <string>
 
 // === Editor_Action_Args === //
 

=== modified file 'src/editor/tools/editor_history.h'
--- src/editor/tools/editor_history.h	2012-02-21 13:52:14 +0000
+++ src/editor/tools/editor_history.h	2013-07-25 21:12:27 +0000
@@ -22,8 +22,8 @@
 
 #include <deque>
 
+#include "editor_draw_tool.h"
 #include "editor_tool.h"
-#include "editor_draw_tool.h"
 
 //struct Editor_Action_Args;
 struct Editor_Interactive;

=== modified file 'src/editor/tools/editor_increase_resources_tool.cc'
--- src/editor/tools/editor_increase_resources_tool.cc	2013-02-10 19:36:24 +0000
+++ src/editor/tools/editor_increase_resources_tool.cc	2013-07-25 21:12:27 +0000
@@ -20,12 +20,12 @@
 #include "editor_increase_resources_tool.h"
 
 #include "editor/editorinteractive.h"
+#include "graphic/graphic.h"
 #include "logic/field.h"
-#include "graphic/graphic.h"
 #include "logic/mapregion.h"
 #include "logic/world.h"
+#include "logic/worlddata.h"
 #include "wui/overlay_manager.h"
-#include "logic/worlddata.h"
 
 using Widelands::TCoords;
 

=== modified file 'src/editor/tools/editor_place_immovable_tool.h'
--- src/editor/tools/editor_place_immovable_tool.h	2012-02-21 13:52:14 +0000
+++ src/editor/tools/editor_place_immovable_tool.h	2013-07-25 21:12:27 +0000
@@ -20,8 +20,8 @@
 #ifndef EDITOR_PLACE_IMMOVABLE_TOOL_H
 #define EDITOR_PLACE_IMMOVABLE_TOOL_H
 
+#include "editor_delete_immovable_tool.h"
 #include "multi_select.h"
-#include "editor_delete_immovable_tool.h"
 
 /**
  * This places immovables on the map

=== modified file 'src/editor/tools/editor_set_resources_tool.cc'
--- src/editor/tools/editor_set_resources_tool.cc	2013-02-10 19:36:24 +0000
+++ src/editor/tools/editor_set_resources_tool.cc	2013-07-25 21:12:27 +0000
@@ -19,12 +19,12 @@
 
 #include "editor_set_resources_tool.h"
 
+#include "editor/editorinteractive.h"
+#include "editor_decrease_resources_tool.h"
 #include "editor_increase_resources_tool.h"
-#include "editor_decrease_resources_tool.h"
 #include "graphic/graphic.h"
+#include "logic/field.h"
 #include "logic/mapregion.h"
-#include "logic/field.h"
-#include "editor/editorinteractive.h"
 #include "logic/world.h"
 #include "wui/overlay_manager.h"
 

=== modified file 'src/editor/ui_menus/editor_main_menu_map_options.cc'
--- src/editor/ui_menus/editor_main_menu_map_options.cc	2013-02-10 19:36:24 +0000
+++ src/editor/ui_menus/editor_main_menu_map_options.cc	2013-07-25 21:12:27 +0000
@@ -19,18 +19,18 @@
 
 #include "editor_main_menu_map_options.h"
 
+#include <cstdio>
+
 #include "editor/editorinteractive.h"
 #include "graphic/graphic.h"
 #include "i18n.h"
 #include "logic/map.h"
 #include "profile/profile.h"
-
+#include "ui_basic/editbox.h"
+#include "ui_basic/multilineeditbox.h"
+#include "ui_basic/multilinetextarea.h"
 #include "ui_basic/textarea.h"
-#include "ui_basic/multilinetextarea.h"
-#include "ui_basic/multilineeditbox.h"
-#include "ui_basic/editbox.h"
 
-#include <cstdio>
 
 inline Editor_Interactive & Main_Menu_Map_Options::eia() {
 	return ref_cast<Editor_Interactive, UI::Panel>(*get_parent());

=== modified file 'src/editor/ui_menus/editor_main_menu_new_map.h'
--- src/editor/ui_menus/editor_main_menu_new_map.h	2012-02-15 21:25:34 +0000
+++ src/editor/ui_menus/editor_main_menu_new_map.h	2013-07-25 21:12:27 +0000
@@ -20,10 +20,10 @@
 #ifndef EDITOR_MAIN_MENU_NEW_MAP_H
 #define EDITOR_MAIN_MENU_NEW_MAP_H
 
+#include <vector>
+
 #include "ui_basic/window.h"
 
-#include <vector>
-
 struct Editor_Interactive;
 namespace UI {
 struct Button;

=== modified file 'src/editor/ui_menus/editor_main_menu_random_map.cc'
--- src/editor/ui_menus/editor_main_menu_random_map.cc	2013-07-12 15:11:32 +0000
+++ src/editor/ui_menus/editor_main_menu_random_map.cc	2013-07-25 21:12:27 +0000
@@ -19,27 +19,25 @@
 
 #include "editor_main_menu_random_map.h"
 
+#include <cstring>
+#include <sstream>
+#include <string>
+#include <vector>
+
+#include "editor/editorinteractive.h"
 #include "graphic/graphic.h"
 #include "i18n.h"
-#include "editor/editorinteractive.h"
+#include "logic/editor_game_base.h"
 #include "logic/map.h"
+#include "logic/world.h"
+#include "map_generator.h"
 #include "profile/profile.h"
-#include "logic/world.h"
-#include "logic/editor_game_base.h"
-
+#include "random.h"
 #include "ui_basic/button.h"
 #include "ui_basic/progresswindow.h"
 #include "ui_basic/textarea.h"
 #include "ui_basic/window.h"
 
-#include <string>
-#include <cstring>
-#include <vector>
-#include <sstream>
-#include "map_generator.h"
-
-#include "random.h"
-
 using namespace Widelands;
 
 Main_Menu_New_Random_Map::Main_Menu_New_Random_Map

=== modified file 'src/editor/ui_menus/editor_main_menu_random_map.h'
--- src/editor/ui_menus/editor_main_menu_random_map.h	2012-02-15 21:25:34 +0000
+++ src/editor/ui_menus/editor_main_menu_random_map.h	2013-07-25 21:12:27 +0000
@@ -20,11 +20,11 @@
 #ifndef EDITOR_MAIN_MENU_RANDOM_MAP_H
 #define EDITOR_MAIN_MENU_RANDOM_MAP_H
 
+#include <vector>
+
+#include "ui_basic/checkbox.h"
+#include "ui_basic/editbox.h"
 #include "ui_basic/window.h"
-#include "ui_basic/editbox.h"
-#include "ui_basic/checkbox.h"
-
-#include <vector>
 
 namespace Widelands {
 	struct UniqueRandomMapInfo;

=== modified file 'src/editor/ui_menus/editor_player_menu.h'
--- src/editor/ui_menus/editor_player_menu.h	2013-01-16 22:51:07 +0000
+++ src/editor/ui_menus/editor_player_menu.h	2013-07-25 21:12:27 +0000
@@ -20,16 +20,15 @@
 #ifndef EDITOR_PLAYER_MENU_H
 #define EDITOR_PLAYER_MENU_H
 
+#include <cstring>
+#include <string>
+#include <vector>
+
 #include "constants.h"
-
 #include "logic/widelands.h"
-
 #include "ui_basic/button.h"
 #include "ui_basic/unique_window.h"
 
-#include <string>
-#include <cstring>
-#include <vector>
 
 struct Editor_Interactive;
 namespace UI {

=== modified file 'src/editor/ui_menus/editor_tool_noise_height_options_menu.h'
--- src/editor/ui_menus/editor_tool_noise_height_options_menu.h	2012-02-15 21:25:34 +0000
+++ src/editor/ui_menus/editor_tool_noise_height_options_menu.h	2013-07-25 21:12:27 +0000
@@ -21,7 +21,6 @@
 #define EDITOR_TOOL_NOISE_HEIGHT_OPTIONS_MENU_H
 
 #include "editor_tool_options_menu.h"
-
 #include "ui_basic/button.h"
 #include "ui_basic/textarea.h"
 

=== modified file 'src/editor/ui_menus/editor_tool_place_bob_options_menu.cc'
--- src/editor/ui_menus/editor_tool_place_bob_options_menu.cc	2013-07-21 08:25:22 +0000
+++ src/editor/ui_menus/editor_tool_place_bob_options_menu.cc	2013-07-25 21:12:27 +0000
@@ -19,24 +19,23 @@
 
 #include "editor_tool_place_bob_options_menu.h"
 
-#include "logic/critter_bob.h"
+#include <SDL_keysym.h>
+
+#include "editor/editorinteractive.h"
 #include "editor/tools/editor_place_bob_tool.h"
-#include "editor/editorinteractive.h"
 #include "graphic/graphic.h"
 #include "i18n.h"
+#include "logic/critter_bob.h"
 #include "logic/map.h"
-#include "wlapplication.h"
 #include "logic/world.h"
-
 #include "ui_basic/box.h"
 #include "ui_basic/button.h"
 #include "ui_basic/checkbox.h"
 #include "ui_basic/tabpanel.h"
 #include "ui_basic/textarea.h"
-
 #include "upcast.h"
+#include "wlapplication.h"
 
-#include <SDL_keysym.h>
 
 Editor_Tool_Place_Bob_Options_Menu::Editor_Tool_Place_Bob_Options_Menu
 	(Editor_Interactive         & parent,

=== modified file 'src/editor/ui_menus/editor_toolsize_menu.cc'
--- src/editor/ui_menus/editor_toolsize_menu.cc	2013-02-09 23:36:30 +0000
+++ src/editor/ui_menus/editor_toolsize_menu.cc	2013-07-25 21:12:27 +0000
@@ -18,12 +18,13 @@
  */
 
 #include "editor_toolsize_menu.h"
+
+#include <cstdio>
+
 #include "editor/editorinteractive.h"
+#include "editor/tools/editor_tool.h"
 #include "graphic/graphic.h"
 #include "i18n.h"
-#include "editor/tools/editor_tool.h"
-
-#include <cstdio>
 
 inline Editor_Interactive & Editor_Toolsize_Menu::eia() {
 	return ref_cast<Editor_Interactive, UI::Panel>(*get_parent());

=== modified file 'src/game_io/game_interactive_player_data_packet.cc'
--- src/game_io/game_interactive_player_data_packet.cc	2013-02-10 19:36:24 +0000
+++ src/game_io/game_interactive_player_data_packet.cc	2013-07-25 21:12:27 +0000
@@ -21,13 +21,13 @@
 
 #include "logic/game.h"
 #include "logic/game_data_error.h"
-#include "wui/interactive_player.h"
-#include "wui/mapview.h"
-#include "wui/overlay_manager.h"
 #include "logic/player.h"
 #include "logic/tribe.h"
 #include "logic/widelands_fileread.h"
 #include "logic/widelands_filewrite.h"
+#include "wui/interactive_player.h"
+#include "wui/mapview.h"
+#include "wui/overlay_manager.h"
 
 namespace Widelands {
 

=== modified file 'src/game_io/game_loader.cc'
--- src/game_io/game_loader.cc	2013-07-14 11:48:13 +0000
+++ src/game_io/game_loader.cc	2013-07-25 21:12:27 +0000
@@ -19,21 +19,20 @@
 
 #include "game_loader.h"
 
-#include "io/filesystem/layered_filesystem.h"
-#include "logic/cmd_expire_message.h"
-#include "logic/game.h"
-#include "logic/player.h"
 #include "game_cmd_queue_data_packet.h"
 #include "game_game_class_data_packet.h"
+#include "game_interactive_player_data_packet.h"
 #include "game_map_data_packet.h"
-#include "game_preload_data_packet.h"
-#include "game_interactive_player_data_packet.h"
 #include "game_player_economies_data_packet.h"
 #include "game_player_info_data_packet.h"
+#include "game_preload_data_packet.h"
+#include "io/filesystem/layered_filesystem.h"
+#include "log.h"
+#include "logic/cmd_expire_message.h"
+#include "logic/game.h"
+#include "logic/player.h"
 #include "map_io/widelands_map_map_object_loader.h"
 
-#include "log.h"
-
 namespace Widelands {
 
 Game_Loader::Game_Loader(const std::string & path, Game & game) :

=== modified file 'src/game_io/game_loader.h'
--- src/game_io/game_loader.h	2013-02-10 19:36:24 +0000
+++ src/game_io/game_loader.h	2013-07-25 21:12:27 +0000
@@ -20,8 +20,9 @@
 #ifndef GAME_LOADER_H
 #define GAME_LOADER_H
 
+#include <string>
+
 #include <stdint.h>
-#include <string>
 
 class FileSystem;
 

=== modified file 'src/game_io/game_preload_data_packet.h'
--- src/game_io/game_preload_data_packet.h	2013-07-16 15:08:43 +0000
+++ src/game_io/game_preload_data_packet.h	2013-07-25 21:12:27 +0000
@@ -20,11 +20,11 @@
 #ifndef GAME_PRELOAD_DATA_PACKET_H
 #define GAME_PRELOAD_DATA_PACKET_H
 
+#include <cstring>
+#include <string>
+
 #include "game_data_packet.h"
 
-#include <string>
-#include <cstring>
-
 namespace Widelands {
 
 /**

=== modified file 'src/gamecontroller.h'
--- src/gamecontroller.h	2013-01-19 11:56:26 +0000
+++ src/gamecontroller.h	2013-07-25 21:12:27 +0000
@@ -20,10 +20,10 @@
 #ifndef GAMECONTROLLER_H
 #define GAMECONTROLLER_H
 
+#include <string>
+
 #include "logic/widelands.h"
 
-#include <string>
-
 namespace Widelands {
 struct Game;
 class PlayerCommand;

=== modified file 'src/graphic/font_handler1.cc'
--- src/graphic/font_handler1.cc	2013-07-21 08:07:18 +0000
+++ src/graphic/font_handler1.cc	2013-07-25 21:12:27 +0000
@@ -17,23 +17,23 @@
  *
  */
 
+#include "font_handler1.h"
+
 #include <boost/lexical_cast.hpp>
 #include <boost/utility.hpp>
 
-#include "io/filesystem/filesystem.h"
-#include "wexception.h"
-
 #include "graphic.h"
 #include "image.h"
 #include "image_cache.h"
+#include "io/filesystem/filesystem.h"
 #include "rendertarget.h"
 #include "surface.h"
 #include "surface_cache.h"
 #include "text/rt_errors.h"
 #include "text/rt_render.h"
 #include "text/sdl_ttf_font.h"
+#include "wexception.h"
 
-#include "font_handler1.h"
 
 using namespace std;
 using namespace boost;

=== modified file 'src/graphic/font_handler1.h'
--- src/graphic/font_handler1.h	2013-02-10 14:37:59 +0000
+++ src/graphic/font_handler1.h	2013-07-25 21:12:27 +0000
@@ -24,8 +24,8 @@
 
 #include <boost/noncopyable.hpp>
 
+#include "align.h"
 #include "point.h"
-#include "align.h"
 
 class FileSystem;
 class Image;

=== modified file 'src/graphic/graphic.cc'
--- src/graphic/graphic.cc	2013-07-23 18:04:32 +0000
+++ src/graphic/graphic.cc	2013-07-25 21:12:27 +0000
@@ -17,43 +17,42 @@
  *
  */
 
+#include "graphic.h"
+
 #include <cstring>
 #include <iostream>
 
+#include <SDL_image.h>
 #include <boost/foreach.hpp>
-
-#include <SDL_image.h>
 #include <config.h>
 
+#include "animation.h"
+#include "animation_gfx.h"
 #include "build_info.h"
 #include "compile_diagnostics.h"
 #include "constants.h"
 #include "container_iterate.h"
 #include "diranimations.h"
+#include "font_handler.h"
 #include "i18n.h"
+#include "image.h"
+#include "image_loader_impl.h"
+#include "image_transformations.h"
 #include "io/fileread.h"
 #include "io/filesystem/layered_filesystem.h"
 #include "io/streamwrite.h"
 #include "log.h"
 #include "logic/roadtype.h"
 #include "logic/widelands_fileread.h"
+#include "render/gl_surface_screen.h"
+#include "render/sdl_surface.h"
+#include "rendertarget.h"
 #include "surface_cache.h"
+#include "texture.h"
 #include "ui_basic/progresswindow.h"
 #include "upcast.h"
 #include "wexception.h"
 
-#include "animation.h"
-#include "animation_gfx.h"
-#include "font_handler.h"
-#include "image.h"
-#include "image_loader_impl.h"
-#include "image_transformations.h"
-#include "render/gl_surface_screen.h"
-#include "render/sdl_surface.h"
-#include "rendertarget.h"
-#include "texture.h"
-
-#include "graphic.h"
 
 using namespace std;
 

=== modified file 'src/graphic/image.h'
--- src/graphic/image.h	2013-02-09 23:18:23 +0000
+++ src/graphic/image.h	2013-07-25 21:12:27 +0000
@@ -20,10 +20,10 @@
 #ifndef IMAGE_H
 #define IMAGE_H
 
-#include <stdint.h>
 #include <string>
 
 #include <boost/noncopyable.hpp>
+#include <stdint.h>
 
 /**
  * Interface to a bitmap that can act as the source of a rendering

=== modified file 'src/graphic/image_cache.cc'
--- src/graphic/image_cache.cc	2013-07-21 08:07:18 +0000
+++ src/graphic/image_cache.cc	2013-07-25 21:12:27 +0000
@@ -17,6 +17,8 @@
  *
  */
 
+#include "image_cache.h"
+
 #include <cassert>
 #include <map>
 #include <string>
@@ -29,7 +31,6 @@
 #include "surface.h"
 #include "surface_cache.h"
 
-#include "image_cache.h"
 
 using namespace std;
 

=== modified file 'src/graphic/render/gl_surface_texture.cc'
--- src/graphic/render/gl_surface_texture.cc	2013-07-24 11:29:00 +0000
+++ src/graphic/render/gl_surface_texture.cc	2013-07-25 21:12:27 +0000
@@ -16,15 +16,14 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
+#include "gl_surface_texture.h"
+
 #include <cassert>
 
-#include "wexception.h"
-#include "graphic/graphic.h"
-
 #include "gl_surface.h"  // for glew.h
 #include "gl_utils.h"
-
-#include "gl_surface_texture.h"
+#include "graphic/graphic.h"
+#include "wexception.h"
 
 GLuint GLSurfaceTexture::gl_framebuffer_id_;
 bool use_arb_;

=== modified file 'src/graphic/render/gl_utils.h'
--- src/graphic/render/gl_utils.h	2013-02-09 18:02:07 +0000
+++ src/graphic/render/gl_utils.h	2013-07-25 21:12:27 +0000
@@ -19,11 +19,11 @@
 #ifndef GL_UTILS_H
 #define GL_UTILS_H
 
-#include <stdint.h>
-
 #define NO_SDL_GLEXT
+
 #include <GL/glew.h>
 #include <SDL_opengl.h>
+#include <stdint.h>
 
 struct SDL_PixelFormat;
 

=== modified file 'src/graphic/render/minimaprenderer.cc'
--- src/graphic/render/minimaprenderer.cc	2013-07-21 08:07:18 +0000
+++ src/graphic/render/minimaprenderer.cc	2013-07-25 21:12:27 +0000
@@ -18,27 +18,22 @@
  */
 
 #include "minimaprenderer.h"
-#include "upcast.h"
 
+#include "economy/flag.h"
 #include "economy/road.h"
-#include "economy/flag.h"
-
-#include "wui/minimap.h"
-#include "wui/mapviewpixelconstants.h"
-
-#include "logic/field.h"
-#include "logic/map.h"
-#include "logic/player.h"
-
 #include "graphic/graphic.h"
 #include "graphic/rendertarget.h"
 #include "graphic/surface.h"
 #include "graphic/texture.h"
-
+#include "logic/field.h"
+#include "logic/map.h"
+#include "logic/player.h"
+#include "terrain_sdl.h"
+#include "upcast.h"
+#include "wui/mapviewpixelconstants.h"
+#include "wui/minimap.h"
 #include "wui/overlay_manager.h"
 
-#include "terrain_sdl.h"
-
 using namespace Widelands;
 
 /**

=== modified file 'src/graphic/rendertarget.h'
--- src/graphic/rendertarget.h	2013-04-22 20:15:00 +0000
+++ src/graphic/rendertarget.h	2013-07-25 21:12:27 +0000
@@ -23,12 +23,11 @@
 #include <vector>
 
 #include "align.h"
+#include "compositemode.h"
+#include "image.h"
 #include "rect.h"
 #include "rgbcolor.h"
 
-#include "compositemode.h"
-#include "image.h"
-
 class Surface;
 
 namespace Widelands {

=== modified file 'src/graphic/surface_cache.h'
--- src/graphic/surface_cache.h	2013-07-21 08:25:22 +0000
+++ src/graphic/surface_cache.h	2013-07-25 21:12:27 +0000
@@ -20,8 +20,9 @@
 #ifndef SURFACE_CACHE_H
 #define SURFACE_CACHE_H
 
+#include <string>
+
 #include <boost/utility.hpp>
-#include <string>
 
 class Surface;
 

=== modified file 'src/graphic/text/rt_parse.cc'
--- src/graphic/text/rt_parse.cc	2013-07-19 08:30:49 +0000
+++ src/graphic/text/rt_parse.cc	2013-07-25 21:12:27 +0000
@@ -17,16 +17,17 @@
  *
  */
 
+#include "rt_parse.h"
+
+#include <vector>
+
 #include <SDL.h>
 #include <boost/format.hpp>
 #include <boost/unordered_map.hpp>
 #include <boost/unordered_set.hpp>
 
-#include <vector>
-
-#include "rt_parse.h"
+#include "rt_errors_impl.h"
 #include "textstream.h"
-#include "rt_errors_impl.h"
 
 using namespace std;
 using namespace boost;

=== modified file 'src/graphic/text/rt_parse.h'
--- src/graphic/text/rt_parse.h	2012-12-09 19:09:47 +0000
+++ src/graphic/text/rt_parse.h	2013-07-25 21:12:27 +0000
@@ -21,13 +21,13 @@
 #define RT_PARSER_H
 
 #include <map>
-#include <stdint.h>
 #include <set>
 #include <string>
 #include <vector>
 
+#include <stdint.h>
+
 #include "rgbcolor.h"
-
 #include "rt_errors.h"
 
 namespace RT {

=== modified file 'src/graphic/text/rt_render.cc'
--- src/graphic/text/rt_render.cc	2013-07-21 08:25:22 +0000
+++ src/graphic/text/rt_render.cc	2013-07-25 21:12:27 +0000
@@ -17,6 +17,8 @@
  *
  */
 
+#include "rt_render.h"
+
 #include <queue>
 #include <string>
 #include <vector>
@@ -28,12 +30,10 @@
 
 #include "graphic/image_cache.h"
 #include "graphic/surface.h"
-
 #include "rect.h"
 #include "rt_parse.h"
 #include "textstream.h"
 
-#include "rt_render.h"
 
 using namespace std;
 using namespace boost;

=== modified file 'src/graphic/text/textstream.h'
--- src/graphic/text/textstream.h	2012-12-15 18:40:59 +0000
+++ src/graphic/text/textstream.h	2013-07-25 21:12:27 +0000
@@ -21,6 +21,7 @@
 #define TEXTSTREAM_H
 
 #include <string>
+
 #include <stdint.h>
 
 namespace RT {

=== modified file 'src/graphic/texture.h'
--- src/graphic/texture.h	2013-03-30 12:52:36 +0000
+++ src/graphic/texture.h	2013-07-25 21:12:27 +0000
@@ -20,10 +20,11 @@
 #ifndef TEXTURE_H
 #define TEXTURE_H
 
-#include <stdint.h>
 #include <string>
 #include <vector>
 
+#include <stdint.h>
+
 #include "colormap.h"
 #include "graphic/render/gl_surface_texture.h"
 

=== modified file 'src/io/basic_fileread.h'
--- src/io/basic_fileread.h	2013-07-20 09:44:33 +0000
+++ src/io/basic_fileread.h	2013-07-25 21:12:27 +0000
@@ -20,15 +20,15 @@
 #ifndef BASIC_FILEREAD_H
 #define BASIC_FILEREAD_H
 
+#include <cassert>
+#include <limits>
+
+#ifndef _WIN32
+#include <sys/mman.h>
+#endif
+
 #include "io/filesystem/filesystem.h"
 #include "machdep.h"
-#ifdef _WIN32
-#else
-#include <sys/mman.h>
-#endif
-
-#include <cassert>
-#include <limits>
 
 /// Can be used to read a file. It works quite naively by reading the entire
 /// file into memory. Convenience functions are available for endian-safe

=== modified file 'src/io/filesystem/disk_filesystem.cc'
--- src/io/filesystem/disk_filesystem.cc	2013-07-20 09:46:23 +0000
+++ src/io/filesystem/disk_filesystem.cc	2013-07-25 21:12:27 +0000
@@ -16,34 +16,35 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
  */
+
 #include "compile_diagnostics.h"
 
 #include "disk_filesystem.h"
 
 #include "filesystem_exceptions.h"
+#include "log.h"
 #include "wexception.h"
 #include "zip_filesystem.h"
-#include "log.h"
-
-#include <sys/stat.h>
 
 #include <cassert>
 #include <cerrno>
 
 #ifdef _WIN32
+#include <dos.h>
+#include <sys/stat.h>
 #include <windows.h>
-#include <dos.h>
 #ifdef _MSC_VER
+#include <direct.h>
 #include <io.h>
-#include <direct.h>
 #define S_ISDIR(x) ((x&_S_IFDIR)?1:0)
-#endif
-#else
+#endif // _MSC_VER
+#else  // _WIN32
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <glob.h>
 #include <sys/mman.h>
-#include <glob.h>
 #include <sys/statvfs.h>
 #include <sys/types.h>
-#include <fcntl.h>
 #endif
 
 #include "io/streamread.h"

=== modified file 'src/io/filesystem/zip_filesystem.h'
--- src/io/filesystem/zip_filesystem.h	2013-07-09 05:40:36 +0000
+++ src/io/filesystem/zip_filesystem.h	2013-07-25 21:12:27 +0000
@@ -20,14 +20,14 @@
 #ifndef ZIP_FILESYSTEM_H
 #define ZIP_FILESYSTEM_H
 
+#include <cstring>
 #include <string>
-#include <cstring>
 
 #include <minizip/unzip.h>
 #include <minizip/zip.h>
 
+#include "filesystem.h"
 #include "port.h"
-#include "filesystem.h"
 
 class ZipFilesystem : public FileSystem {
 public:

=== modified file 'src/io/streamwrite.cc'
--- src/io/streamwrite.cc	2012-02-15 21:25:34 +0000
+++ src/io/streamwrite.cc	2013-07-25 21:12:27 +0000
@@ -17,10 +17,11 @@
  *
  */
 
+#include <cstdarg>
+
 #include "streamwrite.h"
 #include "wexception.h"
 
-#include <cstdarg>
 
 StreamWrite::~StreamWrite() {}
 

=== modified file 'src/logic/checkstep.cc'
--- src/logic/checkstep.cc	2013-02-10 19:36:24 +0000
+++ src/logic/checkstep.cc	2013-07-25 21:12:27 +0000
@@ -19,10 +19,10 @@
 
 #include "checkstep.h"
 
+#include "economy/flag.h"
+#include "economy/road.h"
 #include "map.h"
 #include "player.h"
-#include "economy/flag.h"
-#include "economy/road.h"
 
 namespace Widelands {
 

=== modified file 'src/logic/cmd_incorporate.cc'
--- src/logic/cmd_incorporate.cc	2013-02-10 19:36:24 +0000
+++ src/logic/cmd_incorporate.cc	2013-07-25 21:12:27 +0000
@@ -18,13 +18,13 @@
  */
 
 #include "cmd_incorporate.h"
-#include "widelands_fileread.h"
-#include "widelands_filewrite.h"
+
+#include "i18n.h"
 #include "map_io/widelands_map_map_object_loader.h"
 #include "map_io/widelands_map_map_object_saver.h"
 #include "wexception.h"
-
-#include "i18n.h"
+#include "widelands_fileread.h"
+#include "widelands_filewrite.h"
 
 namespace Widelands {
 

=== modified file 'src/logic/cmd_luacoroutine.cc'
--- src/logic/cmd_luacoroutine.cc	2013-02-16 08:05:55 +0000
+++ src/logic/cmd_luacoroutine.cc	2013-07-25 21:12:27 +0000
@@ -21,11 +21,11 @@
 
 #include "game.h"
 #include "game_data_error.h"
+#include "gamecontroller.h"
+#include "log.h"
+#include "player.h"
 #include "scripting/scripting.h"
 #include "upcast.h"
-#include "log.h"
-#include <gamecontroller.h>
-#include "player.h"
 
 namespace Widelands {
 

=== modified file 'src/logic/cmd_luascript.cc'
--- src/logic/cmd_luascript.cc	2013-07-15 05:18:12 +0000
+++ src/logic/cmd_luascript.cc	2013-07-25 21:12:27 +0000
@@ -19,9 +19,9 @@
 
 #include "cmd_luascript.h"
 
-#include "log.h"
 #include "game.h"
 #include "game_data_error.h"
+#include "log.h"
 #include "scripting/scripting.h"
 
 namespace Widelands {

=== modified file 'src/logic/cmd_queue.cc'
--- src/logic/cmd_queue.cc	2013-02-10 19:36:24 +0000
+++ src/logic/cmd_queue.cc	2013-07-25 21:12:27 +0000
@@ -19,19 +19,18 @@
 
 #include "cmd_queue.h"
 
-#include "io/filewrite.h"
 #include "game.h"
 #include "game_data_error.h"
 #include "instances.h"
+#include "io/filewrite.h"
 #include "machdep.h"
 #include "player.h"
 #include "playercommand.h"
+#include "upcast.h"
 #include "wexception.h"
 #include "widelands_fileread.h"
 #include "worker.h"
 
-#include "upcast.h"
-
 namespace Widelands {
 
 //

=== modified file 'src/logic/cmd_queue.h'
--- src/logic/cmd_queue.h	2013-02-10 19:36:24 +0000
+++ src/logic/cmd_queue.h	2013-07-25 21:12:27 +0000
@@ -20,12 +20,12 @@
 #ifndef CMD_QUEUE_H
 #define CMD_QUEUE_H
 
+#include <queue>
+
 #include "queue_cmd_ids.h"
 #include "widelands_fileread.h"
 #include "widelands_filewrite.h"
 
-#include <queue>
-
 namespace Widelands {
 
 struct Editor_Game_Base;

=== modified file 'src/logic/dismantlesite.cc'
--- src/logic/dismantlesite.cc	2013-07-23 14:49:48 +0000
+++ src/logic/dismantlesite.cc	2013-07-25 21:12:27 +0000
@@ -17,12 +17,12 @@
  *
  */
 
+#include "dismantlesite.h"
+
 #include <cstdio>
+
 #include <boost/foreach.hpp>
 
-#include "upcast.h"
-#include "wexception.h"
-
 #include "economy/wares_queue.h"
 #include "editor_game_base.h"
 #include "game.h"
@@ -32,10 +32,10 @@
 #include "i18n.h"
 #include "sound/sound_handler.h"
 #include "tribe.h"
+#include "upcast.h"
+#include "wexception.h"
 #include "worker.h"
 
-#include "dismantlesite.h"
-
 namespace Widelands {
 
 DismantleSite_Descr::DismantleSite_Descr

=== modified file 'src/logic/findnode.cc'
--- src/logic/findnode.cc	2013-02-10 19:36:24 +0000
+++ src/logic/findnode.cc	2013-07-25 21:12:27 +0000
@@ -19,12 +19,12 @@
 
 #include "findnode.h"
 
+#include "container_iterate.h"
 #include "field.h"
 #include "immovable.h"
 #include "map.h"
 #include "wexception.h"
 
-#include "container_iterate.h"
 
 namespace Widelands {
 

=== modified file 'src/logic/immovable.cc'
--- src/logic/immovable.cc	2013-07-23 18:09:24 +0000
+++ src/logic/immovable.cc	2013-07-25 21:12:27 +0000
@@ -19,34 +19,32 @@
 
 #include "immovable.h"
 
+#include <cstdio>
+
+#include <config.h>
+
+#include "container_iterate.h"
 #include "editor_game_base.h"
-#include "game_data_error.h"
 #include "field.h"
 #include "game.h"
+#include "game_data_error.h"
+#include "graphic/animation_gfx.h"
+#include "graphic/graphic.h"
+#include "graphic/rendertarget.h"
 #include "helper.h"
 #include "immovable_program.h"
-#include "player.h"
 #include "map.h"
 #include "mapfringeregion.h"
+#include "player.h"
 #include "profile/profile.h"
-#include "graphic/animation_gfx.h"
-#include "graphic/graphic.h"
-#include "graphic/rendertarget.h"
 #include "sound/sound_handler.h"
 #include "tribe.h"
+#include "upcast.h"
 #include "wexception.h"
 #include "widelands_fileread.h"
 #include "widelands_filewrite.h"
 #include "worker.h"
 
-#include "upcast.h"
-
-#include "container_iterate.h"
-
-#include <cstdio>
-
-#include <config.h>
-
 namespace Widelands {
 
 BaseImmovable::BaseImmovable(const Map_Object_Descr & mo_descr) :

=== modified file 'src/logic/instances.cc'
--- src/logic/instances.cc	2013-03-04 12:28:51 +0000
+++ src/logic/instances.cc	2013-07-25 21:12:27 +0000
@@ -19,23 +19,21 @@
 
 #include "instances.h"
 
+#include <cstdarg>
+#include <cstdio>
+#include <cstring>
+#include <string>
+
 #include "cmd_queue.h"
+#include "container_iterate.h"
 #include "game.h"
+#include "log.h"
+#include "map_io/widelands_map_map_object_loader.h"
+#include "map_io/widelands_map_map_object_saver.h"
 #include "queue_cmd_ids.h"
 #include "wexception.h"
 #include "widelands_fileread.h"
 #include "widelands_filewrite.h"
-#include "map_io/widelands_map_map_object_loader.h"
-#include "map_io/widelands_map_map_object_saver.h"
-
-#include "log.h"
-
-#include "container_iterate.h"
-
-#include <cstdarg>
-#include <cstdio>
-#include <string>
-#include <cstring>
 
 namespace Widelands {
 

=== modified file 'src/logic/map.h'
--- src/logic/map.h	2013-07-21 08:07:18 +0000
+++ src/logic/map.h	2013-07-25 21:12:27 +0000
@@ -28,15 +28,13 @@
 
 #include "economy/itransport_cost_calculator.h"
 #include "field.h"
-#include "objective.h"
-#include "widelands_geometry.h"
-#include "world.h"
-
 #include "interval.h"
 #include "manager.h"
 #include "notification.h"
-
+#include "objective.h"
 #include "random.h"
+#include "widelands_geometry.h"
+#include "world.h"
 
 struct Overlay_Manager;
 struct S2_Map_Loader;

=== modified file 'src/logic/player_area.h'
--- src/logic/player_area.h	2012-09-21 21:36:07 +0000
+++ src/logic/player_area.h	2013-07-25 21:12:27 +0000
@@ -20,10 +20,9 @@
 #ifndef PLAYER_AREA_H
 #define PLAYER_AREA_H
 
+#include "widelands.h"
 #include "widelands_geometry.h"
 
-#include "widelands.h"
-
 namespace Widelands {
 
 template <typename Area_type = Area<> > struct Player_Area : public Area_type {

=== modified file 'src/logic/production_program.cc'
--- src/logic/production_program.cc	2013-07-23 18:09:24 +0000
+++ src/logic/production_program.cc	2013-07-25 21:12:27 +0000
@@ -19,6 +19,10 @@
 
 #include "production_program.h"
 
+#include <boost/format.hpp>
+#include <config.h>
+#include <libintl.h>
+
 #include "checkstep.h"
 #include "economy/economy.h"
 #include "economy/flag.h"
@@ -36,15 +40,10 @@
 #include "soldier.h"
 #include "soldiercontrol.h"
 #include "sound/sound_handler.h"
+#include "trainingsite.h"
 #include "tribe.h"
 #include "upcast.h"
 #include "worker_program.h"
-#include "trainingsite.h"
-
-#include <libintl.h>
-#include <boost/format.hpp>
-
-#include <config.h>
 
 namespace Widelands {
 

=== modified file 'src/logic/replay.cc'
--- src/logic/replay.cc	2013-04-22 20:15:00 +0000
+++ src/logic/replay.cc	2013-07-25 21:12:27 +0000
@@ -24,15 +24,14 @@
 #include "game_io/game_loader.h"
 #include "gamecontroller.h"
 #include "io/filesystem/layered_filesystem.h"
+#include "io/streamwrite.h"
+#include "log.h"
 #include "md5.h"
 #include "playercommand.h"
 #include "random.h"
 #include "save_handler.h"
-#include "io/streamwrite.h"
 #include "wexception.h"
 
-#include "log.h"
-
 namespace Widelands {
 
 // File format definitions

=== modified file 'src/logic/replay.h'
--- src/logic/replay.h	2013-01-19 19:31:08 +0000
+++ src/logic/replay.h	2013-07-25 21:12:27 +0000
@@ -28,10 +28,11 @@
  * playercommands.
  */
 
-#include <stdint.h>
 #include <cstring>
 #include <string>
 
+#include <stdint.h>
+
 #define REPLAY_DIR "replays"
 #define REPLAY_SUFFIX ".wrpl"
 

=== modified file 'src/logic/trainingsite.cc'
--- src/logic/trainingsite.cc	2013-07-21 14:27:22 +0000
+++ src/logic/trainingsite.cc	2013-07-25 21:12:27 +0000
@@ -19,6 +19,9 @@
 
 #include "trainingsite.h"
 
+#include <cstdio>
+
+#include "economy/request.h"
 #include "editor_game_base.h"
 #include "game.h"
 #include "helper.h"
@@ -26,14 +29,11 @@
 #include "player.h"
 #include "production_program.h"
 #include "profile/profile.h"
-#include "economy/request.h"
 #include "soldier.h"
 #include "tribe.h"
+#include "upcast.h"
 #include "worker.h"
 
-#include "upcast.h"
-
-#include <cstdio>
 
 namespace Widelands {
 

=== modified file 'src/logic/tribe.h'
--- src/logic/tribe.h	2013-04-22 20:15:00 +0000
+++ src/logic/tribe.h	2013-07-25 21:12:27 +0000
@@ -20,21 +20,20 @@
 #ifndef TRIBE_H
 #define TRIBE_H
 
-#include "graphic/animation.h"
+#include <map>
+#include <vector>
+
+#include "HTMLReferences.h"
+#include "TribeBasicInfo.h"
 #include "bob.h"
 #include "building.h"
 #include "descr_maintainer.h"
+#include "graphic/animation.h"
 #include "immovable.h"
+#include "io/filewrite.h"
 #include "item_ware_descr.h"
 #include "military_data.h"
 #include "worker.h"
-#include "HTMLReferences.h"
-
-#include "io/filewrite.h"
-#include "TribeBasicInfo.h"
-
-#include <map>
-#include <vector>
 
 namespace Widelands {
 

=== modified file 'src/logic/ware_types.h'
--- src/logic/ware_types.h	2013-02-10 19:36:24 +0000
+++ src/logic/ware_types.h	2013-07-25 21:12:27 +0000
@@ -20,10 +20,10 @@
 #ifndef WARE_TYPES_H
 #define WARE_TYPES_H
 
+#include <vector>
+
 #include "widelands.h"
 
-#include <vector>
-
 namespace Widelands {
 typedef std::vector<std::pair<Ware_Index, uint32_t> > Ware_Types;
 

=== modified file 'src/logic/widelands.h'
--- src/logic/widelands.h	2013-07-09 05:40:36 +0000
+++ src/logic/widelands.h	2013-07-25 21:12:27 +0000
@@ -22,8 +22,9 @@
 
 #include <cassert>
 #include <cstddef>
+#include <limits>
+
 #include <stdint.h>
-#include <limits>
 
 #include "port.h"
 

=== modified file 'src/logic/widelands_geometry.h'
--- src/logic/widelands_geometry.h	2013-07-18 06:31:11 +0000
+++ src/logic/widelands_geometry.h	2013-07-25 21:12:27 +0000
@@ -21,6 +21,7 @@
 #define WIDELANDS_GEOMETRY_H
 
 #include <cmath>
+
 #include <stdint.h>
 
 namespace Widelands {

=== modified file 'src/logic/widelands_streamread_inlines.h'
--- src/logic/widelands_streamread_inlines.h	2013-02-10 19:36:24 +0000
+++ src/logic/widelands_streamread_inlines.h	2013-07-25 21:12:27 +0000
@@ -20,10 +20,9 @@
 #ifndef WIDELANDS_STREAMREAD_INLINES_H
 #define WIDELANDS_STREAMREAD_INLINES_H
 
+#include "immovable.h"
 #include "widelands_streamread.h"
 
-#include "immovable.h"
-
 namespace Widelands {
 
 inline const Tribe_Descr & StreamRead::Tribe

=== modified file 'src/logic/widelands_streamwrite_inlines.h'
--- src/logic/widelands_streamwrite_inlines.h	2013-02-10 19:36:24 +0000
+++ src/logic/widelands_streamwrite_inlines.h	2013-07-25 21:12:27 +0000
@@ -20,10 +20,9 @@
 #ifndef WIDELANDS_STREAMWRITE_INLINES_H
 #define WIDELANDS_STREAMWRITE_INLINES_H
 
+#include "building.h"
 #include "widelands_streamwrite.h"
 
-#include "building.h"
-
 namespace Widelands {
 
 inline void StreamWrite::Tribe(const Tribe_Descr & tribe) {

=== modified file 'src/logic/worker.cc'
--- src/logic/worker.cc	2013-07-21 08:27:10 +0000
+++ src/logic/worker.cc	2013-07-25 21:12:27 +0000
@@ -25,9 +25,9 @@
 #include "critter_bob.h"
 #include "economy/economy.h"
 #include "economy/flag.h"
+#include "economy/portdock.h"
 #include "economy/road.h"
 #include "economy/transfer.h"
-#include "economy/portdock.h"
 #include "findbob.h"
 #include "findimmovable.h"
 #include "findnode.h"

=== modified file 'src/logic/world.cc'
--- src/logic/world.cc	2013-07-21 08:07:18 +0000
+++ src/logic/world.cc	2013-07-25 21:12:27 +0000
@@ -19,14 +19,18 @@
 
 #include "world.h"
 
+#include <iostream>
+#include <sstream>
+
 #include "constants.h"
+#include "container_iterate.h"
 #include "critter_bob.h"
 #include "game_data_error.h"
 #include "graphic/graphic.h"
 #include "helper.h"
-#include "log.h"
 #include "i18n.h"
 #include "io/filesystem/layered_filesystem.h"
+#include "log.h"
 #include "parse_map_object_types.h"
 #include "profile/profile.h"
 #include "wexception.h"
@@ -34,11 +38,6 @@
 #include "widelands_filewrite.h"
 #include "worlddata.h"
 
-#include "container_iterate.h"
-
-#include <iostream>
-#include <sstream>
-
 using std::cerr;
 using std::endl;
 

=== modified file 'src/manager.h'
--- src/manager.h	2013-02-10 19:36:24 +0000
+++ src/manager.h	2013-07-25 21:12:27 +0000
@@ -20,11 +20,11 @@
 #ifndef MANAGER_H
 #define MANAGER_H
 
-#include "container_iterate.h"
-
 #include <cassert>
 #include <vector>
 
+#include "container_iterate.h"
+
 /// Manages items of type T. Takes ownership of them. Assumes that they can be
 /// deallocated with operator delete, so only register items that were
 /// allocated with operator new.

=== modified file 'src/map_generator.cc'
--- src/map_generator.cc	2013-07-23 18:04:32 +0000
+++ src/map_generator.cc	2013-07-25 21:12:27 +0000
@@ -18,11 +18,12 @@
  */
 
 #include "map_generator.h"
+
+#include "editor/tools/editor_increase_resources_tool.h"
 #include "log.h"
+#include "logic/editor_game_base.h"
 #include "logic/findnode.h"
 #include "logic/map.h"
-#include "logic/editor_game_base.h"
-#include "editor/tools/editor_increase_resources_tool.h"
 
 #define AVG_ELEVATION   (0x80000000)
 #define MAX_ELEVATION   (0xffffffff)

=== modified file 'src/map_io/widelands_map_allowed_worker_types_data_packet.cc'
--- src/map_io/widelands_map_allowed_worker_types_data_packet.cc	2013-07-21 08:25:22 +0000
+++ src/map_io/widelands_map_allowed_worker_types_data_packet.cc	2013-07-25 21:12:27 +0000
@@ -22,9 +22,8 @@
 #include "logic/game.h"
 #include "logic/game_data_error.h"
 #include "logic/player.h"
+#include "logic/tribe.h"
 #include "profile/profile.h"
-#include "logic/tribe.h"
-
 #include "upcast.h"
 
 namespace Widelands {

=== modified file 'src/map_io/widelands_map_building_data_packet.cc'
--- src/map_io/widelands_map_building_data_packet.cc	2013-07-22 11:45:41 +0000
+++ src/map_io/widelands_map_building_data_packet.cc	2013-07-25 21:12:27 +0000
@@ -19,6 +19,8 @@
 
 #include "widelands_map_building_data_packet.h"
 
+#include <map>
+
 #include "economy/request.h"
 #include "graphic/graphic.h"
 #include "logic/constructionsite.h"
@@ -28,14 +30,11 @@
 #include "logic/tribe.h"
 #include "logic/widelands_fileread.h"
 #include "logic/widelands_filewrite.h"
+#include "upcast.h"
 #include "widelands_map_map_object_loader.h"
 #include "widelands_map_map_object_saver.h"
 #include "wui/interactive_base.h"
 
-#include "upcast.h"
-
-#include <map>
-
 namespace Widelands {
 
 #define LOWEST_SUPPORTED_VERSION           1

=== modified file 'src/map_io/widelands_map_data_packet.h'
--- src/map_io/widelands_map_data_packet.h	2013-01-08 17:05:51 +0000
+++ src/map_io/widelands_map_data_packet.h	2013-07-25 21:12:27 +0000
@@ -20,8 +20,8 @@
 #ifndef WIDELANDS_MAP_DATA_PACKET_H
 #define WIDELANDS_MAP_DATA_PACKET_H
 
+#include "logic/widelands_filewrite.h"
 #include "wexception.h"
-#include "logic/widelands_filewrite.h"
 
 class FileSystem;
 

=== modified file 'src/map_io/widelands_map_exploration_data_packet.cc'
--- src/map_io/widelands_map_exploration_data_packet.cc	2013-07-18 06:31:11 +0000
+++ src/map_io/widelands_map_exploration_data_packet.cc	2013-07-25 21:12:27 +0000
@@ -19,6 +19,7 @@
 
 #include "widelands_map_exploration_data_packet.h"
 
+#include "log.h"
 #include "logic/editor_game_base.h"
 #include "logic/game_data_error.h"
 #include "logic/map.h"
@@ -26,8 +27,6 @@
 #include "logic/widelands_fileread.h"
 #include "logic/widelands_filewrite.h"
 
-#include "log.h"
-
 namespace Widelands {
 
 #define CURRENT_PACKET_VERSION 2

=== modified file 'src/map_io/widelands_map_map_object_saver.cc'
--- src/map_io/widelands_map_map_object_saver.cc	2013-02-10 19:36:24 +0000
+++ src/map_io/widelands_map_map_object_saver.cc	2013-07-25 21:12:27 +0000
@@ -19,16 +19,16 @@
 
 #include "widelands_map_map_object_saver.h"
 
-#include "logic/areawatcher.h"
-#include "logic/battle.h"
-#include "logic/bob.h"
-#include "logic/building.h"
 #include "container_iterate.h"
 #include "economy/flag.h"
 #include "economy/fleet.h"
 #include "economy/portdock.h"
 #include "economy/road.h"
 #include "economy/ware_instance.h"
+#include "logic/areawatcher.h"
+#include "logic/battle.h"
+#include "logic/bob.h"
+#include "logic/building.h"
 #include "logic/item_ware_descr.h"
 #include "wexception.h"
 

=== modified file 'src/map_io/widelands_map_ware_data_packet.cc'
--- src/map_io/widelands_map_ware_data_packet.cc	2013-02-10 19:36:24 +0000
+++ src/map_io/widelands_map_ware_data_packet.cc	2013-07-25 21:12:27 +0000
@@ -19,6 +19,8 @@
 
 #include "widelands_map_ware_data_packet.h"
 
+#include <map>
+
 #include "economy/flag.h"
 #include "economy/ware_instance.h"
 #include "logic/editor_game_base.h"
@@ -27,13 +29,10 @@
 #include "logic/tribe.h"
 #include "logic/widelands_fileread.h"
 #include "logic/widelands_filewrite.h"
+#include "logic/worker.h"
+#include "upcast.h"
 #include "widelands_map_map_object_loader.h"
 #include "widelands_map_map_object_saver.h"
-#include "logic/worker.h"
-
-#include "upcast.h"
-
-#include <map>
 
 namespace Widelands {
 

=== modified file 'src/md5.h'
--- src/md5.h	2013-02-10 19:36:24 +0000
+++ src/md5.h	2013-07-25 21:12:27 +0000
@@ -24,8 +24,9 @@
 
 #include <cassert>
 #include <cstring>
+#include <string>
+
 #include <stdint.h>
-#include <string>
 
 /* Structure to save state of computation between the single steps.  */
 struct md5_ctx {

=== modified file 'src/scripting/coroutine_impl.cc'
--- src/scripting/coroutine_impl.cc	2012-02-15 21:25:34 +0000
+++ src/scripting/coroutine_impl.cc	2013-07-25 21:12:27 +0000
@@ -17,20 +17,19 @@
  *
  */
 
+#include "coroutine_impl.h"
+
 #include <csetjmp>
+
 #include <boost/lexical_cast.hpp>
 
+#include "c_utils.h"
+#include "log.h"
 #include "logic/player.h"
-
-#include "c_utils.h"
 #include "lua_game.h"
 #include "lua_map.h"
 #include "persistence.h"
 
-#include "coroutine_impl.h"
-
-#include "log.h"
-
 LuaCoroutine_Impl::LuaCoroutine_Impl(lua_State * ms)
 	: m_L(ms), m_idx(LUA_REFNIL), m_nargs(0)
 {

=== modified file 'src/scripting/lua_map.h'
--- src/scripting/lua_map.h	2013-02-10 19:36:24 +0000
+++ src/scripting/lua_map.h	2013-07-25 21:12:27 +0000
@@ -34,9 +34,9 @@
 #include "logic/trainingsite.h"
 #include "logic/warehouse.h"
 #include "logic/worker.h"
-
 #include "luna.h"
 
+
 namespace Widelands {
 	struct Soldier_Descr;
 }

=== modified file 'src/scripting/luna_impl.cc'
--- src/scripting/luna_impl.cc	2012-02-15 21:25:34 +0000
+++ src/scripting/luna_impl.cc	2013-07-25 21:12:27 +0000
@@ -19,12 +19,12 @@
 
 #include "luna_impl.h"
 
+#include <string>
+
+#include "c_utils.h"
 #include "log.h"
-
-#include "c_utils.h"
 #include "luna.h"
 
-#include <string>
 
 /*
  * =======================================

=== modified file 'src/scripting/persistence.h'
--- src/scripting/persistence.h	2012-02-15 21:25:34 +0000
+++ src/scripting/persistence.h	2013-07-25 21:12:27 +0000
@@ -22,8 +22,10 @@
 
 #include <string>
 
+#include <lua.hpp>
+
+#include "logic/widelands_fileread.h"
 #include "logic/widelands_filewrite.h"
-#include "logic/widelands_fileread.h"
 
 namespace Widelands {
 	struct Map_Map_Object_Loader;
@@ -32,7 +34,6 @@
 	struct Game;
 }
 
-#include <lua.hpp>
 
 /**
  * This persists the lua object at the stack position

=== modified file 'src/scripting/scripting.cc'
--- src/scripting/scripting.cc	2013-07-21 08:39:02 +0000
+++ src/scripting/scripting.cc	2013-07-25 21:12:27 +0000
@@ -17,14 +17,20 @@
  *
  */
 
+#include "scripting.h"
+
+#include <stdexcept>
 #include <string>
-#include <stdexcept>
 
-#include "log.h"
-#include "io/filesystem/layered_filesystem.h"
+#ifdef _MSC_VER
+#include <ctype.h> // for tolower
+#endif
 
 #include "c_utils.h"
 #include "coroutine_impl.h"
+#include "factory.h"
+#include "io/filesystem/layered_filesystem.h"
+#include "log.h"
 #include "lua_bases.h"
 #include "lua_editor.h"
 #include "lua_game.h"
@@ -33,13 +39,7 @@
 #include "lua_root.h"
 #include "lua_ui.h"
 #include "persistence.h"
-#include "factory.h"
-
-#include "scripting.h"
-
-#ifdef _MSC_VER
-#include <ctype.h> // for tolower
-#endif
+
 
 /*
 ============================================

=== modified file 'src/sound/songset.h'
--- src/sound/songset.h	2013-02-10 19:36:24 +0000
+++ src/sound/songset.h	2013-07-25 21:12:27 +0000
@@ -20,15 +20,16 @@
 #ifndef SONGSET_H
 #define SONGSET_H
 
-#include "io/fileread.h"
-
-#include <config.h> //  must be included before SDL_mixer.h!
-#include <SDL_mixer.h>
-
 #include <string>
 #include <cstring>
 #include <vector>
 
+#include <config.h> //  must be included before SDL_mixer.h!
+#include <SDL_mixer.h>
+
+#include "io/fileread.h"
+
+
 /** A collection of several pieces of music meant for the same situation.
  *
  * A Songset encapsulates a number of interchangeable pieces of (background)

=== modified file 'src/text_parser.h'
--- src/text_parser.h	2013-02-10 19:36:24 +0000
+++ src/text_parser.h	2013-07-25 21:12:27 +0000
@@ -20,8 +20,8 @@
 #ifndef TEXT_PARSER_H
 #define TEXT_PARSER_H
 
+#include <string>
 #include <vector>
-#include <string>
 
 #include "align.h"
 #include "rgbcolor.h"

=== modified file 'src/ui_basic/helpwindow.cc'
--- src/ui_basic/helpwindow.cc	2013-07-21 08:39:02 +0000
+++ src/ui_basic/helpwindow.cc	2013-07-25 21:12:27 +0000
@@ -17,23 +17,22 @@
  *
  */
 
+#include "helpwindow.h"
 
 #include <boost/format.hpp>
 
-#include "scripting/scripting.h"
-#include "io/filesystem/layered_filesystem.h"
-
 #include "button.h"
 #include "constants.h"
 #include "graphic/font.h"
 #include "graphic/font_handler.h"
 #include "graphic/graphic.h"
 #include "i18n.h"
+#include "io/filesystem/layered_filesystem.h"
 #include "log.h"
+#include "scripting/scripting.h"
 #include "window.h"
 #include "wlapplication.h"
 
-#include "helpwindow.h"
 
 using boost::format;
 

=== modified file 'src/ui_basic/helpwindow.h'
--- src/ui_basic/helpwindow.h	2013-02-10 13:44:17 +0000
+++ src/ui_basic/helpwindow.h	2013-07-25 21:12:27 +0000
@@ -21,7 +21,6 @@
 #define UI_HELPWINDOW_H
 
 #include "align.h"
-
 #include "multilinetextarea.h"
 #include "unique_window.h"
 #include "window.h"

=== modified file 'src/ui_basic/icon.cc'
--- src/ui_basic/icon.cc	2013-02-09 23:18:23 +0000
+++ src/ui_basic/icon.cc	2013-07-25 21:12:27 +0000
@@ -17,9 +17,10 @@
  *
  */
 
+#include "icon.h"
+
 #include "graphic/image.h"
 #include "graphic/rendertarget.h"
-#include "icon.h"
 
 namespace UI {
 

=== modified file 'src/ui_basic/icongrid.h'
--- src/ui_basic/icongrid.h	2013-02-10 19:36:24 +0000
+++ src/ui_basic/icongrid.h	2013-07-25 21:12:27 +0000
@@ -20,13 +20,13 @@
 #ifndef UI_ICONGRID_H
 #define UI_ICONGRID_H
 
+#include <vector>
+
+#include <boost/signal.hpp>
+
 #include "panel.h"
 #include "textarea.h"
 
-#include <vector>
-
-#include <boost/signal.hpp>
-
 namespace UI {
 
 /**

=== modified file 'src/ui_basic/panel.cc'
--- src/ui_basic/panel.cc	2013-07-21 08:25:22 +0000
+++ src/ui_basic/panel.cc	2013-07-25 21:12:27 +0000
@@ -17,6 +17,8 @@
  *
  */
 
+#include "panel.h"
+
 #include "constants.h"
 #include "graphic/font_handler.h"
 #include "graphic/font_handler1.h"
@@ -31,7 +33,6 @@
 #include "text_layout.h"
 #include "wlapplication.h"
 
-#include "panel.h"
 
 using namespace std;
 

=== modified file 'src/ui_basic/progressbar.cc'
--- src/ui_basic/progressbar.cc	2013-07-24 11:59:45 +0000
+++ src/ui_basic/progressbar.cc	2013-07-25 21:12:27 +0000
@@ -19,15 +19,15 @@
 
 #include "progressbar.h"
 
+#include <cstdio>
+
+#include <boost/format.hpp>
+
 #include "constants.h"
 #include "graphic/font.h"
 #include "graphic/font_handler1.h"
+#include "graphic/rendertarget.h"
 #include "text_layout.h"
-#include "graphic/rendertarget.h"
-
-#include <cstdio>
-#include <boost/format.hpp>
-
 
 namespace UI {
 /**

=== modified file 'src/ui_basic/slider.cc'
--- src/ui_basic/slider.cc	2013-07-14 16:18:41 +0000
+++ src/ui_basic/slider.cc	2013-07-25 21:12:27 +0000
@@ -18,11 +18,10 @@
 
 #include <cmath>
 
-#include "mouse_constants.h"
-#include "graphic/rendertarget.h"
 #include "graphic/font.h"
 #include "graphic/font_handler.h"
-
+#include "graphic/rendertarget.h"
+#include "mouse_constants.h"
 #include "slider.h"
 
 namespace UI {

=== modified file 'src/ui_basic/spinbox.cc'
--- src/ui_basic/spinbox.cc	2013-02-10 19:36:24 +0000
+++ src/ui_basic/spinbox.cc	2013-07-25 21:12:27 +0000
@@ -19,13 +19,13 @@
 
 #include "spinbox.h"
 
+#include <vector>
+
+#include "button.h"
+#include "container_iterate.h"
 #include "i18n.h"
-#include "button.h"
 #include "textarea.h"
 #include "wexception.h"
-#include "container_iterate.h"
-
-#include <vector>
 
 namespace UI {
 

=== modified file 'src/ui_basic/tabpanel.cc'
--- src/ui_basic/tabpanel.cc	2013-07-18 06:31:11 +0000
+++ src/ui_basic/tabpanel.cc	2013-07-25 21:12:27 +0000
@@ -19,10 +19,9 @@
 
 #include "tabpanel.h"
 
+#include "graphic/rendertarget.h"
 #include "mouse_constants.h"
 
-#include "graphic/rendertarget.h"
-
 namespace UI {
 #define TP_BUTTON_WIDTH     34
 #define TP_BUTTON_HEIGHT    34

=== modified file 'src/ui_fsmenu/internet_lobby.h'
--- src/ui_fsmenu/internet_lobby.h	2013-02-10 19:36:24 +0000
+++ src/ui_fsmenu/internet_lobby.h	2013-07-25 21:12:27 +0000
@@ -20,10 +20,13 @@
 #ifndef FULLSCREEN_MENU_INTERNET_LOBBY_H
 #define FULLSCREEN_MENU_INTERNET_LOBBY_H
 
+#include <cstring>
+#include <string>
+#include <vector>
+
+#include "base.h"
 #include "network/internet_gaming.h"
 #include "network/network_lan_promotion.h"
-
-#include "base.h"
 #include "ui_basic/button.h"
 #include "ui_basic/editbox.h"
 #include "ui_basic/listselect.h"
@@ -32,10 +35,6 @@
 #include "ui_basic/textarea.h"
 #include "wui/gamechatpanel.h"
 
-#include <string>
-#include <cstring>
-#include <vector>
-
 struct Fullscreen_Menu_Internet_Lobby : public Fullscreen_Menu_Base {
 
 	Fullscreen_Menu_Internet_Lobby (const char *, const char *, bool);

=== modified file 'src/ui_fsmenu/launchMPG.cc'
--- src/ui_fsmenu/launchMPG.cc	2013-07-21 08:39:02 +0000
+++ src/ui_fsmenu/launchMPG.cc	2013-07-25 21:12:27 +0000
@@ -17,6 +17,9 @@
  *
  */
 
+#include "launchMPG.h"
+
+#include <boost/format.hpp>
 
 #include "gamecontroller.h"
 #include "gamesettings.h"
@@ -37,12 +40,8 @@
 #include "wui/gamechatpanel.h"
 #include "wui/multiplayersetupgroup.h"
 
-#include "launchMPG.h"
-
-#include <boost/format.hpp>
 using boost::format;
 
-
 /// Simple user interaction window for selecting either map, save or cancel
 struct MapOrSaveSelectionWindow : public UI::Window {
 	MapOrSaveSelectionWindow

=== modified file 'src/ui_fsmenu/loadgame.cc'
--- src/ui_fsmenu/loadgame.cc	2013-07-19 11:00:01 +0000
+++ src/ui_fsmenu/loadgame.cc	2013-07-25 21:12:27 +0000
@@ -19,6 +19,8 @@
 
 #include "loadgame.h"
 
+#include <cstdio>
+
 #include "game_io/game_loader.h"
 #include "game_io/game_preload_data_packet.h"
 #include "gamecontroller.h"
@@ -28,10 +30,9 @@
 #include "io/filesystem/layered_filesystem.h"
 #include "log.h"
 #include "logic/game.h"
+#include "timestring.h"
 #include "ui_basic/messagebox.h"
-#include "timestring.h"
 
-#include <cstdio>
 
 Fullscreen_Menu_LoadGame::Fullscreen_Menu_LoadGame
 	(Widelands::Game & g, GameSettingsProvider * gsp, GameController * gc) :

=== modified file 'src/ui_fsmenu/mapselect.cc'
--- src/ui_fsmenu/mapselect.cc	2013-07-20 10:15:23 +0000
+++ src/ui_fsmenu/mapselect.cc	2013-07-25 21:12:27 +0000
@@ -16,15 +16,16 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
+#include "mapselect.h"
+
 #include <cstdio>
+
 #include <boost/format.hpp>
 
-#include "i18n.h"
-#include "wexception.h"
-
 #include "gamecontroller.h"
 #include "gamesettings.h"
 #include "graphic/graphic.h"
+#include "i18n.h"
 #include "io/filesystem/layered_filesystem.h"
 #include "log.h"
 #include "logic/editor_game_base.h"
@@ -33,9 +34,7 @@
 #include "s2map.h"
 #include "ui_basic/box.h"
 #include "ui_basic/checkbox.h"
-
-
-#include "mapselect.h"
+#include "wexception.h"
 
 
 using Widelands::WL_Map_Loader;

=== modified file 'src/ui_fsmenu/mapselect.h'
--- src/ui_fsmenu/mapselect.h	2012-09-21 21:36:07 +0000
+++ src/ui_fsmenu/mapselect.h	2013-07-25 21:12:27 +0000
@@ -20,18 +20,17 @@
 #ifndef FULLSCREEN_MENU_MAPSELECT_H
 #define FULLSCREEN_MENU_MAPSELECT_H
 
+#include <set>
 #include <string>
-#include <set>
 
 #include "base.h"
+#include "logic/map.h"
 #include "ui_basic/button.h"
 #include "ui_basic/checkbox.h"
+#include "ui_basic/multilinetextarea.h"
 #include "ui_basic/table.h"
-#include "ui_basic/multilinetextarea.h"
 #include "ui_basic/textarea.h"
 
-#include "logic/map.h"
-
 
 using Widelands::Map;
 struct GameController;

=== modified file 'src/wlapplication.cc'
--- src/wlapplication.cc	2013-07-24 20:56:42 +0000
+++ src/wlapplication.cc	2013-07-25 21:12:27 +0000
@@ -19,6 +19,24 @@
 
 #include "wlapplication.h"
 
+#include <cerrno>
+#ifndef _WIN32
+#include <csignal>
+#endif
+#include <cstring>
+#include <ctime>
+#include <fstream>
+#include <iostream>
+#include <stdexcept>
+#include <string>
+
+#include <config.h>
+#ifdef __APPLE__
+#include <mach-o/dyld.h>
+#endif
+#include <sys/stat.h>
+#include <sys/types.h>
+
 #include "build_info.h"
 #include "computer_player.h"
 #include "editor/editorinteractive.h"
@@ -30,6 +48,7 @@
 #include "io/filesystem/disk_filesystem.h"
 #include "io/filesystem/layered_filesystem.h"
 #include "journal.h"
+#include "log.h"
 #include "logic/game.h"
 #include "logic/game_data_error.h"
 #include "logic/map.h"
@@ -41,6 +60,7 @@
 #include "network/nethost.h"
 #include "profile/profile.h"
 #include "sound/sound_handler.h"
+#include "timestring.h"
 #include "ui_basic/messagebox.h"
 #include "ui_basic/progresswindow.h"
 #include "ui_fsmenu/campaign_select.h"
@@ -64,36 +84,10 @@
 #include "wui/interactive_player.h"
 #include "wui/interactive_spectator.h"
 
-#include "log.h"
-
-#include "timestring.h"
-
-#include <config.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#ifndef _WIN32
-#include <csignal>
-#endif
-
-#include <cerrno>
-#include <cstring>
-#include <iostream>
-#include <fstream>
-#include <stdexcept>
-#include <string>
-#include <ctime>
-
-#ifdef __APPLE__
-#include <mach-o/dyld.h>
-#endif
-
 #ifndef NDEBUG
-#ifndef _WIN32
 int32_t WLApplication::pid_me   = 0;
 int32_t WLApplication::pid_peer = 0;
 volatile int32_t WLApplication::may_run = 0;
-#include <csignal>
-#endif
 #endif
 
 #define MINIMUM_DISK_SPACE 250000000lu

=== modified file 'src/wlapplication.h'
--- src/wlapplication.h	2013-07-21 08:25:22 +0000
+++ src/wlapplication.h	2013-07-25 21:12:27 +0000
@@ -20,16 +20,17 @@
 #ifndef WLAPPLICATION_H
 #define WLAPPLICATION_H
 
-#include "point.h"
+#include <cstring>
+#include <map>
+#include <stdexcept>
+#include <string>
 
 #include <SDL_events.h>
 #include <SDL_keyboard.h>
 #include <SDL_types.h>
 
-#include <map>
-#include <stdexcept>
-#include <string>
-#include <cstring>
+#include "point.h"
+
 
 namespace Widelands {struct Game;}
 struct Journal;

=== modified file 'src/wui/encyclopedia_window.h'
--- src/wui/encyclopedia_window.h	2013-02-09 22:51:15 +0000
+++ src/wui/encyclopedia_window.h	2013-07-25 21:12:27 +0000
@@ -20,13 +20,12 @@
 #ifndef ENCYCLOPEDIA_WINDOW_H
 #define ENCYCLOPEDIA_WINDOW_H
 
+#include "logic/item_ware_descr.h"
 #include "ui_basic/listselect.h"
+#include "ui_basic/multilinetextarea.h"
+#include "ui_basic/table.h"
+#include "ui_basic/unique_window.h"
 #include "ui_basic/window.h"
-#include "ui_basic/unique_window.h"
-#include "ui_basic/table.h"
-#include "ui_basic/multilinetextarea.h"
-
-#include "logic/item_ware_descr.h"
 
 namespace Widelands {
 struct Item_Ware_Descr;

=== modified file 'src/wui/interactive_base.h'
--- src/wui/interactive_base.h	2013-07-21 08:25:22 +0000
+++ src/wui/interactive_base.h	2013-07-25 21:12:27 +0000
@@ -20,18 +20,17 @@
 #ifndef INTERACTIVE_BASE_H
 #define INTERACTIVE_BASE_H
 
+#include <SDL_keysym.h>
+
 #include "debugconsole.h"
 #include "logic/editor_game_base.h"
 #include "logic/map.h"
 #include "mapview.h"
 #include "overlay_manager.h"
-
 #include "ui_basic/box.h"
 #include "ui_basic/textarea.h"
 #include "ui_basic/unique_window.h"
 
-#include <SDL_keysym.h>
-
 namespace Widelands {struct CoordPath;}
 
 struct InteractiveBaseInternals;

=== modified file 'src/wui/login_box.cc'
--- src/wui/login_box.cc	2013-02-09 23:36:30 +0000
+++ src/wui/login_box.cc	2013-07-25 21:12:27 +0000
@@ -18,10 +18,11 @@
  */
 
 #include "login_box.h"
+
 #include "i18n.h"
+#include "profile/profile.h"
 #include "ui_basic/button.h"
 #include "ui_basic/messagebox.h"
-#include "profile/profile.h"
 
 LoginBox::LoginBox(Panel & parent)
 :

=== modified file 'src/wui/mapviewpixelfunctions.h'
--- src/wui/mapviewpixelfunctions.h	2013-02-10 19:36:24 +0000
+++ src/wui/mapviewpixelfunctions.h	2013-07-25 21:12:27 +0000
@@ -21,7 +21,6 @@
 #define MAPVIEWPIXELFUNCTIONS_H
 
 #include "logic/widelands_geometry.h"
-
 #include "point.h"
 
 namespace Widelands {struct Map;}

=== modified file 'src/wui/multiplayersetupgroup.cc'
--- src/wui/multiplayersetupgroup.cc	2013-07-19 08:30:49 +0000
+++ src/wui/multiplayersetupgroup.cc	2013-07-25 21:12:27 +0000
@@ -19,6 +19,8 @@
 
 #include "multiplayersetupgroup.h"
 
+#include <boost/format.hpp>
+
 #include "gamesettings.h"
 #include "graphic/graphic.h"
 #include "i18n.h"
@@ -27,15 +29,12 @@
 #include "logic/player.h"
 #include "logic/tribe.h"
 #include "profile/profile.h"
-#include "wexception.h"
-
 #include "ui_basic/button.h"
 #include "ui_basic/checkbox.h"
 #include "ui_basic/icon.h"
 #include "ui_basic/scrollbar.h"
 #include "ui_basic/textarea.h"
-
-#include <boost/format.hpp>
+#include "wexception.h"
 
 struct MultiPlayerClientGroup : public UI::Box {
 	MultiPlayerClientGroup

=== modified file 'src/wui/overlay_manager.cc'
--- src/wui/overlay_manager.cc	2013-06-23 14:40:59 +0000
+++ src/wui/overlay_manager.cc	2013-07-25 21:12:27 +0000
@@ -19,10 +19,10 @@
 
 #include "overlay_manager.h"
 
+#include <algorithm>
+
+#include "graphic/graphic.h"
 #include "logic/field.h"
-#include "graphic/graphic.h"
-
-#include <algorithm>
 
 
 Overlay_Manager::Overlay_Manager() :

=== modified file 'src/wui/plot_area.cc'
--- src/wui/plot_area.cc	2013-04-20 19:12:05 +0000
+++ src/wui/plot_area.cc	2013-07-25 21:12:27 +0000
@@ -17,6 +17,9 @@
  *
  */
 
+
+#include "plot_area.h"
+
 #include <cstdio>
 
 #include <boost/format.hpp>
@@ -31,8 +34,6 @@
 #include "text_layout.h"
 #include "ui_basic/panel.h"
 
-#include "plot_area.h"
-
 using namespace std;
 using boost::format;
 

=== modified file 'src/wui/plot_area.h'
--- src/wui/plot_area.h	2013-04-20 19:12:05 +0000
+++ src/wui/plot_area.h	2013-07-25 21:12:27 +0000
@@ -20,14 +20,14 @@
 #ifndef WUI_PLOT_AREA_H
 #define WUI_PLOT_AREA_H
 
+#include <vector>
+
+#include <boost/bind.hpp>
+
+#include "rgbcolor.h"
 #include "ui_basic/panel.h"
 #include "ui_basic/slider.h"
 
-#include "rgbcolor.h"
-
-#include <boost/bind.hpp>
-#include <vector>
-
 /*
  * A Plot Area is a simple 2D Plot, with the
  * X Axis as time (actually Minus Time)

=== modified file 'src/wui/ware_statistics_menu.h'
--- src/wui/ware_statistics_menu.h	2013-04-20 19:12:05 +0000
+++ src/wui/ware_statistics_menu.h	2013-07-25 21:12:27 +0000
@@ -23,11 +23,10 @@
 #include <vector>
 
 #include "logic/widelands.h"
+#include "plot_area.h"
 #include "ui_basic/slider.h"
 #include "ui_basic/unique_window.h"
 
-#include "plot_area.h"
-
 struct DifferentialPlot_Area;
 struct Interactive_Player;
 struct WUIPlot_Area;

=== modified file 'src/wui/waresdisplay.cc'
--- src/wui/waresdisplay.cc	2013-07-23 16:34:35 +0000
+++ src/wui/waresdisplay.cc	2013-07-25 21:12:27 +0000
@@ -17,9 +17,12 @@
  *
  */
 
+#include "waresdisplay.h"
+
+#include <cstdio>
+
 #include <boost/foreach.hpp>
 #include <boost/lexical_cast.hpp>
-#include <cstdio>
 
 #include "graphic/font.h"
 #include "graphic/font_handler.h"
@@ -34,8 +37,6 @@
 #include "text_layout.h"
 #include "wexception.h"
 
-#include "waresdisplay.h"
-
 const int WARE_MENU_INFO_SIZE = 12;
 
 AbstractWaresDisplay::AbstractWaresDisplay

=== modified file 'test/richtext/render.cc'
--- test/richtext/render.cc	2013-07-21 08:07:18 +0000
+++ test/richtext/render.cc	2013-07-25 21:12:27 +0000
@@ -17,14 +17,16 @@
  *
  */
 
+#include "graphic/text/render.h"
+
 #include <fstream>
 #include <iostream>
 #include <string>
 
+#undef main // No, we do not want SDL_main
 #include <SDL.h>
-#undef main // No, we do not want SDL_main
-#include "lodepng.h"
 
+#include "from_file_image_loader.h"
 #include "graphic/image_cache.h"
 #include "graphic/render/sdl_helper.h"
 #include "graphic/render/sdl_surface.h"
@@ -32,8 +34,7 @@
 #include "graphic/text/rt_parse.h"
 #include "graphic/text/rt_render.h"
 #include "graphic/text/sdl_ttf_font.h"
-
-#include "from_file_image_loader.h"
+#include "lodepng.h"
 
 using namespace std;
 

=== removed file 'test/richtext/thin_graphic.cc'
--- test/richtext/thin_graphic.cc	2013-04-20 20:20:34 +0000
+++ test/richtext/thin_graphic.cc	1970-01-01 00:00:00 +0000
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2006-2012 by the Widelands Development Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-


Follow ups