Merge lp:~widelands-dev/widelands/bug-1332627 into lp:widelands

Proposed by SirVer
Status: Merged
Merged at revision: 7088
Proposed branch: lp:~widelands-dev/widelands/bug-1332627
Merge into: lp:widelands
Diff against target: 1173 lines (+164/-79) (has conflicts)
39 files modified
cmake/codecheck/rules/do_not_use_BOOST_noncopyable (+18/-0)
src/ai/ai_hints.h (+7/-1)
src/ai/computer_player.h (+2/-3)
src/base/macros.h (+6/-0)
src/base/scoped_timer.h (+4/-2)
src/economy/economy.h (+3/-2)
src/economy/itransport_cost_calculator.h (+4/-3)
src/editor/tools/editor_tool.h (+4/-3)
src/graphic/animation.cc (+3/-1)
src/graphic/animation.h (+4/-1)
src/graphic/font_handler1.h (+6/-4)
src/graphic/image.h (+5/-2)
src/graphic/image_cache.h (+3/-1)
src/graphic/render/gamerenderer.h (+3/-1)
src/graphic/surface.h (+5/-3)
src/graphic/surface_cache.h (+5/-1)
src/io/filesystem/filesystem.h (+0/-1)
src/io/streamread.h (+4/-3)
src/io/streamwrite.h (+3/-3)
src/logic/cookie_priority_queue.h (+4/-2)
src/logic/editor_game_base.h (+2/-3)
src/logic/expedition_bootstrap.h (+3/-3)
src/logic/immovable_program.h (+5/-2)
src/logic/instances.h (+8/-4)
src/logic/message_queue.h (+4/-3)
src/logic/player.h (+5/-2)
src/logic/production_program.h (+5/-2)
src/logic/terrain_affinity.h (+4/-3)
src/logic/tribe.h (+4/-1)
src/logic/world/editor_category.h (+3/-2)
src/logic/world/resource_description.h (+4/-3)
src/logic/world/terrain_description.h (+4/-3)
src/logic/world/world.h (+4/-1)
src/map_io/one_world_legacy_lookup_table.h (+5/-2)
src/map_io/s2map.cc (+3/-1)
src/map_io/s2map.h (+1/-0)
src/profile/profile.h (+3/-3)
src/ui_basic/panel.h (+4/-2)
src/ui_basic/unique_window.h (+0/-2)
Text conflict in src/ai/ai_hints.h
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1332627
Reviewer Review Type Date Requested Status
SirVer Needs Fixing
Review via email: mp+226628@code.launchpad.net

Description of the change

Removes boost::noncopyable and replaces it through a macro.

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

Great work!!!

- I think we should be consistent about where to place these macros.

1) Google style is to have them as the last thing in the class and always in a private statement. I like this because I am used to it and because it is already 'out there'.
2) One could argue that being not copyable is part of the public API - so it should be in the face of the user of the class (around the constructor or so). It is never that important in practice though since most classes that are designed not be copied will only be copied on accident - and it is fine if the compiler gives a warning then.

I vote for 1 with a slight variation: For c++11 it is no longer necessary for this to be in the private section of the class, so I would just state 'as last statement in your class' in the codecheck rule.

- Compile errors:

I think the problem you saw came from not delete'ing the copy constructor and operator=, but defining them and never declaring them. This is the prec++11 way of doing this macro - it has the disadvantage, that you promise the compiler to implement any constructor (the copy constructor) and so it no longer defines a default constructor for you. If you use the c++11 way:

#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&) = delete; \
void operator=(const TypeName&) = delete

it should no longer complain. If am wrong and it still does adding a `TypeName() = default;` into the class that blows up should help out.

review: Needs Fixing
Revision history for this message
GunChleoc (gunchleoc) wrote :

I did the change to the macro.

struct ITransportCostCalculator {
 virtual ~ITransportCostCalculator() {}

 virtual int32_t calc_cost_estimate(Coords, Coords) const = 0;
 DISALLOW_COPY_AND_ASSIGN(ITransportCostCalculator);
 TypeName() = default;
};

results in:

[ 5%] Building CXX object src/wui/CMakeFiles/wui.dir/actionconfirm.cc.o
In file included from /home/bratzbert/sources/widelands/bug-1332627/src/logic/map.h:31:0,
                 from /home/bratzbert/sources/widelands/bug-1332627/src/logic/editor_game_base.h:31,
                 from /home/bratzbert/sources/widelands/bug-1332627/src/logic/player.h:27,
                 from /home/bratzbert/sources/widelands/bug-1332627/src/wui/actionconfirm.cc:28:
/home/bratzbert/sources/widelands/bug-1332627/src/economy/itransport_cost_calculator.h:40:15: error: ISO C++ forbids declaration of ‘TypeName’ with no type [-fpermissive]
/home/bratzbert/sources/widelands/bug-1332627/src/economy/itransport_cost_calculator.h:40:15: error: ‘int Widelands::ITransportCostCalculator::TypeName()’ cannot be defaulted

=========================

struct ITransportCostCalculator {
 virtual ~ITransportCostCalculator() {}

 virtual int32_t calc_cost_estimate(Coords, Coords) const = 0;
 DISALLOW_COPY_AND_ASSIGN(ITransportCostCalculator);
};

results in:

[ 19%] Building CXX object src/logic/CMakeFiles/logic.dir/map.cc.o
/home/bratzbert/sources/widelands/bug-1332627/src/logic/map.cc: In constructor ‘Widelands::Map::Map()’:
/home/bratzbert/sources/widelands/bug-1332627/src/logic/map.cc:73:39: error: no matching function for call to ‘Widelands::ITransportCostCalculator::ITransportCostCalculator()’
/home/bratzbert/sources/widelands/bug-1332627/src/logic/map.cc:73:39: note: candidate is:
In file included from /home/bratzbert/sources/widelands/bug-1332627/src/logic/map.h:31:0,
                 from /home/bratzbert/sources/widelands/bug-1332627/src/logic/map.cc:20:
/home/bratzbert/sources/widelands/bug-1332627/src/economy/itransport_cost_calculator.h:39:2: note: Widelands::ITransportCostCalculator::ITransportCostCalculator(const Widelands::ITransportCostCalculator&) <deleted>
/home/bratzbert/sources/widelands/bug-1332627/src/economy/itransport_cost_calculator.h:39:2: note: candidate expects 1 argument, 0 provided

Revision history for this message
SirVer (sirver) wrote :

 TypeName() = default; should be here
ITransportCostCalculator() = default

And I was wrong in my first comment. It is needed when the copy constructor is deleted.

Revision history for this message
GunChleoc (gunchleoc) wrote :

src/wui/unique_window_handler.h creates a linking problem. so I reverted it. All the rest are done. Please double-check the codecheck rule.

Revision history for this message
SirVer (sirver) wrote :

Awesome! Merged. I tweaked the codecheck rule and fixed the remaining boost::noncopyable. The linking error probably came from not fixing the dependencies in the CMakeLists.txt files. make codecheck lists those.

Revision history for this message
SirVer (sirver) wrote :

On second thought, that cannot really explain linker errors. If you still have them after a make clean please open a bug report and we'll investigate.

Revision history for this message
GunChleoc (gunchleoc) wrote :

I merged it into another branch and it worked :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'cmake/codecheck/rules/do_not_use_BOOST_noncopyable'
--- cmake/codecheck/rules/do_not_use_BOOST_noncopyable 1970-01-01 00:00:00 +0000
+++ cmake/codecheck/rules/do_not_use_BOOST_noncopyable 2014-07-14 19:24:49 +0000
@@ -0,0 +1,18 @@
1#!/usr/bin/python
2
3"""
4Prefer DEBUG.
5"""
6
7error_msg="Do not inherit from boost::noncopyable. Instead #include \"base/macros.h\" and add \"DISALLOW_COPY_AND_ASSIGN(<Objectname>);\" to the private section of the object or type."
8
9regexp=r"""(^#include.*boost.noncopyable\.hpp|noncopyable)"""
10
11forbidden = [
12 "#include <boost/noncopyable.hpp>",
13 "noncopyable"
14]
15
16allowed = [
17 "DISALLOW_COPY_AND_ASSIGN",
18]
019
=== modified file 'src/ai/ai_hints.h'
--- src/ai/ai_hints.h 2014-07-14 07:31:18 +0000
+++ src/ai/ai_hints.h 2014-07-14 19:24:49 +0000
@@ -21,14 +21,19 @@
21#define WL_AI_AI_HINTS_H21#define WL_AI_AI_HINTS_H
2222
23#include <stdint.h>23#include <stdint.h>
24<<<<<<< TREE
24#include <boost/noncopyable.hpp>25#include <boost/noncopyable.hpp>
26=======
27
28#include "base/macros.h"
29>>>>>>> MERGE-SOURCE
2530
26class Section;31class Section;
2732
28/// This struct is used to read out the data given in [aihints] section of a33/// This struct is used to read out the data given in [aihints] section of a
29/// buildings conf file. It is used to tell the computer player about the34/// buildings conf file. It is used to tell the computer player about the
30/// special properties of a building.35/// special properties of a building.
31struct BuildingHints : boost::noncopyable {36struct BuildingHints {
32 BuildingHints(Section*);37 BuildingHints(Section*);
33 ~BuildingHints();38 ~BuildingHints();
3439
@@ -110,6 +115,7 @@
110 bool fighting_;115 bool fighting_;
111 bool mountain_conqueror_;116 bool mountain_conqueror_;
112 uint8_t mines_percent_;117 uint8_t mines_percent_;
118 DISALLOW_COPY_AND_ASSIGN(BuildingHints);
113};119};
114120
115#endif // end of include guard: WL_AI_AI_HINTS_H121#endif // end of include guard: WL_AI_AI_HINTS_H
116122
=== modified file 'src/ai/computer_player.h'
--- src/ai/computer_player.h 2014-07-05 16:41:51 +0000
+++ src/ai/computer_player.h 2014-07-14 19:24:49 +0000
@@ -20,8 +20,7 @@
20#ifndef WL_AI_COMPUTER_PLAYER_H20#ifndef WL_AI_COMPUTER_PLAYER_H
21#define WL_AI_COMPUTER_PLAYER_H21#define WL_AI_COMPUTER_PLAYER_H
2222
23#include <boost/noncopyable.hpp>23#include "base/macros.h"
24
25#include "logic/game.h"24#include "logic/game.h"
26#include "logic/notification.h"25#include "logic/notification.h"
2726
@@ -32,7 +31,6 @@
32 * \ref Implementation interface.31 * \ref Implementation interface.
33 */32 */
34struct Computer_Player :33struct Computer_Player :
35 boost::noncopyable,
36 Widelands::NoteReceiver<Widelands::NoteImmovable>,34 Widelands::NoteReceiver<Widelands::NoteImmovable>,
37 Widelands::NoteReceiver<Widelands::NoteFieldPossession>35 Widelands::NoteReceiver<Widelands::NoteFieldPossession>
38{36{
@@ -74,6 +72,7 @@
74private:72private:
75 Widelands::Game & m_game;73 Widelands::Game & m_game;
76 Widelands::Player_Number const m_player_number;74 Widelands::Player_Number const m_player_number;
75 DISALLOW_COPY_AND_ASSIGN(Computer_Player);
77};76};
7877
79#endif // end of include guard: WL_AI_COMPUTER_PLAYER_H78#endif // end of include guard: WL_AI_COMPUTER_PLAYER_H
8079
=== modified file 'src/base/macros.h'
--- src/base/macros.h 2014-07-05 16:41:51 +0000
+++ src/base/macros.h 2014-07-14 19:24:49 +0000
@@ -65,6 +65,12 @@
65#define DIAG_OFF(x) GCC_DIAG_OFF(x) CLANG_DIAG_OFF(x)65#define DIAG_OFF(x) GCC_DIAG_OFF(x) CLANG_DIAG_OFF(x)
66#define DIAG_ON(x) GCC_DIAG_ON(x) CLANG_DIAG_ON(x)66#define DIAG_ON(x) GCC_DIAG_ON(x) CLANG_DIAG_ON(x)
6767
68// disallow copying or assigning a class
69#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
70TypeName(const TypeName&) = delete; \
71void operator=(const TypeName&) = delete
72
73
68/// Wrapper macro around a dynamic_cast.74/// Wrapper macro around a dynamic_cast.
69#define upcast(type, identifier, source) type * const identifier = \75#define upcast(type, identifier, source) type * const identifier = \
70dynamic_cast<type *>(source)76dynamic_cast<type *>(source)
7177
=== modified file 'src/base/scoped_timer.h'
--- src/base/scoped_timer.h 2014-07-05 16:41:51 +0000
+++ src/base/scoped_timer.h 2014-07-14 19:24:49 +0000
@@ -23,13 +23,13 @@
23#include <string>23#include <string>
24#include <stdint.h>24#include <stdint.h>
2525
26#include <boost/noncopyable.hpp>26#include "base/macros.h"
2727
28/**28/**
29 * A cheap timer class that can be queried for timings and will print out29 * A cheap timer class that can be queried for timings and will print out
30 * it's total time in existence on destruction.30 * it's total time in existence on destruction.
31 */31 */
32class ScopedTimer : boost::noncopyable {32class ScopedTimer {
33public:33public:
34 // Takes the output message that will be boost::format() with the total time34 // Takes the output message that will be boost::format() with the total time
35 // this object existed (in ms, use %u).35 // this object existed (in ms, use %u).
@@ -44,6 +44,8 @@
44private:44private:
45 std::string message_;45 std::string message_;
46 uint32_t startime_, lasttime_;46 uint32_t startime_, lasttime_;
47
48 DISALLOW_COPY_AND_ASSIGN(ScopedTimer);
47};49};
4850
49#endif // end of include guard: WL_BASE_SCOPED_TIMER_H51#endif // end of include guard: WL_BASE_SCOPED_TIMER_H
5052
=== modified file 'src/economy/economy.h'
--- src/economy/economy.h 2014-07-05 16:41:51 +0000
+++ src/economy/economy.h 2014-07-14 19:24:49 +0000
@@ -27,6 +27,7 @@
27#include <boost/function.hpp>27#include <boost/function.hpp>
28#include <boost/utility.hpp>28#include <boost/utility.hpp>
2929
30#include "base/macros.h"
30#include "logic/instances.h"31#include "logic/instances.h"
31#include "logic/warelist.h"32#include "logic/warelist.h"
32#include "logic/wareworker.h"33#include "logic/wareworker.h"
@@ -71,7 +72,7 @@
71 * connected by roads or the seafaring network - though of course, most code operates72 * connected by roads or the seafaring network - though of course, most code operates
72 * on the assumption that they are, with fallbacks for when they aren't.73 * on the assumption that they are, with fallbacks for when they aren't.
73 */74 */
74class Economy : boost::noncopyable {75class Economy {
75public:76public:
76 friend class EconomyDataPacket;77 friend class EconomyDataPacket;
7778
@@ -182,7 +183,7 @@
182183
183 void rebalance_supply() {_start_request_timer();}184 void rebalance_supply() {_start_request_timer();}
184185
185private:186 DISALLOW_COPY_AND_ASSIGN(Economy);
186/*************/187/*************/
187/* Functions */188/* Functions */
188/*************/189/*************/
189190
=== modified file 'src/economy/itransport_cost_calculator.h'
--- src/economy/itransport_cost_calculator.h 2014-07-05 16:41:51 +0000
+++ src/economy/itransport_cost_calculator.h 2014-07-14 19:24:49 +0000
@@ -20,8 +20,7 @@
20#ifndef WL_ECONOMY_ITRANSPORT_COST_CALCULATOR_H20#ifndef WL_ECONOMY_ITRANSPORT_COST_CALCULATOR_H
21#define WL_ECONOMY_ITRANSPORT_COST_CALCULATOR_H21#define WL_ECONOMY_ITRANSPORT_COST_CALCULATOR_H
2222
23#include <boost/noncopyable.hpp>23#include "base/macros.h"
24
25#include "logic/widelands_geometry.h"24#include "logic/widelands_geometry.h"
2625
27namespace Widelands {26namespace Widelands {
@@ -33,10 +32,12 @@
33 * At the time of this writing, Map implements all of this functionality32 * At the time of this writing, Map implements all of this functionality
34 * but most economy code doesn't need all of maps functionality33 * but most economy code doesn't need all of maps functionality
35 */34 */
36struct ITransportCostCalculator : boost::noncopyable {35struct ITransportCostCalculator {
36 ITransportCostCalculator() = default;
37 virtual ~ITransportCostCalculator() {}37 virtual ~ITransportCostCalculator() {}
3838
39 virtual int32_t calc_cost_estimate(Coords, Coords) const = 0;39 virtual int32_t calc_cost_estimate(Coords, Coords) const = 0;
40 DISALLOW_COPY_AND_ASSIGN(ITransportCostCalculator);
40};41};
4142
42}43}
4344
=== modified file 'src/editor/tools/editor_tool.h'
--- src/editor/tools/editor_tool.h 2014-07-05 16:41:51 +0000
+++ src/editor/tools/editor_tool.h 2014-07-14 19:24:49 +0000
@@ -22,8 +22,7 @@
2222
23#define MAX_TOOL_AREA 923#define MAX_TOOL_AREA 9
2424
25#include <boost/noncopyable.hpp>25#include "base/macros.h"
26
27#include "editor/tools/editor_action_args.h"26#include "editor/tools/editor_action_args.h"
28#include "logic/widelands_geometry.h"27#include "logic/widelands_geometry.h"
2928
@@ -39,7 +38,7 @@
39 * one function (like delete_building, place building, modify building are 338 * one function (like delete_building, place building, modify building are 3
40 * tools).39 * tools).
41 */40 */
42class Editor_Tool : boost::noncopyable {41class Editor_Tool {
43public:42public:
44 Editor_Tool(Editor_Tool & second, Editor_Tool & third, bool uda = true) :43 Editor_Tool(Editor_Tool & second, Editor_Tool & third, bool uda = true) :
45 m_second(second), m_third(third), undoable(uda)44 m_second(second), m_third(third), undoable(uda)
@@ -102,6 +101,8 @@
102protected:101protected:
103 Editor_Tool & m_second, & m_third;102 Editor_Tool & m_second, & m_third;
104 bool undoable;103 bool undoable;
104
105 DISALLOW_COPY_AND_ASSIGN(Editor_Tool);
105};106};
106107
107#endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_TOOL_H108#endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_TOOL_H
108109
=== modified file 'src/graphic/animation.cc'
--- src/graphic/animation.cc 2014-07-12 20:37:13 +0000
+++ src/graphic/animation.cc 2014-07-14 19:24:49 +0000
@@ -33,6 +33,7 @@
33#include "base/deprecated.h"33#include "base/deprecated.h"
34#include "base/i18n.h"34#include "base/i18n.h"
35#include "base/log.h"35#include "base/log.h"
36#include "base/macros.h"
36#include "base/wexception.h"37#include "base/wexception.h"
37#include "graphic/diranimations.h"38#include "graphic/diranimations.h"
38#include "graphic/graphic.h"39#include "graphic/graphic.h"
@@ -55,7 +56,7 @@
55namespace {56namespace {
5657
57/// A class that makes iteration over filename_?.png templates easy.58/// A class that makes iteration over filename_?.png templates easy.
58class NumberGlob : boost::noncopyable {59class NumberGlob {
59public:60public:
60 typedef uint32_t type;61 typedef uint32_t type;
61 NumberGlob(const std::string& pictmp);62 NumberGlob(const std::string& pictmp);
@@ -69,6 +70,7 @@
69 std::string replstr_;70 std::string replstr_;
70 uint32_t cur_;71 uint32_t cur_;
71 uint32_t max_;72 uint32_t max_;
73 DISALLOW_COPY_AND_ASSIGN(NumberGlob);
72};74};
7375
74/**76/**
7577
=== modified file 'src/graphic/animation.h'
--- src/graphic/animation.h 2014-07-05 16:41:51 +0000
+++ src/graphic/animation.h 2014-07-14 19:24:49 +0000
@@ -27,6 +27,7 @@
2727
28#include <boost/utility.hpp>28#include <boost/utility.hpp>
2929
30#include "base/macros.h"
30#include "base/point.h"31#include "base/point.h"
31#include "base/rect.h"32#include "base/rect.h"
3233
@@ -48,7 +49,7 @@
48 * The dimensions of an animation is constant and can not change from frame to49 * The dimensions of an animation is constant and can not change from frame to
49 * frame.50 * frame.
50 */51 */
51class Animation : boost::noncopyable {52class Animation {
52public:53public:
53 Animation() {}54 Animation() {}
54 virtual ~Animation() {}55 virtual ~Animation() {}
@@ -87,6 +88,8 @@
8788
88 /// Play the sound effect associated with this animation at the given time.89 /// Play the sound effect associated with this animation at the given time.
89 virtual void trigger_soundfx(uint32_t time, uint32_t stereo_position) const = 0;90 virtual void trigger_soundfx(uint32_t time, uint32_t stereo_position) const = 0;
91
92 DISALLOW_COPY_AND_ASSIGN(Animation);
90};93};
9194
92/**95/**
9396
=== modified file 'src/graphic/font_handler1.h'
--- src/graphic/font_handler1.h 2014-07-05 19:33:23 +0000
+++ src/graphic/font_handler1.h 2014-07-14 19:24:49 +0000
@@ -23,10 +23,10 @@
2323
24#include <string>24#include <string>
2525
26#include <boost/noncopyable.hpp>26#include "base/macros.h"
2727#include "base/point.h"
28#include "graphic/align.h"28#include "graphic/align.h"
29#include "base/point.h"29
3030
31class FileSystem;31class FileSystem;
32class Image;32class Image;
@@ -37,8 +37,9 @@
37/**37/**
38 * Main class for string rendering. Manages the cache of pre-rendered strings.38 * Main class for string rendering. Manages the cache of pre-rendered strings.
39 */39 */
40class IFont_Handler1 : boost::noncopyable {40class IFont_Handler1 {
41public:41public:
42 IFont_Handler1() = default;
42 virtual ~IFont_Handler1() {}43 virtual ~IFont_Handler1() {}
4344
44 /*45 /*
@@ -46,6 +47,7 @@
46 * ownership remains with this class. Will throw on error.47 * ownership remains with this class. Will throw on error.
47 */48 */
48 virtual const Image* render(const std::string& text, uint16_t w = 0) = 0;49 virtual const Image* render(const std::string& text, uint16_t w = 0) = 0;
50 DISALLOW_COPY_AND_ASSIGN(IFont_Handler1);
49};51};
5052
51// Create a new Font_Handler1. Ownership for the objects is not taken.53// Create a new Font_Handler1. Ownership for the objects is not taken.
5254
=== modified file 'src/graphic/image.h'
--- src/graphic/image.h 2014-07-05 16:41:51 +0000
+++ src/graphic/image.h 2014-07-14 19:24:49 +0000
@@ -22,17 +22,19 @@
2222
23#include <string>23#include <string>
2424
25#include <boost/noncopyable.hpp>
26#include <stdint.h>25#include <stdint.h>
2726
27#include "base/macros.h"
28
28/**29/**
29 * Interface to a bitmap that can act as the source of a rendering30 * Interface to a bitmap that can act as the source of a rendering
30 * operation.31 * operation.
31 */32 */
32class Surface;33class Surface;
3334
34class Image : boost::noncopyable {35class Image {
35public:36public:
37 Image() = default;
36 virtual ~Image() {}38 virtual ~Image() {}
3739
38 virtual uint16_t width() const = 0;40 virtual uint16_t width() const = 0;
@@ -41,6 +43,7 @@
41 // Internal functions needed for caching.43 // Internal functions needed for caching.
42 virtual Surface* surface() const = 0;44 virtual Surface* surface() const = 0;
43 virtual const std::string& hash() const = 0;45 virtual const std::string& hash() const = 0;
46 DISALLOW_COPY_AND_ASSIGN(Image);
44};47};
4548
4649
4750
=== modified file 'src/graphic/image_cache.h'
--- src/graphic/image_cache.h 2014-07-05 19:33:23 +0000
+++ src/graphic/image_cache.h 2014-07-14 19:24:49 +0000
@@ -25,6 +25,7 @@
2525
26#include <boost/utility.hpp>26#include <boost/utility.hpp>
2727
28#include "base/macros.h"
28#include "graphic/image.h"29#include "graphic/image.h"
2930
30class SurfaceCache;31class SurfaceCache;
@@ -36,7 +37,7 @@
36// its hash is not found. Other parts of Widelands will create images when they37// its hash is not found. Other parts of Widelands will create images when they
37// do not exist in the cache yet and then put it into the cache and therefore38// do not exist in the cache yet and then put it into the cache and therefore
38// releasing their ownership.39// releasing their ownership.
39class ImageCache : boost::noncopyable {40class ImageCache {
40public:41public:
41 // Does not take ownership.42 // Does not take ownership.
42 ImageCache(SurfaceCache* surface_cache);43 ImageCache(SurfaceCache* surface_cache);
@@ -60,6 +61,7 @@
6061
61 ImageMap images_; /// hash of cached filename/image pairs62 ImageMap images_; /// hash of cached filename/image pairs
62 SurfaceCache* const surface_cache_; // Not owned.63 SurfaceCache* const surface_cache_; // Not owned.
64 DISALLOW_COPY_AND_ASSIGN(ImageCache);
63};65};
6466
65#endif // end of include guard: WL_GRAPHIC_IMAGE_CACHE_H67#endif // end of include guard: WL_GRAPHIC_IMAGE_CACHE_H
6668
=== modified file 'src/graphic/render/gamerenderer.h'
--- src/graphic/render/gamerenderer.h 2014-07-05 16:41:51 +0000
+++ src/graphic/render/gamerenderer.h 2014-07-14 19:24:49 +0000
@@ -22,6 +22,7 @@
2222
23#include <boost/utility.hpp>23#include <boost/utility.hpp>
2424
25#include "base/macros.h"
25#include "base/point.h"26#include "base/point.h"
2627
27namespace Widelands {28namespace Widelands {
@@ -41,7 +42,7 @@
41 * so that target-specific optimizations (such as caching data) can42 * so that target-specific optimizations (such as caching data) can
42 * be effective.43 * be effective.
43 */44 */
44class GameRenderer : boost::noncopyable {45class GameRenderer {
45public:46public:
46 GameRenderer();47 GameRenderer();
47 virtual ~GameRenderer();48 virtual ~GameRenderer();
@@ -94,6 +95,7 @@
9495
95private:96private:
96 void draw_wrapper();97 void draw_wrapper();
98 DISALLOW_COPY_AND_ASSIGN(GameRenderer);
97};99};
98100
99#endif // end of include guard: WL_GRAPHIC_RENDER_GAMERENDERER_H101#endif // end of include guard: WL_GRAPHIC_RENDER_GAMERENDERER_H
100102
=== modified file 'src/graphic/surface.h'
--- src/graphic/surface.h 2014-07-05 19:33:23 +0000
+++ src/graphic/surface.h 2014-07-14 19:24:49 +0000
@@ -20,8 +20,7 @@
20#ifndef WL_GRAPHIC_SURFACE_H20#ifndef WL_GRAPHIC_SURFACE_H
21#define WL_GRAPHIC_SURFACE_H21#define WL_GRAPHIC_SURFACE_H
2222
23#include <boost/noncopyable.hpp>23#include "base/macros.h"
24
25#include "base/rect.h"24#include "base/rect.h"
26#include "graphic/color.h"25#include "graphic/color.h"
27#include "graphic/compositemode.h"26#include "graphic/compositemode.h"
@@ -30,7 +29,7 @@
30 * Interface to a basic surfaces that can be used as destination for blitting and drawing.29 * Interface to a basic surfaces that can be used as destination for blitting and drawing.
31 * It also allows low level pixel access.30 * It also allows low level pixel access.
32 */31 */
33class Surface : boost::noncopyable {32class Surface {
34public:33public:
35 // Surfaces can either be converted to display format on creation or kept in34 // Surfaces can either be converted to display format on creation or kept in
36 // the format they were created. The only reason not to convert to display35 // the format they were created. The only reason not to convert to display
@@ -46,6 +45,7 @@
46 // dimensions.45 // dimensions.
47 static Surface* create(uint16_t w, uint16_t h);46 static Surface* create(uint16_t w, uint16_t h);
4847
48 Surface() = default;
49 virtual ~Surface() {}49 virtual ~Surface() {}
5050
51 /// Dimensions.51 /// Dimensions.
@@ -135,6 +135,8 @@
135 * \warning May only be called inside lock/unlock pairs.135 * \warning May only be called inside lock/unlock pairs.
136 */136 */
137 virtual uint8_t * get_pixels() const = 0;137 virtual uint8_t * get_pixels() const = 0;
138
139 DISALLOW_COPY_AND_ASSIGN(Surface);
138};140};
139141
140#endif // end of include guard: WL_GRAPHIC_SURFACE_H142#endif // end of include guard: WL_GRAPHIC_SURFACE_H
141143
=== modified file 'src/graphic/surface_cache.h'
--- src/graphic/surface_cache.h 2014-07-05 16:41:51 +0000
+++ src/graphic/surface_cache.h 2014-07-14 19:24:49 +0000
@@ -24,6 +24,8 @@
2424
25#include <boost/utility.hpp>25#include <boost/utility.hpp>
2626
27#include "base/macros.h"
28
27class Surface;29class Surface;
2830
29// Caches Surfaces. It contains surfaces which must not be deleted and31// Caches Surfaces. It contains surfaces which must not be deleted and
@@ -33,7 +35,7 @@
33// Nobody in Widelands should hold onto a Surface they get from this class,35// Nobody in Widelands should hold onto a Surface they get from this class,
34// instead, they should use it only temporarily and rerequest it whenever they36// instead, they should use it only temporarily and rerequest it whenever they
35// need it.37// need it.
36class SurfaceCache : boost::noncopyable {38class SurfaceCache {
37public:39public:
38 SurfaceCache() {}40 SurfaceCache() {}
39 virtual ~SurfaceCache() {}41 virtual ~SurfaceCache() {}
@@ -50,6 +52,8 @@
50 // automatically - use this if surfaces are around for a long time and52 // automatically - use this if surfaces are around for a long time and
51 // recreation is expensive (i.e. images loaded from disk).53 // recreation is expensive (i.e. images loaded from disk).
52 virtual Surface* insert(const std::string& hash, Surface*, bool transient) = 0;54 virtual Surface* insert(const std::string& hash, Surface*, bool transient) = 0;
55
56 DISALLOW_COPY_AND_ASSIGN(SurfaceCache);
53};57};
5458
55// Create a new Cache whichs combined pixels in all transient surfaces are59// Create a new Cache whichs combined pixels in all transient surfaces are
5660
=== modified file 'src/io/filesystem/filesystem.h'
--- src/io/filesystem/filesystem.h 2014-07-05 16:41:51 +0000
+++ src/io/filesystem/filesystem.h 2014-07-14 19:24:49 +0000
@@ -28,7 +28,6 @@
28#include <vector>28#include <vector>
2929
30#include <stdint.h>30#include <stdint.h>
31#include <boost/noncopyable.hpp>
3231
33#include "io/filesystem/filesystem_exceptions.h"32#include "io/filesystem/filesystem_exceptions.h"
3433
3534
=== modified file 'src/io/streamread.h'
--- src/io/streamread.h 2014-07-05 16:41:51 +0000
+++ src/io/streamread.h 2014-07-14 19:24:49 +0000
@@ -23,8 +23,7 @@
23#include <cstring>23#include <cstring>
24#include <string>24#include <string>
2525
26#include <boost/noncopyable.hpp>26#include "base/macros.h"
27
28#include "base/wexception.h"27#include "base/wexception.h"
29#include "machdep.h"28#include "machdep.h"
3029
@@ -42,7 +41,7 @@
42 *41 *
43 * Convenience functions are provided for many data types.42 * Convenience functions are provided for many data types.
44 */43 */
45class StreamRead : boost::noncopyable {44class StreamRead {
46public:45public:
47 explicit StreamRead() {}46 explicit StreamRead() {}
48 virtual ~StreamRead();47 virtual ~StreamRead();
@@ -77,6 +76,8 @@
77 _data_error(char const * const fmt, ...) PRINTF_FORMAT(2, 3);76 _data_error(char const * const fmt, ...) PRINTF_FORMAT(2, 3);
78 };77 };
79#define data_error(...) _data_error(__VA_ARGS__)78#define data_error(...) _data_error(__VA_ARGS__)
79
80 DISALLOW_COPY_AND_ASSIGN(StreamRead);
80};81};
8182
82#endif // end of include guard: WL_IO_STREAMREAD_H83#endif // end of include guard: WL_IO_STREAMREAD_H
8384
=== modified file 'src/io/streamwrite.h'
--- src/io/streamwrite.h 2014-07-05 16:41:51 +0000
+++ src/io/streamwrite.h 2014-07-14 19:24:49 +0000
@@ -25,8 +25,6 @@
25#include <limits>25#include <limits>
26#include <string>26#include <string>
2727
28#include <boost/noncopyable.hpp>
29
30#include "base/macros.h"28#include "base/macros.h"
31#include "machdep.h"29#include "machdep.h"
3230
@@ -40,7 +38,7 @@
40 *38 *
41 * Convenience functions are provided for many data types.39 * Convenience functions are provided for many data types.
42 */40 */
43class StreamWrite : boost::noncopyable {41class StreamWrite {
44public:42public:
45 explicit StreamWrite() {}43 explicit StreamWrite() {}
46 virtual ~StreamWrite();44 virtual ~StreamWrite();
@@ -90,6 +88,8 @@
90 // Write strings without null terminator.88 // Write strings without null terminator.
91 void Text (char const * const x) {Data(x, strlen(x));}89 void Text (char const * const x) {Data(x, strlen(x));}
92 void Text (const std::string & x) {Data(x.c_str(), x.size());}90 void Text (const std::string & x) {Data(x.c_str(), x.size());}
91
92 DISALLOW_COPY_AND_ASSIGN(StreamWrite);
93};93};
9494
95#endif // end of include guard: WL_IO_STREAMWRITE_H95#endif // end of include guard: WL_IO_STREAMWRITE_H
9696
=== modified file 'src/logic/cookie_priority_queue.h'
--- src/logic/cookie_priority_queue.h 2014-07-05 16:41:51 +0000
+++ src/logic/cookie_priority_queue.h 2014-07-14 19:24:49 +0000
@@ -25,7 +25,7 @@
25#include <limits>25#include <limits>
26#include <vector>26#include <vector>
2727
28#include <boost/noncopyable.hpp>28#include "base/macros.h"
2929
30template<typename _Type>30template<typename _Type>
31struct default_cookie_accessor;31struct default_cookie_accessor;
@@ -36,7 +36,7 @@
36 typedef std::vector<type *> container;36 typedef std::vector<type *> container;
37 typedef typename container::size_type size_type;37 typedef typename container::size_type size_type;
3838
39 struct cookie : boost::noncopyable {39 struct cookie {
40 cookie() : pos(bad_pos()) {}40 cookie() : pos(bad_pos()) {}
41 ~cookie() {}41 ~cookie() {}
4242
@@ -47,6 +47,8 @@
47 friend struct cookie_priority_queue_base<_Type>;47 friend struct cookie_priority_queue_base<_Type>;
4848
49 size_type pos;49 size_type pos;
50
51 DISALLOW_COPY_AND_ASSIGN(cookie);
50 };52 };
5153
52protected:54protected:
5355
=== modified file 'src/logic/editor_game_base.h'
--- src/logic/editor_game_base.h 2014-07-14 07:31:18 +0000
+++ src/logic/editor_game_base.h 2014-07-14 19:24:49 +0000
@@ -25,8 +25,7 @@
25#include <string>25#include <string>
26#include <vector>26#include <vector>
2727
28#include <boost/noncopyable.hpp>28#include "base/macros.h"
29
30#include "logic/bob.h"29#include "logic/bob.h"
31#include "logic/building.h"30#include "logic/building.h"
32#include "logic/map.h"31#include "logic/map.h"
@@ -55,7 +54,6 @@
55struct AttackController;54struct AttackController;
5655
57class Editor_Game_Base :56class Editor_Game_Base :
58 boost::noncopyable,
59 NoteReceiver<NoteImmovable>,57 NoteReceiver<NoteImmovable>,
60 NoteReceiver<NoteFieldPossession>,58 NoteReceiver<NoteFieldPossession>,
61 NoteReceiver<NoteFieldTransformed>59 NoteReceiver<NoteFieldTransformed>
@@ -222,6 +220,7 @@
222 bool neutral_when_competing_influence = false,220 bool neutral_when_competing_influence = false,
223 bool conquer_guarded_location_by_superior_influence = false);221 bool conquer_guarded_location_by_superior_influence = false);
224 void cleanup_playerimmovables_area(Player_Area<Area<FCoords> >);222 void cleanup_playerimmovables_area(Player_Area<Area<FCoords> >);
223 DISALLOW_COPY_AND_ASSIGN(Editor_Game_Base);
225};224};
226225
227#define iterate_players_existing(p, nr_players, egbase, player) \226#define iterate_players_existing(p, nr_players, egbase, player) \
228227
=== modified file 'src/logic/expedition_bootstrap.h'
--- src/logic/expedition_bootstrap.h 2014-07-05 16:41:51 +0000
+++ src/logic/expedition_bootstrap.h 2014-07-14 19:24:49 +0000
@@ -23,8 +23,7 @@
23#include <vector>23#include <vector>
24#include <memory>24#include <memory>
2525
26#include <boost/noncopyable.hpp>26#include "base/macros.h"
27
28#include "economy/wares_queue.h"27#include "economy/wares_queue.h"
2928
30namespace Widelands {29namespace Widelands {
@@ -43,7 +42,7 @@
43// Handles the mustering of workers and wares in a port for one Expedition. This42// Handles the mustering of workers and wares in a port for one Expedition. This
44// object is created in the port dock as soon as the start expedition button is43// object is created in the port dock as soon as the start expedition button is
45// pressed. As soon as the ship is loaded, this object gets destroyed.44// pressed. As soon as the ship is loaded, this object gets destroyed.
46class ExpeditionBootstrap : boost::noncopyable {45class ExpeditionBootstrap {
47public:46public:
48 ExpeditionBootstrap(PortDock* const portdock);47 ExpeditionBootstrap(PortDock* const portdock);
49 virtual ~ExpeditionBootstrap();48 virtual ~ExpeditionBootstrap();
@@ -97,6 +96,7 @@
9796
98 std::vector<std::unique_ptr<WaresQueue>> wares_;97 std::vector<std::unique_ptr<WaresQueue>> wares_;
99 std::vector<std::unique_ptr<ExpeditionWorker>> workers_;98 std::vector<std::unique_ptr<ExpeditionWorker>> workers_;
99 DISALLOW_COPY_AND_ASSIGN(ExpeditionBootstrap);
100};100};
101101
102} // namespace Widelands102} // namespace Widelands
103103
=== modified file 'src/logic/immovable_program.h'
--- src/logic/immovable_program.h 2014-07-05 16:41:51 +0000
+++ src/logic/immovable_program.h 2014-07-14 19:24:49 +0000
@@ -23,7 +23,7 @@
23#include <cstring>23#include <cstring>
24#include <string>24#include <string>
2525
26#include <boost/noncopyable.hpp>26#include "base/macros.h"
2727
28/*28/*
29 * Implementation is in immovable.cc29 * Implementation is in immovable.cc
@@ -40,9 +40,12 @@
40struct ImmovableProgram {40struct ImmovableProgram {
4141
42 /// Can be executed on an Immovable.42 /// Can be executed on an Immovable.
43 struct Action : boost::noncopyable {43 struct Action {
44 Action() = default;
44 virtual ~Action();45 virtual ~Action();
45 virtual void execute(Game &, Immovable &) const = 0;46 virtual void execute(Game &, Immovable &) const = 0;
47
48 DISALLOW_COPY_AND_ASSIGN(Action);
46 };49 };
4750
48 /// Runs an animation.51 /// Runs an animation.
4952
=== modified file 'src/logic/instances.h'
--- src/logic/instances.h 2014-07-05 16:41:51 +0000
+++ src/logic/instances.h 2014-07-14 19:24:49 +0000
@@ -27,7 +27,6 @@
27#include <vector>27#include <vector>
2828
29#include <boost/function.hpp>29#include <boost/function.hpp>
30#include <boost/noncopyable.hpp>
31#include <boost/unordered_map.hpp>30#include <boost/unordered_map.hpp>
32#include <boost/signals2.hpp>31#include <boost/signals2.hpp>
3332
@@ -53,7 +52,7 @@
53 * Base class for descriptions of worker, files and so on. This must just52 * Base class for descriptions of worker, files and so on. This must just
54 * link them together53 * link them together
55 */54 */
56struct Map_Object_Descr : boost::noncopyable {55struct Map_Object_Descr {
57 Map_Object_Descr(const std::string& init_name, const std::string& init_descname)56 Map_Object_Descr(const std::string& init_name, const std::string& init_descname)
58 : m_name(init_name), m_descname(init_descname) {57 : m_name(init_name), m_descname(init_descname) {
59 }58 }
@@ -102,6 +101,7 @@
102 static uint32_t s_dyn_attribhigh; ///< highest attribute ID used101 static uint32_t s_dyn_attribhigh; ///< highest attribute ID used
103 static AttribMap s_dyn_attribs;102 static AttribMap s_dyn_attribs;
104103
104 DISALLOW_COPY_AND_ASSIGN(Map_Object_Descr);
105};105};
106106
107/**107/**
@@ -148,7 +148,7 @@
148 return ref_cast<type const, Map_Object_Descr const>(*m_descr); \148 return ref_cast<type const, Map_Object_Descr const>(*m_descr); \
149 } \149 } \
150150
151class Map_Object : boost::noncopyable {151class Map_Object {
152 friend struct Object_Manager;152 friend struct Object_Manager;
153 friend struct Object_Ptr;153 friend struct Object_Ptr;
154154
@@ -326,6 +326,8 @@
326 const Map_Object_Descr * m_descr;326 const Map_Object_Descr * m_descr;
327 Serial m_serial;327 Serial m_serial;
328 LogSink * m_logsink;328 LogSink * m_logsink;
329
330 DISALLOW_COPY_AND_ASSIGN(Map_Object);
329};331};
330332
331inline int32_t get_reverse_dir(int32_t const dir) {333inline int32_t get_reverse_dir(int32_t const dir) {
@@ -337,7 +339,7 @@
337 *339 *
338 * Keeps the list of all objects currently in the game.340 * Keeps the list of all objects currently in the game.
339 */341 */
340struct Object_Manager : boost::noncopyable {342struct Object_Manager {
341 typedef boost::unordered_map<Serial, Map_Object *> objmap_t;343 typedef boost::unordered_map<Serial, Map_Object *> objmap_t;
342344
343 Object_Manager() {m_lastserial = 0;}345 Object_Manager() {m_lastserial = 0;}
@@ -374,6 +376,8 @@
374private:376private:
375 Serial m_lastserial;377 Serial m_lastserial;
376 objmap_t m_objects;378 objmap_t m_objects;
379
380 DISALLOW_COPY_AND_ASSIGN(Object_Manager);
377};381};
378382
379/**383/**
380384
=== modified file 'src/logic/message_queue.h'
--- src/logic/message_queue.h 2014-07-05 16:41:51 +0000
+++ src/logic/message_queue.h 2014-07-14 19:24:49 +0000
@@ -23,14 +23,13 @@
23#include <cassert>23#include <cassert>
24#include <map>24#include <map>
2525
26#include <boost/noncopyable.hpp>26#include "base/macros.h"
27
28#include "logic/message.h"27#include "logic/message.h"
29#include "logic/message_id.h"28#include "logic/message_id.h"
3029
31namespace Widelands {30namespace Widelands {
3231
33struct MessageQueue : boost::noncopyable, private std::map<Message_Id, Message *> {32struct MessageQueue : private std::map<Message_Id, Message *> {
34 friend class Map_Players_Messages_Data_Packet;33 friend class Map_Players_Messages_Data_Packet;
35 // Make typedefs public so that this looks like proper34 // Make typedefs public so that this looks like proper
36 // STL container to templated algorithms.35 // STL container to templated algorithms.
@@ -181,6 +180,8 @@
181 m_counts[Message::Read] +180 m_counts[Message::Read] +
182 m_counts[Message::Archived]);181 m_counts[Message::Archived]);
183 }182 }
183
184 DISALLOW_COPY_AND_ASSIGN(MessageQueue);
184};185};
185186
186}187}
187188
=== modified file 'src/logic/player.h'
--- src/logic/player.h 2014-07-05 16:41:51 +0000
+++ src/logic/player.h 2014-07-14 19:24:49 +0000
@@ -20,6 +20,7 @@
20#ifndef WL_LOGIC_PLAYER_H20#ifndef WL_LOGIC_PLAYER_H
21#define WL_LOGIC_PLAYER_H21#define WL_LOGIC_PLAYER_H
2222
23#include "base/macros.h"
23#include "graphic/color.h"24#include "graphic/color.h"
24#include "logic/building.h"25#include "logic/building.h"
25#include "logic/constants.h"26#include "logic/constants.h"
@@ -54,7 +55,6 @@
54 * properly.55 * properly.
55 */56 */
56class Player :57class Player :
57 boost::noncopyable,
58 public NoteReceiver<NoteImmovable>, public NoteReceiver<NoteFieldPossession>,58 public NoteReceiver<NoteImmovable>, public NoteReceiver<NoteFieldPossession>,
59 public NoteSender <NoteImmovable>, public NoteSender <NoteFieldPossession>59 public NoteSender <NoteImmovable>, public NoteSender <NoteFieldPossession>
60{60{
@@ -140,7 +140,7 @@
140 };140 };
141141
142 /// Per-player field information.142 /// Per-player field information.
143 struct Field : boost::noncopyable {143 struct Field {
144 Field() :144 Field() :
145 military_influence(0),145 military_influence(0),
146 vision (0),146 vision (0),
@@ -352,6 +352,7 @@
352 // border_br352 // border_br
353 // border_bl353 // border_bl
354 // <end> 0x100 0x160354 // <end> 0x100 0x160
355 DISALLOW_COPY_AND_ASSIGN(Field);
355 };356 };
356357
357 const Field * fields() const {return m_fields;}358 const Field * fields() const {return m_fields;}
@@ -593,6 +594,8 @@
593 std::vector< std::vector<uint32_t> > m_ware_stocks;594 std::vector< std::vector<uint32_t> > m_ware_stocks;
594595
595 BuildingStats m_building_stats;596 BuildingStats m_building_stats;
597
598 DISALLOW_COPY_AND_ASSIGN(Player);
596};599};
597600
598void find_former_buildings601void find_former_buildings
599602
=== modified file 'src/logic/production_program.h'
--- src/logic/production_program.h 2014-07-05 16:41:51 +0000
+++ src/logic/production_program.h 2014-07-14 19:24:49 +0000
@@ -26,11 +26,11 @@
26#include <string>26#include <string>
27#include <vector>27#include <vector>
2828
29#include <boost/noncopyable.hpp>
30#include <stdint.h>29#include <stdint.h>
3130
32#include "base/deprecated.h"31#include "base/deprecated.h"
33#include "base/log.h"32#include "base/log.h"
33#include "base/macros.h"
34#include "logic/bill_of_materials.h"34#include "logic/bill_of_materials.h"
35#include "logic/program_result.h"35#include "logic/program_result.h"
36#include "logic/tattribute.h"36#include "logic/tattribute.h"
@@ -52,7 +52,8 @@
52struct ProductionProgram {52struct ProductionProgram {
5353
54 /// Can be executed on a ProductionSite.54 /// Can be executed on a ProductionSite.
55 struct Action : boost::noncopyable {55 struct Action {
56 Action() = default;
56 virtual ~Action();57 virtual ~Action();
57 virtual void execute(Game &, ProductionSite &) const = 0;58 virtual void execute(Game &, ProductionSite &) const = 0;
5859
@@ -70,6 +71,8 @@
70 * a failed status.71 * a failed status.
71 */72 */
72 virtual void building_work_failed(Game &, ProductionSite &, Worker &) const;73 virtual void building_work_failed(Game &, ProductionSite &, Worker &) const;
74
75 DISALLOW_COPY_AND_ASSIGN(Action);
73 };76 };
7477
75 /// A group of ware types with a count.78 /// A group of ware types with a count.
7679
=== modified file 'src/logic/terrain_affinity.h'
--- src/logic/terrain_affinity.h 2014-07-06 08:25:05 +0000
+++ src/logic/terrain_affinity.h 2014-07-14 19:24:49 +0000
@@ -22,8 +22,7 @@
2222
23#include <string>23#include <string>
2424
25#include <boost/noncopyable.hpp>25#include "base/macros.h"
26
27#include "logic/description_maintainer.h"26#include "logic/description_maintainer.h"
2827
29class LuaTable;28class LuaTable;
@@ -38,7 +37,7 @@
38// Describes the parameters and the pickiness of Immovables towards terrain37// Describes the parameters and the pickiness of Immovables towards terrain
39// parameters. Alls immovables that use 'grow' in any of their programs must38// parameters. Alls immovables that use 'grow' in any of their programs must
40// define this.39// define this.
41class TerrainAffinity : boost::noncopyable {40class TerrainAffinity {
42public:41public:
43 explicit TerrainAffinity(const LuaTable& table, const std::string& immovable_name);42 explicit TerrainAffinity(const LuaTable& table, const std::string& immovable_name);
4443
@@ -60,6 +59,8 @@
60 double preferred_humidity_;59 double preferred_humidity_;
61 double preferred_temperature_;60 double preferred_temperature_;
62 double pickiness_;61 double pickiness_;
62
63 DISALLOW_COPY_AND_ASSIGN(TerrainAffinity);
63};64};
6465
65// Returns a value in [0., 1.] that describes the suitability for the66// Returns a value in [0., 1.] that describes the suitability for the
6667
=== modified file 'src/logic/tribe.h'
--- src/logic/tribe.h 2014-07-05 16:41:51 +0000
+++ src/logic/tribe.h 2014-07-14 19:24:49 +0000
@@ -23,6 +23,7 @@
23#include <map>23#include <map>
24#include <vector>24#include <vector>
2525
26#include "base/macros.h"
26#include "graphic/animation.h"27#include "graphic/animation.h"
27#include "logic/bob.h"28#include "logic/bob.h"
28#include "logic/building.h"29#include "logic/building.h"
@@ -51,7 +52,7 @@
51buildings it can build and the associated graphics.52buildings it can build and the associated graphics.
52Two players can choose the same tribe.53Two players can choose the same tribe.
53*/54*/
54struct Tribe_Descr : boost::noncopyable {55struct Tribe_Descr {
55 Tribe_Descr(const std::string & name, Editor_Game_Base &);56 Tribe_Descr(const std::string & name, Editor_Game_Base &);
5657
57 // Static function to check for tribes.58 // Static function to check for tribes.
@@ -192,6 +193,8 @@
192 std::vector<Ware_Index> m_worker_types_without_cost;193 std::vector<Ware_Index> m_worker_types_without_cost;
193194
194 std::vector<Initialization> m_initializations;195 std::vector<Initialization> m_initializations;
196
197 DISALLOW_COPY_AND_ASSIGN(Tribe_Descr);
195};198};
196199
197}200}
198201
=== modified file 'src/logic/world/editor_category.h'
--- src/logic/world/editor_category.h 2014-07-05 16:41:51 +0000
+++ src/logic/world/editor_category.h 2014-07-14 19:24:49 +0000
@@ -22,7 +22,7 @@
2222
23#include <string>23#include <string>
2424
25#include <boost/noncopyable.hpp>25#include "base/macros.h"
2626
27class Image;27class Image;
28class LuaTable;28class LuaTable;
@@ -31,7 +31,7 @@
3131
32/// Represents a category for grouping items in the Editor, so purely a UI32/// Represents a category for grouping items in the Editor, so purely a UI
33/// distinction and not a logical one.33/// distinction and not a logical one.
34class EditorCategory : boost::noncopyable {34class EditorCategory {
35public:35public:
36 EditorCategory(const LuaTable& table);36 EditorCategory(const LuaTable& table);
3737
@@ -48,6 +48,7 @@
48 const std::string name_;48 const std::string name_;
49 const std::string descname_;49 const std::string descname_;
50 const std::string image_file_;50 const std::string image_file_;
51 DISALLOW_COPY_AND_ASSIGN(EditorCategory);
51};52};
5253
53} // namespace Widelands54} // namespace Widelands
5455
=== modified file 'src/logic/world/resource_description.h'
--- src/logic/world/resource_description.h 2014-07-05 16:41:51 +0000
+++ src/logic/world/resource_description.h 2014-07-14 19:24:49 +0000
@@ -23,15 +23,14 @@
23#include <string>23#include <string>
24#include <vector>24#include <vector>
2525
26#include <boost/noncopyable.hpp>26#include "base/macros.h"
27
28#include "logic/widelands.h"27#include "logic/widelands.h"
2928
30class LuaTable;29class LuaTable;
3130
32namespace Widelands {31namespace Widelands {
3332
34class ResourceDescription : boost::noncopyable {33class ResourceDescription {
35public:34public:
36 struct EditorPicture {35 struct EditorPicture {
37 std::string picname;36 std::string picname;
@@ -62,6 +61,8 @@
62 const bool detectable_;61 const bool detectable_;
63 const int32_t max_amount_;62 const int32_t max_amount_;
64 std::vector<EditorPicture> editor_pictures_;63 std::vector<EditorPicture> editor_pictures_;
64
65 DISALLOW_COPY_AND_ASSIGN(ResourceDescription);
65};66};
6667
67} // namespace Widelands68} // namespace Widelands
6869
=== modified file 'src/logic/world/terrain_description.h'
--- src/logic/world/terrain_description.h 2014-07-06 08:17:24 +0000
+++ src/logic/world/terrain_description.h 2014-07-14 19:24:49 +0000
@@ -22,8 +22,7 @@
2222
23#include <string>23#include <string>
2424
25#include <boost/noncopyable.hpp>25#include "base/macros.h"
26
27#include "logic/widelands.h"26#include "logic/widelands.h"
28#include "logic/world/resource_description.h"27#include "logic/world/resource_description.h"
2928
@@ -34,7 +33,7 @@
34class EditorCategory;33class EditorCategory;
35class World;34class World;
3635
37class TerrainDescription : boost::noncopyable {36class TerrainDescription {
38public:37public:
39 enum Type {38 enum Type {
40 GREEN = 0,39 GREEN = 0,
@@ -107,6 +106,8 @@
107 double temperature_;106 double temperature_;
108 double fertility_;107 double fertility_;
109 double humidity_;108 double humidity_;
109
110 DISALLOW_COPY_AND_ASSIGN(TerrainDescription);
110};111};
111112
112} // namespace Widelands113} // namespace Widelands
113114
=== modified file 'src/logic/world/world.h'
--- src/logic/world/world.h 2014-07-05 16:41:51 +0000
+++ src/logic/world/world.h 2014-07-14 19:24:49 +0000
@@ -22,6 +22,7 @@
2222
23#include <memory>23#include <memory>
2424
25#include "base/macros.h"
25#include "logic/bob.h"26#include "logic/bob.h"
26#include "logic/description_maintainer.h"27#include "logic/description_maintainer.h"
2728
@@ -36,7 +37,7 @@
3637
37/// This is the in memory descriptions of the world and provides access to38/// This is the in memory descriptions of the world and provides access to
38/// terrains, immovables and resources.39/// terrains, immovables and resources.
39class World : boost::noncopyable {40class World {
40public:41public:
41 World();42 World();
42 ~World(); // Defined in .cc because all forward declarations are known then.43 ~World(); // Defined in .cc because all forward declarations are known then.
@@ -89,6 +90,8 @@
89 std::unique_ptr<DescriptionMaintainer<ResourceDescription>> resources_;90 std::unique_ptr<DescriptionMaintainer<ResourceDescription>> resources_;
90 std::unique_ptr<DescriptionMaintainer<EditorCategory>> editor_terrain_categories_;91 std::unique_ptr<DescriptionMaintainer<EditorCategory>> editor_terrain_categories_;
91 std::unique_ptr<DescriptionMaintainer<EditorCategory>> editor_immovable_categories_;92 std::unique_ptr<DescriptionMaintainer<EditorCategory>> editor_immovable_categories_;
93
94 DISALLOW_COPY_AND_ASSIGN(World);
92};95};
9396
94} // namespace Widelands97} // namespace Widelands
9598
=== modified file 'src/map_io/one_world_legacy_lookup_table.h'
--- src/map_io/one_world_legacy_lookup_table.h 2014-07-05 16:41:51 +0000
+++ src/map_io/one_world_legacy_lookup_table.h 2014-07-14 19:24:49 +0000
@@ -24,10 +24,11 @@
24#include <memory>24#include <memory>
25#include <string>25#include <string>
2626
27#include <boost/noncopyable.hpp>27#include "base/macros.h"
2828
29class OneWorldLegacyLookupTable : boost::noncopyable {29class OneWorldLegacyLookupTable {
30public:30public:
31 OneWorldLegacyLookupTable() = default;
31 virtual ~OneWorldLegacyLookupTable();32 virtual ~OneWorldLegacyLookupTable();
3233
33 /// Looks up the new name for the 'resource'.34 /// Looks up the new name for the 'resource'.
@@ -41,6 +42,8 @@
4142
42 /// Looks up the new name for the 'immovable'.43 /// Looks up the new name for the 'immovable'.
43 virtual std::string lookup_immovable(const std::string& immovable) const = 0;44 virtual std::string lookup_immovable(const std::string& immovable) const = 0;
45
46 DISALLOW_COPY_AND_ASSIGN(OneWorldLegacyLookupTable);
44};47};
4548
46std::unique_ptr<OneWorldLegacyLookupTable>49std::unique_ptr<OneWorldLegacyLookupTable>
4750
=== modified file 'src/map_io/s2map.cc'
--- src/map_io/s2map.cc 2014-07-05 14:22:44 +0000
+++ src/map_io/s2map.cc 2014-07-14 19:24:49 +0000
@@ -229,7 +229,7 @@
229/// Returns S2 terrain index into (pre one-world) terrain names. Those are then229/// Returns S2 terrain index into (pre one-world) terrain names. Those are then
230/// looked up in the legacy conversion code and this gives the Widelands230/// looked up in the legacy conversion code and this gives the Widelands
231/// terrain.231/// terrain.
232class TerrainConverter : boost::noncopyable {232class TerrainConverter {
233public:233public:
234 TerrainConverter(const Widelands::World& world, const OneWorldLegacyLookupTable& lookup_table);234 TerrainConverter(const Widelands::World& world, const OneWorldLegacyLookupTable& lookup_table);
235 Widelands::Terrain_Index lookup(S2_Map_Loader::WorldType world, int8_t c) const;235 Widelands::Terrain_Index lookup(S2_Map_Loader::WorldType world, int8_t c) const;
@@ -238,6 +238,8 @@
238 const OneWorldLegacyLookupTable& one_world_legacy_lookup_table_;238 const OneWorldLegacyLookupTable& one_world_legacy_lookup_table_;
239 const Widelands::World& world_;239 const Widelands::World& world_;
240 const std::map<S2_Map_Loader::WorldType, std::vector<std::string>> table_;240 const std::map<S2_Map_Loader::WorldType, std::vector<std::string>> table_;
241
242 DISALLOW_COPY_AND_ASSIGN(TerrainConverter);
241};243};
242244
243TerrainConverter::TerrainConverter245TerrainConverter::TerrainConverter
244246
=== modified file 'src/map_io/s2map.h'
--- src/map_io/s2map.h 2014-07-05 16:41:51 +0000
+++ src/map_io/s2map.h 2014-07-14 19:24:49 +0000
@@ -22,6 +22,7 @@
2222
23#include <string>23#include <string>
2424
25#include "base/macros.h"
25#include "map_io/map_loader.h"26#include "map_io/map_loader.h"
2627
27class FileRead;28class FileRead;
2829
=== modified file 'src/profile/profile.h'
--- src/profile/profile.h 2014-07-05 16:41:51 +0000
+++ src/profile/profile.h 2014-07-14 19:24:49 +0000
@@ -23,8 +23,6 @@
23#include <cstring>23#include <cstring>
24#include <vector>24#include <vector>
2525
26#include <boost/noncopyable.hpp>
27
28#include "base/macros.h"26#include "base/macros.h"
29#include "base/point.h"27#include "base/point.h"
30#include "io/filesystem/layered_filesystem.h"28#include "io/filesystem/layered_filesystem.h"
@@ -188,7 +186,7 @@
188 * Returns the next unused section of the given name, or 0 if all sections186 * Returns the next unused section of the given name, or 0 if all sections
189 * have been used. name can be 0 to retrieve any remaining sections.187 * have been used. name can be 0 to retrieve any remaining sections.
190 */188 */
191class Profile : boost::noncopyable {189class Profile {
192public:190public:
193 enum {191 enum {
194 err_ignore = 0,192 err_ignore = 0,
@@ -237,6 +235,8 @@
237 typedef std::vector<Section> Section_list;235 typedef std::vector<Section> Section_list;
238 Section_list m_sections;236 Section_list m_sections;
239 int32_t m_error_level;237 int32_t m_error_level;
238
239 DISALLOW_COPY_AND_ASSIGN(Profile);
240};240};
241241
242#endif // end of include guard: WL_PROFILE_PROFILE_H242#endif // end of include guard: WL_PROFILE_PROFILE_H
243243
=== modified file 'src/ui_basic/panel.h'
--- src/ui_basic/panel.h 2014-07-13 14:36:19 +0000
+++ src/ui_basic/panel.h 2014-07-14 19:24:49 +0000
@@ -27,9 +27,9 @@
27#include <string>27#include <string>
2828
29#include <SDL_keyboard.h>29#include <SDL_keyboard.h>
30#include <boost/noncopyable.hpp>
31#include <boost/signals2/trackable.hpp>30#include <boost/signals2/trackable.hpp>
3231
32#include "base/macros.h"
33#include "base/point.h"33#include "base/point.h"
3434
35class RenderTarget;35class RenderTarget;
@@ -57,7 +57,7 @@
57 * its desired size changes, this automatically changes the actual size (which then invokes57 * its desired size changes, this automatically changes the actual size (which then invokes
58 * \ref layout and \ref move_inside_parent).58 * \ref layout and \ref move_inside_parent).
59 */59 */
60struct Panel : boost::signals2::trackable, boost::noncopyable {60struct Panel : boost::signals2::trackable {
61 enum {61 enum {
62 pf_handle_mouse = 1, ///< receive mouse events62 pf_handle_mouse = 1, ///< receive mouse events
63 pf_think = 2, ///< call think() function during run63 pf_think = 2, ///< call think() function during run
@@ -305,6 +305,8 @@
305 static bool _g_allow_user_input;305 static bool _g_allow_user_input;
306 static const Image* s_default_cursor;306 static const Image* s_default_cursor;
307 static const Image* s_default_cursor_click;307 static const Image* s_default_cursor_click;
308
309 DISALLOW_COPY_AND_ASSIGN(Panel);
308};310};
309311
310inline void Panel::set_snap_windows_only_when_overlapping(const bool on) {312inline void Panel::set_snap_windows_only_when_overlapping(const bool on) {
311313
=== modified file 'src/ui_basic/unique_window.h'
--- src/ui_basic/unique_window.h 2014-07-05 16:41:51 +0000
+++ src/ui_basic/unique_window.h 2014-07-14 19:24:49 +0000
@@ -22,8 +22,6 @@
2222
23#include <functional>23#include <functional>
2424
25#include "boost/noncopyable.hpp"
26
27#include "ui_basic/button.h"25#include "ui_basic/button.h"
28#include "ui_basic/window.h"26#include "ui_basic/window.h"
2927

Subscribers

People subscribed via source and target branches

to status/vote changes: