widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #10526
[Merge] lp:~widelands-dev/widelands/bug-986611-cppcheck-explicit-constructors into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-986611-cppcheck-explicit-constructors into lp:widelands.
Commit message:
Made a bunch of constructors explicit.
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #986611 in widelands: "Issues reported by cppcheck"
https://bugs.launchpad.net/widelands/+bug/986611
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-986611-cppcheck-explicit-constructors/+merge/326255
This change is big but trivial. These are all "stupid" cases, but might protect us from a few regression in the future.
The principal aim is to get rid of a lot of noise in the cppcheck reports so that we can look into the interesting cases some time.
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-986611-cppcheck-explicit-constructors into lp:widelands.
=== modified file 'src/ai/ai_help_structs.h'
--- src/ai/ai_help_structs.h 2017-01-25 18:55:59 +0000
+++ src/ai/ai_help_structs.h 2017-06-24 09:44:24 +0000
@@ -171,7 +171,7 @@
// Fishers and fishbreeders must be built near water
struct FindNodeWater {
- FindNodeWater(const World& world);
+ explicit FindNodeWater(const World& world);
bool accept(const Map& /* map */, const FCoords& coord) const;
@@ -183,7 +183,7 @@
// Open water is a field where all 6 adjacent triangles are water
struct FindNodeOpenWater {
// 'world' is unused, but we need to fit the template.
- FindNodeOpenWater(const World& /* world */) {
+ explicit FindNodeOpenWater(const World& /* world */) {
}
bool accept(const Map& /* map */, const FCoords& coord) const;
@@ -228,7 +228,7 @@
};
struct BuildableField {
- BuildableField(const Widelands::FCoords& fc);
+ explicit BuildableField(const Widelands::FCoords& fc);
int32_t own_military_sites_nearby_();
@@ -288,7 +288,7 @@
};
struct MineableField {
- MineableField(const Widelands::FCoords& fc);
+ explicit MineableField(const Widelands::FCoords& fc);
Widelands::FCoords coords;
uint32_t field_info_expiration;
@@ -299,7 +299,7 @@
};
struct EconomyObserver {
- EconomyObserver(Widelands::Economy& e);
+ explicit EconomyObserver(Widelands::Economy& e);
Widelands::Economy& economy;
std::list<Widelands::Flag const*> flags;
@@ -517,7 +517,7 @@
// list of candidate flags to build roads, with some additional logic
struct FlagsForRoads {
- FlagsForRoads(int32_t mr) : min_reduction(mr) {
+ explicit FlagsForRoads(int32_t mr) : min_reduction(mr) {
}
struct Candidate {
=== modified file 'src/ai/ai_hints.h'
--- src/ai/ai_hints.h 2017-05-25 07:16:05 +0000
+++ src/ai/ai_hints.h 2017-06-24 09:44:24 +0000
@@ -34,7 +34,7 @@
/// buildings conf file. It is used to tell the computer player about the
/// special properties of a building.
struct BuildingHints {
- BuildingHints(std::unique_ptr<LuaTable>);
+ explicit BuildingHints(std::unique_ptr<LuaTable>);
~BuildingHints() {
}
=== modified file 'src/base/i18n.h'
--- src/base/i18n.h 2017-01-25 18:55:59 +0000
+++ src/base/i18n.h 2017-06-24 09:44:24 +0000
@@ -43,7 +43,7 @@
/// released when the object goes out of scope. This is exception-safe, unlike
/// calling grab_textdomain and release_textdomain directly.
struct Textdomain {
- Textdomain(const std::string& name) {
+ explicit Textdomain(const std::string& name) {
grab_textdomain(name);
}
~Textdomain() {
=== modified file 'src/economy/economy.h'
--- src/economy/economy.h 2017-02-12 09:10:57 +0000
+++ src/economy/economy.h 2017-06-24 09:44:24 +0000
@@ -110,7 +110,7 @@
Time last_modified;
};
- Economy(Player&);
+ explicit Economy(Player&);
~Economy();
Player& owner() const {
=== modified file 'src/economy/economy_data_packet.h'
--- src/economy/economy_data_packet.h 2017-01-25 18:55:59 +0000
+++ src/economy/economy_data_packet.h 2017-06-24 09:44:24 +0000
@@ -31,7 +31,7 @@
class EconomyDataPacket {
public:
- EconomyDataPacket(Economy* e) : eco_(e) {
+ explicit EconomyDataPacket(Economy* e) : eco_(e) {
}
void read(FileRead&);
=== modified file 'src/economy/expedition_bootstrap.h'
--- src/economy/expedition_bootstrap.h 2017-02-17 21:52:41 +0000
+++ src/economy/expedition_bootstrap.h 2017-06-24 09:44:24 +0000
@@ -49,7 +49,7 @@
class ExpeditionBootstrap {
public:
- ExpeditionBootstrap(PortDock* const portdock);
+ explicit ExpeditionBootstrap(PortDock* const portdock);
virtual ~ExpeditionBootstrap();
// Start bootstrapping an expedition. This will request all wares and workers.
@@ -118,7 +118,7 @@
ExpeditionBootstrap* bootstrap;
- NoteExpeditionCanceled(ExpeditionBootstrap* const init_bootstrap) : bootstrap(init_bootstrap) {
+ explicit NoteExpeditionCanceled(ExpeditionBootstrap* const init_bootstrap) : bootstrap(init_bootstrap) {
}
};
=== modified file 'src/economy/fleet.h'
--- src/economy/fleet.h 2017-04-23 12:11:19 +0000
+++ src/economy/fleet.h 2017-06-24 09:44:24 +0000
@@ -75,7 +75,7 @@
const FleetDescr& descr() const;
- Fleet(Player& player);
+ explicit Fleet(Player& player);
Player* get_owner() const {
return &owner_;
=== modified file 'src/economy/idleworkersupply.h'
--- src/economy/idleworkersupply.h 2017-01-25 18:55:59 +0000
+++ src/economy/idleworkersupply.h 2017-06-24 09:44:24 +0000
@@ -27,7 +27,7 @@
class Economy;
struct IdleWorkerSupply : public Supply {
- IdleWorkerSupply(Worker&);
+ explicit IdleWorkerSupply(Worker&);
~IdleWorkerSupply();
void set_economy(Economy*);
=== modified file 'src/economy/portdock.h'
--- src/economy/portdock.h 2017-04-23 12:11:19 +0000
+++ src/economy/portdock.h 2017-06-24 09:44:24 +0000
@@ -75,7 +75,7 @@
public:
const PortdockDescr& descr() const;
- PortDock(Warehouse* warehouse);
+ explicit PortDock(Warehouse* warehouse);
~PortDock() override;
void add_position(Widelands::Coords where);
=== modified file 'src/economy/router.h'
--- src/economy/router.h 2017-01-25 18:55:59 +0000
+++ src/economy/router.h 2017-06-24 09:44:24 +0000
@@ -38,7 +38,7 @@
struct Router {
using ResetCycleFn = boost::function<void()>;
- Router(const ResetCycleFn& reset);
+ explicit Router(const ResetCycleFn& reset);
bool find_route(RoutingNode& start,
RoutingNode& end,
=== modified file 'src/economy/shippingitem.h'
--- src/economy/shippingitem.h 2017-01-25 18:55:59 +0000
+++ src/economy/shippingitem.h 2017-06-24 09:44:24 +0000
@@ -44,8 +44,8 @@
struct ShippingItem {
ShippingItem() {
}
- ShippingItem(WareInstance& ware);
- ShippingItem(Worker& worker);
+ explicit ShippingItem(WareInstance& ware);
+ explicit ShippingItem(Worker& worker);
// Unboxes the item that is shipped which might be either a ware or a
// worker. It is safe to pass nullptr for 'ware' or 'worker' in case you are
=== modified file 'src/economy/trackptr.h'
--- src/economy/trackptr.h 2017-01-25 18:55:59 +0000
+++ src/economy/trackptr.h 2017-06-24 09:44:24 +0000
@@ -46,7 +46,7 @@
Trackable* ptr_;
public:
- Tracker(Trackable* const p) : refcount_(0), ptr_(p) {
+ explicit Tracker(Trackable* const p) : refcount_(0), ptr_(p) {
}
void addref() {
@@ -104,7 +104,7 @@
if (tracker_)
tracker_->deref();
}
- BaseTrackPtr(Trackable* const t) {
+ explicit BaseTrackPtr(Trackable* const t) {
if (t) {
tracker_ = t->tracker_;
tracker_->addref();
@@ -160,7 +160,7 @@
TrackPtr() {
}
- TrackPtr(T* ptr) : BaseTrackPtr(ptr) {
+ explicit TrackPtr(T* ptr) : BaseTrackPtr(ptr) {
}
TrackPtr(const TrackPtr<T>& o) : BaseTrackPtr(o) {
}
=== modified file 'src/economy/ware_instance.cc'
--- src/economy/ware_instance.cc 2017-06-20 08:17:02 +0000
+++ src/economy/ware_instance.cc 2017-06-24 09:44:24 +0000
@@ -46,7 +46,7 @@
*/
// TODO(unknown): This maybe shouldn't be here.
struct IdleWareSupply : public Supply {
- IdleWareSupply(WareInstance&);
+ explicit IdleWareSupply(WareInstance&);
virtual ~IdleWareSupply();
void set_economy(Economy*);
=== modified file 'src/economy/warehousesupply.h'
--- src/economy/warehousesupply.h 2017-01-25 18:55:59 +0000
+++ src/economy/warehousesupply.h 2017-06-24 09:44:24 +0000
@@ -31,7 +31,7 @@
It also manages the list of wares in the warehouse.
*/
struct WarehouseSupply : public Supply {
- WarehouseSupply(Warehouse* const wh) : economy_(nullptr), warehouse_(wh) {
+ explicit WarehouseSupply(Warehouse* const wh) : economy_(nullptr), warehouse_(wh) {
}
virtual ~WarehouseSupply();
=== modified file 'src/editor/editorinteractive.h'
--- src/editor/editorinteractive.h 2017-01-25 18:55:59 +0000
+++ src/editor/editorinteractive.h 2017-06-24 09:44:24 +0000
@@ -86,7 +86,7 @@
EditorSetOriginTool set_origin;
EditorMakeInfrastructureTool make_infrastructure;
};
- EditorInteractive(Widelands::EditorGameBase&);
+ explicit EditorInteractive(Widelands::EditorGameBase&);
// Runs the Editor via the commandline --editor flag. Will load 'filename' as a
// map and run 'script_to_run' directly after all initialization is done.
=== modified file 'src/editor/tools/action_args.h'
--- src/editor/tools/action_args.h 2017-01-25 18:55:59 +0000
+++ src/editor/tools/action_args.h 2017-06-24 09:44:24 +0000
@@ -36,7 +36,7 @@
/// Class to save important and changeable properties of classes needed for actions
// Implementations in editor_history.cc
struct EditorActionArgs {
- EditorActionArgs(EditorInteractive& base);
+ explicit EditorActionArgs(EditorInteractive& base);
// TODO(sirver): This class does its own reference counting. This design is
// brittle and on a quick overview I have a feeling that it might not be
=== modified file 'src/editor/tools/place_critter_tool.h'
--- src/editor/tools/place_critter_tool.h 2017-01-25 18:55:59 +0000
+++ src/editor/tools/place_critter_tool.h 2017-06-24 09:44:24 +0000
@@ -25,7 +25,7 @@
/// Places critters on the map.
struct EditorPlaceCritterTool : public EditorTool, public MultiSelect {
- EditorPlaceCritterTool(EditorDeleteCritterTool& tool) : EditorTool(tool, tool) {
+ explicit EditorPlaceCritterTool(EditorDeleteCritterTool& tool) : EditorTool(tool, tool) {
}
int32_t handle_click_impl(const Widelands::World& world,
=== modified file 'src/editor/tools/place_immovable_tool.h'
--- src/editor/tools/place_immovable_tool.h 2017-01-25 18:55:59 +0000
+++ src/editor/tools/place_immovable_tool.h 2017-06-24 09:44:24 +0000
@@ -27,7 +27,7 @@
* This places immovables on the map
*/
struct EditorPlaceImmovableTool : public EditorTool, public MultiSelect {
- EditorPlaceImmovableTool(EditorDeleteImmovableTool& tool) : EditorTool(tool, tool) {
+ explicit EditorPlaceImmovableTool(EditorDeleteImmovableTool& tool) : EditorTool(tool, tool) {
}
int32_t handle_click_impl(const Widelands::World& world,
=== modified file 'src/editor/tools/set_port_space_tool.h'
--- src/editor/tools/set_port_space_tool.h 2017-01-25 18:55:59 +0000
+++ src/editor/tools/set_port_space_tool.h 2017-06-24 09:44:24 +0000
@@ -29,7 +29,7 @@
/// Unsets a buildspace for ports.
class EditorUnsetPortSpaceTool : public EditorTool {
public:
- EditorUnsetPortSpaceTool();
+ explicit EditorUnsetPortSpaceTool();
int32_t handle_click_impl(const Widelands::World& world,
const Widelands::NodeAndTriangle<>& center,
=== modified file 'src/editor/ui_menus/main_menu_load_map.h'
--- src/editor/ui_menus/main_menu_load_map.h 2017-01-25 18:55:59 +0000
+++ src/editor/ui_menus/main_menu_load_map.h 2017-06-24 09:44:24 +0000
@@ -29,7 +29,7 @@
* Choose a filename and save your brand new created map
*/
struct MainMenuLoadMap : public MainMenuLoadOrSaveMap {
- MainMenuLoadMap(EditorInteractive& parent);
+ explicit MainMenuLoadMap(EditorInteractive& parent);
protected:
void clicked_ok() override;
=== modified file 'src/editor/ui_menus/main_menu_new_map.h'
--- src/editor/ui_menus/main_menu_new_map.h 2017-01-25 18:55:59 +0000
+++ src/editor/ui_menus/main_menu_new_map.h 2017-06-24 09:44:24 +0000
@@ -35,7 +35,7 @@
* things like size, world ....
*/
struct MainMenuNewMap : public UI::Window {
- MainMenuNewMap(EditorInteractive&);
+ explicit MainMenuNewMap(EditorInteractive&);
private:
EditorInteractive& eia();
=== modified file 'src/editor/ui_menus/main_menu_random_map.h'
--- src/editor/ui_menus/main_menu_random_map.h 2017-01-25 18:55:59 +0000
+++ src/editor/ui_menus/main_menu_random_map.h 2017-06-24 09:44:24 +0000
@@ -45,7 +45,7 @@
* things like size, world ....
*/
struct MainMenuNewRandomMap : public UI::Window {
- MainMenuNewRandomMap(EditorInteractive&);
+ explicit MainMenuNewRandomMap(EditorInteractive&);
enum class ButtonId : uint8_t {
kNone,
=== modified file 'src/editor/ui_menus/main_menu_save_map.h'
--- src/editor/ui_menus/main_menu_save_map.h 2017-01-25 18:55:59 +0000
+++ src/editor/ui_menus/main_menu_save_map.h 2017-06-24 09:44:24 +0000
@@ -32,7 +32,7 @@
* Choose a filename and save your brand new created map
*/
struct MainMenuSaveMap : public MainMenuLoadOrSaveMap {
- MainMenuSaveMap(EditorInteractive& parent);
+ explicit MainMenuSaveMap(EditorInteractive& parent);
protected:
// Sets the current dir and updates labels.
=== modified file 'src/graphic/animation.cc'
--- src/graphic/animation.cc 2017-06-20 08:19:29 +0000
+++ src/graphic/animation.cc 2017-06-24 09:44:24 +0000
@@ -61,7 +61,7 @@
public:
virtual ~NonPackedAnimation() {
}
- NonPackedAnimation(const LuaTable& table);
+ explicit NonPackedAnimation(const LuaTable& table);
// Implements Animation.
float height() const override;
=== modified file 'src/graphic/font_handler1.cc'
--- src/graphic/font_handler1.cc 2017-05-25 12:30:40 +0000
+++ src/graphic/font_handler1.cc 2017-06-24 09:44:24 +0000
@@ -58,7 +58,7 @@
// A transient cache for the generated rendered texts
class RenderCache : public TransientCache<RenderedText> {
public:
- RenderCache(uint32_t max_number_of_rects)
+ explicit RenderCache(uint32_t max_number_of_rects)
: TransientCache<RenderedText>(max_number_of_rects) {
}
=== modified file 'src/graphic/gl/utils.cc'
--- src/graphic/gl/utils.cc 2016-09-06 07:59:30 +0000
+++ src/graphic/gl/utils.cc 2017-06-24 09:44:24 +0000
@@ -81,7 +81,7 @@
// Thin wrapper around a Shader object to ensure proper cleanup.
class Shader {
public:
- Shader(GLenum type);
+ explicit Shader(GLenum type);
~Shader();
GLuint object() const {
=== modified file 'src/graphic/image_io.h'
--- src/graphic/image_io.h 2017-01-25 18:55:59 +0000
+++ src/graphic/image_io.h 2017-06-24 09:44:24 +0000
@@ -32,7 +32,7 @@
class ImageNotFound : public WException {
public:
- ImageNotFound(const std::string& fn) : wexception("Image not found: %s", fn.c_str()) {
+ explicit ImageNotFound(const std::string& fn) : wexception("Image not found: %s", fn.c_str()) {
}
};
=== modified file 'src/graphic/render_queue.cc'
--- src/graphic/render_queue.cc 2017-05-19 06:40:44 +0000
+++ src/graphic/render_queue.cc 2017-06-24 09:44:24 +0000
@@ -120,7 +120,7 @@
// creation. Disables GL_SCISSOR_TEST at desctruction again.
class ScopedScissor {
public:
- ScopedScissor(const Rectf& rect);
+ explicit ScopedScissor(const Rectf& rect);
~ScopedScissor();
private:
=== modified file 'src/graphic/rendertarget.h'
--- src/graphic/rendertarget.h 2017-05-14 04:38:39 +0000
+++ src/graphic/rendertarget.h 2017-06-24 09:44:24 +0000
@@ -50,7 +50,7 @@
// the old richtext renderer is gone.
class RenderTarget {
public:
- RenderTarget(Surface*);
+ explicit RenderTarget(Surface*);
void set_window(const Recti& rc, const Vector2i& ofs);
bool enter_window(const Recti& rc, Recti* previous, Vector2i* prevofs);
=== modified file 'src/graphic/richtext.cc'
--- src/graphic/richtext.cc 2017-05-14 04:38:39 +0000
+++ src/graphic/richtext.cc 2017-06-24 09:44:24 +0000
@@ -239,7 +239,7 @@
/// parts of a line onto the same text baseline).
std::vector<Elt> elements;
- TextBuilder(RichTextImpl& impl)
+ explicit TextBuilder(RichTextImpl& impl)
: rti(impl),
images_width(0),
images_height(0),
=== modified file 'src/graphic/text/font_set.h'
--- src/graphic/text/font_set.h 2017-01-25 18:55:59 +0000
+++ src/graphic/text/font_set.h 2017-06-24 09:44:24 +0000
@@ -37,7 +37,7 @@
static constexpr const char* kFallbackFont = "DejaVu/DejaVuSans.ttf";
/// Create a fontset from i18n/fonts.lua
- FontSet(const std::string& fontset_name);
+ explicit FontSet(const std::string& fontset_name);
// The fontset's name
const std::string& name() const;
=== modified file 'src/graphic/text/rendered_text.h'
--- src/graphic/text/rendered_text.h 2017-05-23 21:32:20 +0000
+++ src/graphic/text/rendered_text.h 2017-06-24 09:44:24 +0000
@@ -58,18 +58,18 @@
public:
/// RenderedRect will contain a background image that should be tiled
- RenderedRect(const Recti& init_rect, const Image* init_image);
+ explicit RenderedRect(const Recti& init_rect, const Image* init_image);
/// RenderedRect will contain a background color that should be tiled
- RenderedRect(const Recti& init_rect, const RGBColor& color);
+ explicit RenderedRect(const Recti& init_rect, const RGBColor& color);
/// RenderedRect will contain a normal image that is managed by a transient cache.
/// Use this if the image is managed by an instance of TextureCache.
- RenderedRect(std::shared_ptr<const Image> init_image);
+ explicit RenderedRect(std::shared_ptr<const Image> init_image);
/// RenderedRect will contain a normal image that is managed by a permanent cache.
/// Use this if the image is managed by g_gr->images().
- RenderedRect(const Image* init_image);
+ explicit RenderedRect(const Image* init_image);
~RenderedRect() {
}
=== modified file 'src/graphic/text/rt_errors.h'
--- src/graphic/text/rt_errors.h 2017-01-25 18:55:59 +0000
+++ src/graphic/text/rt_errors.h 2017-06-24 09:44:24 +0000
@@ -28,7 +28,7 @@
class Exception : public std::exception {
public:
- Exception(std::string msg) : std::exception(), msg_(msg) {
+ explicit Exception(const std::string& msg) : std::exception(), msg_(msg) {
}
const char* what() const noexcept override {
return msg_.c_str();
@@ -41,7 +41,7 @@
#define DEF_ERR(Name) \
class Name : public Exception { \
public: \
- Name(std::string msg) : Exception(msg) { \
+ explicit Name(const std::string& msg) : Exception(msg) { \
} \
};
=== modified file 'src/graphic/text/rt_parse.h'
--- src/graphic/text/rt_parse.h 2017-01-25 18:55:59 +0000
+++ src/graphic/text/rt_parse.h 2017-06-24 09:44:24 +0000
@@ -102,9 +102,9 @@
struct Child {
Child() : tag(nullptr), text() {
}
- Child(Tag* t) : tag(t) {
+ explicit Child(Tag* t) : tag(t) {
}
- Child(std::string t) : tag(nullptr), text(t) {
+ explicit Child(std::string t) : tag(nullptr), text(t) {
}
~Child() {
if (tag)
=== modified file 'src/graphic/text/rt_render.cc'
--- src/graphic/text/rt_render.cc 2017-06-01 08:52:15 +0000
+++ src/graphic/text/rt_render.cc 2017-06-24 09:44:24 +0000
@@ -199,7 +199,7 @@
class RefMap : public IRefMap {
public:
- RefMap(const std::vector<Reference>& refs) : refs_(refs) {
+ explicit RefMap(const std::vector<Reference>& refs) : refs_(refs) {
}
std::string query(int16_t x, int16_t y) override {
// Should this linear algorithm proof to be too slow (doubtful), the
@@ -221,7 +221,7 @@
FLOAT_RIGHT,
FLOAT_LEFT,
};
- RenderNode(NodeStyle& ns)
+ explicit RenderNode(NodeStyle& ns)
: floating_(NO_FLOAT), halign_(ns.halign), valign_(ns.valign), x_(0), y_(0) {
}
virtual ~RenderNode() {
@@ -315,7 +315,7 @@
class Layout {
public:
- Layout(std::vector<RenderNode*>& all) : h_(0), idx_(0), all_nodes_(all) {
+ explicit Layout(std::vector<RenderNode*>& all) : h_(0), idx_(0), all_nodes_(all) {
}
virtual ~Layout() {
}
@@ -668,7 +668,7 @@
*/
class NewlineNode : public RenderNode {
public:
- NewlineNode(NodeStyle& ns) : RenderNode(ns) {
+ explicit NewlineNode(NodeStyle& ns) : RenderNode(ns) {
}
std::string debug_info() const override {
@@ -776,7 +776,7 @@
*/
class DivTagRenderNode : public RenderNode {
public:
- DivTagRenderNode(NodeStyle& ns)
+ explicit DivTagRenderNode(NodeStyle& ns)
: RenderNode(ns),
desired_width_(),
background_color_(0, 0, 0),
=== modified file 'src/graphic/text/textstream.h'
--- src/graphic/text/textstream.h 2017-01-25 18:55:59 +0000
+++ src/graphic/text/textstream.h 2017-06-24 09:44:24 +0000
@@ -28,7 +28,7 @@
class TextStream {
public:
- TextStream(std::string text) : text_(text), line_(1), col_(0), pos_(0), end_(text.size()) {
+ explicit TextStream(std::string text) : text_(text), line_(1), col_(0), pos_(0), end_(text.size()) {
}
size_t line() const {
=== modified file 'src/graphic/text/texture_cache.h'
--- src/graphic/text/texture_cache.h 2017-05-23 06:59:43 +0000
+++ src/graphic/text/texture_cache.h 2017-06-24 09:44:24 +0000
@@ -27,7 +27,7 @@
class TextureCache : public TransientCache<Image> {
public:
- TextureCache(uint32_t max_size_in_bytes) : TransientCache<Image>(max_size_in_bytes) {
+ explicit TextureCache(uint32_t max_size_in_bytes) : TransientCache<Image>(max_size_in_bytes) {
}
std::shared_ptr<const Image> insert(const std::string& hash,
=== modified file 'src/graphic/text/transient_cache.h'
--- src/graphic/text/transient_cache.h 2017-05-25 12:30:40 +0000
+++ src/graphic/text/transient_cache.h 2017-06-24 09:44:24 +0000
@@ -44,7 +44,7 @@
public:
/// Create a new cache in which the combined data size for all transient entries is always below
/// the 'max_size_in_arbitrary_unit'.
- TransientCache(uint32_t max_size_in_arbitrary_unit);
+ explicit TransientCache(uint32_t max_size_in_arbitrary_unit);
virtual ~TransientCache();
/// Deletes all entries in the cache, leaving it as if it were just created.
=== modified file 'src/graphic/texture_atlas.h'
--- src/graphic/texture_atlas.h 2017-01-25 18:55:59 +0000
+++ src/graphic/texture_atlas.h 2017-06-24 09:44:24 +0000
@@ -68,7 +68,7 @@
private:
struct Node {
- Node(const Recti& init_r);
+ explicit Node(const Recti& init_r);
void split(int w, int h);
bool used;
=== modified file 'src/io/filesystem/disk_filesystem.cc'
--- src/io/filesystem/disk_filesystem.cc 2017-01-25 18:55:59 +0000
+++ src/io/filesystem/disk_filesystem.cc 2017-06-24 09:44:24 +0000
@@ -53,7 +53,7 @@
bool exists_;
bool is_directory_;
- FileSystemPath(const std::string& path) : std::string(path) {
+ explicit FileSystemPath(const std::string& path) : std::string(path) {
struct stat st;
exists_ = (stat(c_str(), &st) != -1);
@@ -450,7 +450,7 @@
namespace {
struct RealFSStreamRead : public StreamRead {
- RealFSStreamRead(const std::string& fname) : file_(fopen(fname.c_str(), "rb")) {
+ explicit RealFSStreamRead(const std::string& fname) : file_(fopen(fname.c_str(), "rb")) {
if (!file_)
throw wexception("could not open %s for reading", fname.c_str());
}
@@ -487,7 +487,7 @@
namespace {
struct RealFSStreamWrite : public StreamWrite {
- RealFSStreamWrite(const std::string& fname) : filename_(fname) {
+ explicit RealFSStreamWrite(const std::string& fname) : filename_(fname) {
file_ = fopen(fname.c_str(), "wb");
if (!file_)
throw wexception("could not open %s for writing", fname.c_str());
=== modified file 'src/io/filesystem/disk_filesystem.h'
--- src/io/filesystem/disk_filesystem.h 2017-01-25 18:55:59 +0000
+++ src/io/filesystem/disk_filesystem.h 2017-06-24 09:44:24 +0000
@@ -28,7 +28,7 @@
// TODO(unknown): const correctness
class RealFSImpl : public FileSystem {
public:
- RealFSImpl(const std::string& Directory);
+ explicit RealFSImpl(const std::string& Directory);
std::set<std::string> list_directory(const std::string& path) override;
=== modified file 'src/io/filesystem/zip_filesystem.h'
--- src/io/filesystem/zip_filesystem.h 2017-01-25 18:55:59 +0000
+++ src/io/filesystem/zip_filesystem.h 2017-06-24 09:44:24 +0000
@@ -72,7 +72,7 @@
// through 'make_sub_file_system'.
class ZipFile {
public:
- ZipFile(const std::string& zipfile);
+ explicit ZipFile(const std::string& zipfile);
// Calls 'close()'.
~ZipFile();
=== modified file 'src/logic/cmd_calculate_statistics.h'
--- src/logic/cmd_calculate_statistics.h 2017-01-25 18:55:59 +0000
+++ src/logic/cmd_calculate_statistics.h 2017-06-24 09:44:24 +0000
@@ -29,7 +29,7 @@
struct CmdCalculateStatistics : public GameLogicCommand {
CmdCalculateStatistics() : GameLogicCommand(0) {
} // For savegame loading
- CmdCalculateStatistics(uint32_t const init_duetime) : GameLogicCommand(init_duetime) {
+ explicit CmdCalculateStatistics(uint32_t const init_duetime) : GameLogicCommand(init_duetime) {
}
// Write these commands to a file (for savegames)
=== modified file 'src/logic/cmd_queue.h'
--- src/logic/cmd_queue.h 2017-05-20 22:42:49 +0000
+++ src/logic/cmd_queue.h 2017-06-24 09:44:24 +0000
@@ -69,7 +69,7 @@
* the same for all parallel simulation.
*/
struct Command {
- Command(const uint32_t init_duetime) : duetime_(init_duetime) {
+ explicit Command(const uint32_t init_duetime) : duetime_(init_duetime) {
}
virtual ~Command();
@@ -95,7 +95,7 @@
* for all instances of a game to ensure parallel simulation.
*/
struct GameLogicCommand : public Command {
- GameLogicCommand(uint32_t const init_duetime) : Command(init_duetime) {
+ explicit GameLogicCommand(uint32_t const init_duetime) : Command(init_duetime) {
}
// Write these commands to a file (for savegames)
@@ -130,7 +130,7 @@
};
public:
- CmdQueue(Game&);
+ explicit CmdQueue(Game&);
~CmdQueue();
/// Add a command to the queue. Takes ownership.
=== modified file 'src/logic/editor_game_base.h'
--- src/logic/editor_game_base.h 2017-05-26 06:11:27 +0000
+++ src/logic/editor_game_base.h 2017-06-24 09:44:24 +0000
@@ -81,7 +81,7 @@
friend class FullscreenMenuLaunchGame;
friend struct GameClassPacket;
- EditorGameBase(LuaInterface* lua);
+ explicit EditorGameBase(LuaInterface* lua);
virtual ~EditorGameBase();
void set_map(Map*);
=== modified file 'src/logic/findbob.h'
--- src/logic/findbob.h 2017-01-25 18:55:59 +0000
+++ src/logic/findbob.h 2017-06-24 09:44:24 +0000
@@ -27,7 +27,7 @@
class Player;
struct FindBobAttribute : public FindBob {
- FindBobAttribute(uint32_t const init_attrib) : attrib(init_attrib) {
+ explicit FindBobAttribute(uint32_t const init_attrib) : attrib(init_attrib) {
}
bool accept(Bob*) const override;
@@ -42,7 +42,7 @@
* if player is 0).
*/
struct FindBobEnemySoldier : public FindBob {
- FindBobEnemySoldier(Player* init_player) : player(init_player) {
+ explicit FindBobEnemySoldier(Player* init_player) : player(init_player) {
}
bool accept(Bob*) const override;
=== modified file 'src/logic/findimmovable.h'
--- src/logic/findimmovable.h 2017-05-20 22:42:49 +0000
+++ src/logic/findimmovable.h 2017-06-24 09:44:24 +0000
@@ -50,7 +50,7 @@
int refcount;
};
template <typename T> struct Capsule : public BaseCapsule {
- Capsule(const T& init_op) : op(init_op) {
+ explicit Capsule(const T& init_op) : op(init_op) {
}
bool accept(const BaseImmovable& imm) const override {
return op.accept(imm);
@@ -101,7 +101,7 @@
int32_t min, max;
};
struct FindImmovableType {
- FindImmovableType(MapObjectType const init_type) : type(init_type) {
+ explicit FindImmovableType(MapObjectType const init_type) : type(init_type) {
}
bool accept(const BaseImmovable&) const;
@@ -110,7 +110,7 @@
MapObjectType type;
};
struct FindImmovableAttribute {
- FindImmovableAttribute(uint32_t const init_attrib) : attrib(init_attrib) {
+ explicit FindImmovableAttribute(uint32_t const init_attrib) : attrib(init_attrib) {
}
bool accept(const BaseImmovable&) const;
@@ -125,7 +125,7 @@
bool accept(const BaseImmovable&) const;
};
struct FindImmovablePlayerMilitarySite {
- FindImmovablePlayerMilitarySite(const Player& init_player) : player(init_player) {
+ explicit FindImmovablePlayerMilitarySite(const Player& init_player) : player(init_player) {
}
bool accept(const BaseImmovable&) const;
@@ -139,7 +139,7 @@
bool accept(const BaseImmovable&) const;
};
struct FindImmovableByDescr {
- FindImmovableByDescr(const ImmovableDescr& init_descr) : descr(init_descr) {
+ explicit FindImmovableByDescr(const ImmovableDescr& init_descr) : descr(init_descr) {
}
bool accept(const BaseImmovable&) const;
@@ -147,7 +147,7 @@
const ImmovableDescr& descr;
};
struct FindFlagOf {
- FindFlagOf(const FindImmovable& init_finder) : finder(init_finder) {
+ explicit FindFlagOf(const FindImmovable& init_finder) : finder(init_finder) {
}
bool accept(const BaseImmovable&) const;
=== modified file 'src/logic/map_objects/bob.cc'
--- src/logic/map_objects/bob.cc 2017-06-20 08:17:02 +0000
+++ src/logic/map_objects/bob.cc 2017-06-24 09:44:24 +0000
@@ -472,7 +472,7 @@
};
struct CheckStepBlocked {
- CheckStepBlocked(BlockedTracker& tracker) : tracker_(tracker) {
+ explicit CheckStepBlocked(BlockedTracker& tracker) : tracker_(tracker) {
}
bool allowed(Map&, FCoords, FCoords end, int32_t, CheckStep::StepId) const {
=== modified file 'src/logic/map_objects/bob.h'
--- src/logic/map_objects/bob.h 2017-04-23 12:11:19 +0000
+++ src/logic/map_objects/bob.h 2017-06-24 09:44:24 +0000
@@ -201,7 +201,7 @@
* \see class Bob for in-depth explanation
*/
struct State {
- State(const Task* const the_task = nullptr)
+ explicit State(const Task* const the_task = nullptr)
: task(the_task),
ivar1(0),
ivar2(0),
@@ -349,7 +349,7 @@
}
protected:
- Bob(const BobDescr& descr);
+ explicit Bob(const BobDescr& descr);
virtual ~Bob();
private:
=== modified file 'src/logic/map_objects/immovable.h'
--- src/logic/map_objects/immovable.h 2017-04-23 12:11:19 +0000
+++ src/logic/map_objects/immovable.h 2017-06-24 09:44:24 +0000
@@ -81,7 +81,7 @@
BIG ///< big building
};
- BaseImmovable(const MapObjectDescr&);
+ explicit BaseImmovable(const MapObjectDescr&);
virtual int32_t get_size() const = 0;
virtual bool get_passable() const = 0;
@@ -329,7 +329,7 @@
* also adjusted automatically.
*/
struct PlayerImmovable : public BaseImmovable {
- PlayerImmovable(const MapObjectDescr&);
+ explicit PlayerImmovable(const MapObjectDescr&);
virtual ~PlayerImmovable();
Player* get_owner() const {
=== modified file 'src/logic/map_objects/map_object.h'
--- src/logic/map_objects/map_object.h 2017-05-20 22:42:49 +0000
+++ src/logic/map_objects/map_object.h 2017-06-24 09:44:24 +0000
@@ -253,7 +253,7 @@
virtual const Image* representative_image() const;
protected:
- MapObject(MapObjectDescr const* descr);
+ explicit MapObject(MapObjectDescr const* descr);
virtual ~MapObject() {
}
=== modified file 'src/logic/map_objects/tribes/bill_of_materials.h'
--- src/logic/map_objects/tribes/bill_of_materials.h 2017-01-25 18:55:59 +0000
+++ src/logic/map_objects/tribes/bill_of_materials.h 2017-06-24 09:44:24 +0000
@@ -30,7 +30,7 @@
// range structure for iterating ware range with index
struct WareRange {
- WareRange(const BillOfMaterials& range) : i(0), current(range.begin()), end(range.end()) {
+ explicit WareRange(const BillOfMaterials& range) : i(0), current(range.begin()), end(range.end()) {
}
WareRange& operator++() {
++i;
=== modified file 'src/logic/map_objects/tribes/building.h'
--- src/logic/map_objects/tribes/building.h 2017-05-25 12:31:33 +0000
+++ src/logic/map_objects/tribes/building.h 2017-06-24 09:44:24 +0000
@@ -220,7 +220,7 @@
public:
enum class InfoStringFormat { kCensus, kStatistics, kTooltip };
- Building(const BuildingDescr&);
+ explicit Building(const BuildingDescr&);
void load_finish(EditorGameBase&) override;
=== modified file 'src/logic/map_objects/tribes/carrier.h'
--- src/logic/map_objects/tribes/carrier.h 2017-02-20 14:15:07 +0000
+++ src/logic/map_objects/tribes/carrier.h 2017-06-24 09:44:24 +0000
@@ -54,7 +54,7 @@
MO_DESCR(CarrierDescr)
- Carrier(const CarrierDescr& carrier_descr) : Worker(carrier_descr), promised_pickup_to_(NOONE) {
+ explicit Carrier(const CarrierDescr& carrier_descr) : Worker(carrier_descr), promised_pickup_to_(NOONE) {
}
virtual ~Carrier() {
}
=== modified file 'src/logic/map_objects/tribes/constructionsite.h'
--- src/logic/map_objects/tribes/constructionsite.h 2017-04-23 12:11:19 +0000
+++ src/logic/map_objects/tribes/constructionsite.h 2017-06-24 09:44:24 +0000
@@ -83,7 +83,7 @@
MO_DESCR(ConstructionSiteDescr)
public:
- ConstructionSite(const ConstructionSiteDescr& descr);
+ explicit ConstructionSite(const ConstructionSiteDescr& descr);
const ConstructionsiteInformation& get_info() {
return info_;
=== modified file 'src/logic/map_objects/tribes/dismantlesite.h'
--- src/logic/map_objects/tribes/dismantlesite.h 2017-04-23 12:11:19 +0000
+++ src/logic/map_objects/tribes/dismantlesite.h 2017-06-24 09:44:24 +0000
@@ -65,8 +65,8 @@
MO_DESCR(DismantleSiteDescr)
public:
- DismantleSite(const DismantleSiteDescr& descr);
- DismantleSite(const DismantleSiteDescr& descr,
+ explicit DismantleSite(const DismantleSiteDescr& descr);
+ explicit DismantleSite(const DismantleSiteDescr& descr,
EditorGameBase&,
Coords const,
Player&,
=== modified file 'src/logic/map_objects/tribes/militarysite.h'
--- src/logic/map_objects/tribes/militarysite.h 2017-05-20 22:42:49 +0000
+++ src/logic/map_objects/tribes/militarysite.h 2017-06-24 09:44:24 +0000
@@ -80,7 +80,7 @@
kPrefersHeroes,
};
- MilitarySite(const MilitarySiteDescr&);
+ explicit MilitarySite(const MilitarySiteDescr&);
virtual ~MilitarySite();
bool init(EditorGameBase&) override;
=== modified file 'src/logic/map_objects/tribes/partially_finished_building.h'
--- src/logic/map_objects/tribes/partially_finished_building.h 2017-04-23 12:11:19 +0000
+++ src/logic/map_objects/tribes/partially_finished_building.h 2017-06-24 09:44:24 +0000
@@ -39,7 +39,7 @@
friend struct MapBuildingPacket;
public:
- PartiallyFinishedBuilding(const BuildingDescr& building_descr);
+ explicit PartiallyFinishedBuilding(const BuildingDescr& building_descr);
virtual void set_building(const BuildingDescr&);
=== modified file 'src/logic/map_objects/tribes/production_program.h'
--- src/logic/map_objects/tribes/production_program.h 2017-01-25 18:55:59 +0000
+++ src/logic/map_objects/tribes/production_program.h 2017-06-24 09:44:24 +0000
@@ -181,7 +181,7 @@
/// Tests whether the economy needs a ware of type ware_type.
struct EconomyNeedsWare : public Condition {
- EconomyNeedsWare(const DescriptionIndex& i) : ware_type(i) {
+ explicit EconomyNeedsWare(const DescriptionIndex& i) : ware_type(i) {
}
bool evaluate(const ProductionSite&) const override;
std::string description(const Tribes& tribes) const override;
@@ -193,7 +193,7 @@
/// Tests whether the economy needs a worker of type worker_type.
struct EconomyNeedsWorker : public Condition {
- EconomyNeedsWorker(const DescriptionIndex& i) : worker_type(i) {
+ explicit EconomyNeedsWorker(const DescriptionIndex& i) : worker_type(i) {
}
bool evaluate(const ProductionSite&) const override;
std::string description(const Tribes& tribes) const override;
@@ -303,7 +303,7 @@
///
/// Blocks the execution of the program for the specified duration.
struct ActSleep : public Action {
- ActSleep(char* parameters);
+ explicit ActSleep(char* parameters);
void execute(Game&, ProductionSite&) const override;
private:
@@ -321,7 +321,7 @@
///
/// Ends the program if the feature is not enabled.
struct ActCheckMap : public Action {
- ActCheckMap(char* parameters);
+ explicit ActCheckMap(char* parameters);
void execute(Game&, ProductionSite&) const override;
private:
@@ -460,7 +460,7 @@
};
struct ActCheckSoldier : public Action {
- ActCheckSoldier(char* parameters);
+ explicit ActCheckSoldier(char* parameters);
void execute(Game&, ProductionSite&) const override;
private:
@@ -469,7 +469,7 @@
};
struct ActTrain : public Action {
- ActTrain(char* parameters);
+ explicit ActTrain(char* parameters);
void execute(Game&, ProductionSite&) const override;
private:
@@ -493,7 +493,7 @@
/// Plays the specified sound effect with the specified priority. Whether the
/// sound effect is actually played is determined by the sound handler.
struct ActPlaySound : public Action {
- ActPlaySound(char* parameters);
+ explicit ActPlaySound(char* parameters);
void execute(Game&, ProductionSite&) const override;
private:
=== modified file 'src/logic/map_objects/tribes/productionsite.h'
--- src/logic/map_objects/tribes/productionsite.h 2017-06-23 16:16:28 +0000
+++ src/logic/map_objects/tribes/productionsite.h 2017-06-24 09:44:24 +0000
@@ -162,7 +162,7 @@
MO_DESCR(ProductionSiteDescr)
public:
- ProductionSite(const ProductionSiteDescr& descr);
+ explicit ProductionSite(const ProductionSiteDescr& descr);
virtual ~ProductionSite();
void log_general_info(const EditorGameBase&) override;
=== modified file 'src/logic/map_objects/tribes/requirements.h'
--- src/logic/map_objects/tribes/requirements.h 2017-01-25 18:55:59 +0000
+++ src/logic/map_objects/tribes/requirements.h 2017-06-24 09:44:24 +0000
@@ -58,7 +58,7 @@
};
template <typename T> struct Capsule : public BaseCapsule {
- Capsule(const T& init_m) : m(init_m) {
+ explicit Capsule(const T& init_m) : m(init_m) {
}
bool check(const MapObject& obj) const override {
=== modified file 'src/logic/map_objects/tribes/ship.h'
--- src/logic/map_objects/tribes/ship.h 2017-04-23 12:11:19 +0000
+++ src/logic/map_objects/tribes/ship.h 2017-06-24 09:44:24 +0000
@@ -98,7 +98,7 @@
struct Ship : Bob {
MO_DESCR(ShipDescr)
- Ship(const ShipDescr& descr);
+ explicit Ship(const ShipDescr& descr);
virtual ~Ship();
// Returns the fleet the ship is a part of.
=== modified file 'src/logic/map_objects/tribes/soldier.cc'
--- src/logic/map_objects/tribes/soldier.cc 2017-06-20 10:35:56 +0000
+++ src/logic/map_objects/tribes/soldier.cc 2017-06-24 09:44:24 +0000
@@ -649,7 +649,7 @@
}
struct FindNodeOwned {
- FindNodeOwned(PlayerNumber owner) : owner_(owner) {
+ explicit FindNodeOwned(PlayerNumber owner) : owner_(owner) {
}
bool accept(const Map&, const FCoords& coords) const {
return (coords.field->get_owned_by() == owner_);
=== modified file 'src/logic/map_objects/tribes/soldier.h'
--- src/logic/map_objects/tribes/soldier.h 2017-05-20 22:42:49 +0000
+++ src/logic/map_objects/tribes/soldier.h 2017-06-24 09:44:24 +0000
@@ -112,7 +112,7 @@
private:
// Health, Attack, Defense and Evade values.
struct BattleAttribute {
- BattleAttribute(std::unique_ptr<LuaTable> table);
+ explicit BattleAttribute(std::unique_ptr<LuaTable> table);
uint32_t base; // Base value
uint32_t maximum; // Maximum value for randomizing attack values
@@ -173,7 +173,7 @@
MO_DESCR(SoldierDescr)
public:
- Soldier(const SoldierDescr&);
+ explicit Soldier(const SoldierDescr&);
bool init(EditorGameBase&) override;
void cleanup(EditorGameBase&) override;
=== modified file 'src/logic/map_objects/tribes/trainingsite.h'
--- src/logic/map_objects/tribes/trainingsite.h 2017-04-23 12:11:19 +0000
+++ src/logic/map_objects/tribes/trainingsite.h 2017-06-24 09:44:24 +0000
@@ -167,7 +167,7 @@
};
public:
- TrainingSite(const TrainingSiteDescr&);
+ explicit TrainingSite(const TrainingSiteDescr&);
bool init(EditorGameBase&) override;
void cleanup(EditorGameBase&) override;
=== modified file 'src/logic/map_objects/tribes/tribe_basic_info.h'
--- src/logic/map_objects/tribes/tribe_basic_info.h 2017-01-25 18:55:59 +0000
+++ src/logic/map_objects/tribes/tribe_basic_info.h 2017-06-24 09:44:24 +0000
@@ -42,7 +42,7 @@
std::string tooltip;
};
- TribeBasicInfo(std::unique_ptr<LuaTable> table);
+ explicit TribeBasicInfo(std::unique_ptr<LuaTable> table);
/// Internal name to reference this tribe
std::string name;
=== modified file 'src/logic/map_objects/tribes/warehouse.h'
--- src/logic/map_objects/tribes/warehouse.h 2017-05-20 22:42:49 +0000
+++ src/logic/map_objects/tribes/warehouse.h 2017-06-24 09:44:24 +0000
@@ -127,7 +127,7 @@
kCompatible
};
- Warehouse(const WarehouseDescr&);
+ explicit Warehouse(const WarehouseDescr&);
virtual ~Warehouse();
void load_finish(EditorGameBase&) override;
@@ -244,7 +244,7 @@
// A warehouse that conquers space can also be attacked.
class AttackTarget : public Widelands::AttackTarget {
public:
- AttackTarget(Warehouse* warehouse) : warehouse_(warehouse) {
+ explicit AttackTarget(Warehouse* warehouse) : warehouse_(warehouse) {
}
bool can_be_attacked() const override;
=== modified file 'src/logic/map_objects/tribes/worker.cc'
--- src/logic/map_objects/tribes/worker.cc 2017-06-20 08:17:02 +0000
+++ src/logic/map_objects/tribes/worker.cc 2017-06-24 09:44:24 +0000
@@ -462,7 +462,7 @@
// fields, trees, rocks and such on triangles and keep the nodes
// passable. See code structure issue #1096824.
struct FindNodeSpace {
- FindNodeSpace(BaseImmovable* const ignoreimm) : ignoreimmovable(ignoreimm) {
+ explicit FindNodeSpace(BaseImmovable* const ignoreimm) : ignoreimmovable(ignoreimm) {
}
bool accept(const Map& map, const FCoords& coords) const {
@@ -2213,7 +2213,7 @@
}
struct FindFlagWithPlayersWarehouse {
- FindFlagWithPlayersWarehouse(const Player& owner) : owner_(owner) {
+ explicit FindFlagWithPlayersWarehouse(const Player& owner) : owner_(owner) {
}
bool accept(const BaseImmovable& imm) const {
if (upcast(Flag const, flag, &imm))
=== modified file 'src/logic/map_objects/tribes/worker.h'
--- src/logic/map_objects/tribes/worker.h 2017-04-25 08:05:09 +0000
+++ src/logic/map_objects/tribes/worker.h 2017-06-24 09:44:24 +0000
@@ -71,7 +71,7 @@
};
public:
- Worker(const WorkerDescr&);
+ explicit Worker(const WorkerDescr&);
virtual ~Worker();
Player& owner() const {
=== modified file 'src/logic/map_objects/world/critter.h'
--- src/logic/map_objects/world/critter.h 2017-01-25 18:55:59 +0000
+++ src/logic/map_objects/world/critter.h 2017-06-24 09:44:24 +0000
@@ -67,7 +67,7 @@
MO_DESCR(CritterDescr)
public:
- Critter(const CritterDescr&);
+ explicit Critter(const CritterDescr&);
void init_auto_task(Game&) override;
=== modified file 'src/logic/map_objects/world/critter_program.h'
--- src/logic/map_objects/world/critter_program.h 2017-01-25 18:55:59 +0000
+++ src/logic/map_objects/world/critter_program.h 2017-06-24 09:44:24 +0000
@@ -41,7 +41,7 @@
};
struct CritterProgram : public BobProgramBase {
- CritterProgram(const std::string& name) : name_(name) {
+ explicit CritterProgram(const std::string& name) : name_(name) {
}
virtual ~CritterProgram() {
}
=== modified file 'src/logic/map_objects/world/editor_category.h'
--- src/logic/map_objects/world/editor_category.h 2017-01-25 18:55:59 +0000
+++ src/logic/map_objects/world/editor_category.h 2017-06-24 09:44:24 +0000
@@ -33,7 +33,7 @@
/// distinction and not a logical one.
class EditorCategory {
public:
- EditorCategory(const LuaTable& table);
+ explicit EditorCategory(const LuaTable& table);
/// Internal name.
const std::string& name() const;
=== modified file 'src/logic/map_objects/world/map_gen.h'
--- src/logic/map_objects/world/map_gen.h 2017-01-25 18:55:59 +0000
+++ src/logic/map_objects/world/map_gen.h 2017-06-24 09:44:24 +0000
@@ -73,7 +73,7 @@
};
struct MapGenBobCategory {
- MapGenBobCategory(const LuaTable& table);
+ explicit MapGenBobCategory(const LuaTable& table);
size_t num_immovables() const {
return immovables_.size();
=== modified file 'src/logic/map_objects/world/resource_description.h'
--- src/logic/map_objects/world/resource_description.h 2017-01-25 18:55:59 +0000
+++ src/logic/map_objects/world/resource_description.h 2017-06-24 09:44:24 +0000
@@ -37,7 +37,7 @@
int upper_limit;
};
- ResourceDescription(const LuaTable& table);
+ explicit ResourceDescription(const LuaTable& table);
/// Returns the in engine name of this resource.
const std::string& name() const;
=== modified file 'src/logic/map_objects/world/terrain_description.h'
--- src/logic/map_objects/world/terrain_description.h 2017-01-25 18:55:59 +0000
+++ src/logic/map_objects/world/terrain_description.h 2017-06-24 09:44:24 +0000
@@ -53,7 +53,7 @@
};
struct Type {
- Type(TerrainDescription::Is init_is);
+ explicit Type(TerrainDescription::Is init_is);
TerrainDescription::Is is;
const char* descname;
=== modified file 'src/logic/mapastar.h'
--- src/logic/mapastar.h 2017-01-25 18:55:59 +0000
+++ src/logic/mapastar.h 2017-06-24 09:44:24 +0000
@@ -27,7 +27,7 @@
namespace Widelands {
struct MapAStarBase {
- MapAStarBase(Map& m) : map(m), pathfields(m.pathfieldmgr_->allocate()) {
+ explicit MapAStarBase(Map& m) : map(m), pathfields(m.pathfieldmgr_->allocate()) {
}
bool empty() const {
@@ -49,7 +49,7 @@
};
struct StepEvalAStar {
- StepEvalAStar(Coords target)
+ explicit StepEvalAStar(Coords target)
: target_(target), estimator_bias_(0), conservative_(true), swim_(false) {
}
=== modified file 'src/logic/objective.h'
--- src/logic/objective.h 2017-01-25 18:55:59 +0000
+++ src/logic/objective.h 2017-06-24 09:44:24 +0000
@@ -32,7 +32,7 @@
// end a scenario successfully.
class Objective {
public:
- Objective(const std::string& init_name)
+ explicit Objective(const std::string& init_name)
: name_(init_name),
descname_(init_name),
descr_(_("This objective has no description.")),
=== modified file 'src/logic/pathfield.h'
--- src/logic/pathfield.h 2017-01-25 18:55:59 +0000
+++ src/logic/pathfield.h 2017-06-24 09:44:24 +0000
@@ -66,7 +66,7 @@
std::unique_ptr<Pathfield[]> fields;
uint16_t cycle;
- Pathfields(uint32_t nrfields);
+ explicit Pathfields(uint32_t nrfields);
};
/**
=== modified file 'src/logic/playercommand.h'
--- src/logic/playercommand.h 2017-01-25 18:55:59 +0000
+++ src/logic/playercommand.h 2017-06-24 09:44:24 +0000
@@ -82,7 +82,7 @@
: PlayerCommand(t, p), serial(pi.serial()), recurse(init_recurse) {
}
- CmdBulldoze(StreamRead&);
+ explicit CmdBulldoze(StreamRead&);
void write(FileWrite&, EditorGameBase&, MapObjectSaver&) override;
void read(FileRead&, EditorGameBase&, MapObjectLoader&) override;
@@ -106,7 +106,7 @@
: PlayerCommand(init_duetime, p), coords(c), bi(i) {
}
- CmdBuild(StreamRead&);
+ explicit CmdBuild(StreamRead&);
void write(FileWrite&, EditorGameBase&, MapObjectSaver&) override;
void read(FileRead&, EditorGameBase&, MapObjectLoader&) override;
@@ -130,7 +130,7 @@
: PlayerCommand(t, p), coords(c) {
}
- CmdBuildFlag(StreamRead&);
+ explicit CmdBuildFlag(StreamRead&);
void write(FileWrite&, EditorGameBase&, MapObjectSaver&) override;
void read(FileRead&, EditorGameBase&, MapObjectLoader&) override;
@@ -150,7 +150,7 @@
CmdBuildRoad() : PlayerCommand(), path(nullptr), start(), nsteps(0), steps(nullptr) {
} // For savegame loading
CmdBuildRoad(uint32_t, int32_t, Path&);
- CmdBuildRoad(StreamRead&);
+ explicit CmdBuildRoad(StreamRead&);
virtual ~CmdBuildRoad();
@@ -185,7 +185,7 @@
return QueueCommandTypes::kFlagAction;
}
- CmdFlagAction(StreamRead&);
+ explicit CmdFlagAction(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -208,7 +208,7 @@
return QueueCommandTypes::kStopBuilding;
}
- CmdStartStopBuilding(StreamRead&);
+ explicit CmdStartStopBuilding(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -234,7 +234,7 @@
return QueueCommandTypes::kMilitarysiteSetSoldierPreference;
}
- CmdMilitarySiteSetSoldierPreference(StreamRead&);
+ explicit CmdMilitarySiteSetSoldierPreference(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -257,7 +257,7 @@
return QueueCommandTypes::kPortStartExpedition;
}
- CmdStartOrCancelExpedition(StreamRead&);
+ explicit CmdStartOrCancelExpedition(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -284,7 +284,7 @@
return QueueCommandTypes::kEnhanceBuilding;
}
- CmdEnhanceBuilding(StreamRead&);
+ explicit CmdEnhanceBuilding(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -309,7 +309,7 @@
return QueueCommandTypes::kDismantleBuilding;
}
- CmdDismantleBuilding(StreamRead&);
+ explicit CmdDismantleBuilding(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -333,7 +333,7 @@
return QueueCommandTypes::kEvictWorker;
}
- CmdEvictWorker(StreamRead&);
+ explicit CmdEvictWorker(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -356,7 +356,7 @@
return QueueCommandTypes::kShipScout;
}
- CmdShipScoutDirection(StreamRead&);
+ explicit CmdShipScoutDirection(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -380,7 +380,7 @@
return QueueCommandTypes::kShipConstructPort;
}
- CmdShipConstructPort(StreamRead&);
+ explicit CmdShipConstructPort(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -407,7 +407,7 @@
return QueueCommandTypes::kShipExplore;
}
- CmdShipExploreIsland(StreamRead&);
+ explicit CmdShipExploreIsland(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -430,7 +430,7 @@
return QueueCommandTypes::kSinkShip;
}
- CmdShipSink(StreamRead&);
+ explicit CmdShipSink(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -453,7 +453,7 @@
return QueueCommandTypes::kShipCancelExpedition;
}
- CmdShipCancelExpedition(StreamRead&);
+ explicit CmdShipCancelExpedition(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -481,7 +481,7 @@
return QueueCommandTypes::kSetWarePriority;
}
- CmdSetWarePriority(StreamRead&);
+ explicit CmdSetWarePriority(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -511,7 +511,7 @@
return QueueCommandTypes::kSetInputMaxFill;
}
- CmdSetInputMaxFill(StreamRead&);
+ explicit CmdSetInputMaxFill(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -535,7 +535,7 @@
void write(FileWrite&, EditorGameBase&, MapObjectSaver&) override;
void read(FileRead&, EditorGameBase&, MapObjectLoader&) override;
- CmdChangeTargetQuantity(StreamRead&);
+ explicit CmdChangeTargetQuantity(StreamRead&);
void serialize(StreamWrite&) override;
@@ -569,7 +569,7 @@
return QueueCommandTypes::kSetWareTargetQuantity;
}
- CmdSetWareTargetQuantity(StreamRead&);
+ explicit CmdSetWareTargetQuantity(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -594,7 +594,7 @@
return QueueCommandTypes::kResetWareTargetQuantity;
}
- CmdResetWareTargetQuantity(StreamRead&);
+ explicit CmdResetWareTargetQuantity(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -617,7 +617,7 @@
return QueueCommandTypes::kSetWorkerTargetQuantity;
}
- CmdSetWorkerTargetQuantity(StreamRead&);
+ explicit CmdSetWorkerTargetQuantity(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -642,7 +642,7 @@
return QueueCommandTypes::kResetWorkerTargetQuantity;
}
- CmdResetWorkerTargetQuantity(StreamRead&);
+ explicit CmdResetWorkerTargetQuantity(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -668,7 +668,7 @@
return QueueCommandTypes::kChangeTrainingOptions;
}
- CmdChangeTrainingOptions(StreamRead&);
+ explicit CmdChangeTrainingOptions(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -694,7 +694,7 @@
return QueueCommandTypes::kDropSoldier;
}
- CmdDropSoldier(StreamRead&);
+ explicit CmdDropSoldier(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -719,7 +719,7 @@
return QueueCommandTypes::kChangeSoldierCapacity;
}
- CmdChangeSoldierCapacity(StreamRead&);
+ explicit CmdChangeSoldierCapacity(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -745,7 +745,7 @@
return QueueCommandTypes::kEnemyFlagAction;
}
- CmdEnemyFlagAction(StreamRead&);
+ explicit CmdEnemyFlagAction(StreamRead&);
void execute(Game&) override;
void serialize(StreamWrite&) override;
@@ -766,7 +766,7 @@
void write(FileWrite&, EditorGameBase&, MapObjectSaver&) override;
void read(FileRead&, EditorGameBase&, MapObjectLoader&) override;
- PlayerMessageCommand(StreamRead&);
+ explicit PlayerMessageCommand(StreamRead&);
MessageId message_id() const {
return message_id_;
@@ -787,7 +787,7 @@
return QueueCommandTypes::kMessageSetStatusRead;
}
- CmdMessageSetStatusRead(StreamRead& des) : PlayerMessageCommand(des) {
+ explicit CmdMessageSetStatusRead(StreamRead& des) : PlayerMessageCommand(des) {
}
void execute(Game&) override;
@@ -805,7 +805,7 @@
return QueueCommandTypes::kMessageSetStatusArchived;
}
- CmdMessageSetStatusArchived(StreamRead& des) : PlayerMessageCommand(des) {
+ explicit CmdMessageSetStatusArchived(StreamRead& des) : PlayerMessageCommand(des) {
}
void execute(Game&) override;
@@ -830,7 +830,7 @@
void execute(Game& game) override;
// Network (de-)serialization
- CmdSetStockPolicy(StreamRead& des);
+ explicit CmdSetStockPolicy(StreamRead& des);
void serialize(StreamWrite& ser) override;
// Savegame functions
=== modified file 'src/logic/playersmanager.h'
--- src/logic/playersmanager.h 2017-06-05 07:33:18 +0000
+++ src/logic/playersmanager.h 2017-06-24 09:44:24 +0000
@@ -51,7 +51,7 @@
class PlayersManager {
public:
- PlayersManager(EditorGameBase& egbase);
+ explicit PlayersManager(EditorGameBase& egbase);
virtual ~PlayersManager();
void cleanup();
=== modified file 'src/logic/replay.cc'
--- src/logic/replay.cc 2017-01-25 18:55:59 +0000
+++ src/logic/replay.cc 2017-06-24 09:44:24 +0000
@@ -185,7 +185,7 @@
*/
class CmdReplaySyncWrite : public Command {
public:
- CmdReplaySyncWrite(const uint32_t init_duetime) : Command(init_duetime) {
+ explicit CmdReplaySyncWrite(const uint32_t init_duetime) : Command(init_duetime) {
}
QueueCommandTypes id() const override {
=== modified file 'src/logic/replay_game_controller.h'
--- src/logic/replay_game_controller.h 2017-01-25 18:55:59 +0000
+++ src/logic/replay_game_controller.h 2017-06-24 09:44:24 +0000
@@ -46,7 +46,7 @@
private:
struct CmdReplayEnd : public Widelands::Command {
- CmdReplayEnd(uint32_t const init_duetime) : Widelands::Command(init_duetime) {
+ explicit CmdReplayEnd(uint32_t const init_duetime) : Widelands::Command(init_duetime) {
}
virtual void execute(Widelands::Game& game);
virtual Widelands::QueueCommandTypes id() const;
=== modified file 'src/logic/widelands_geometry_io.h'
--- src/logic/widelands_geometry_io.h 2017-01-25 18:55:59 +0000
+++ src/logic/widelands_geometry_io.h 2017-06-24 09:44:24 +0000
@@ -34,7 +34,7 @@
};
struct DirectionInvalid : public FileRead::DataError {
- DirectionInvalid(Direction const D)
+ explicit DirectionInvalid(Direction const D)
: DataError("direction is %u but must be one of {0 (idle), 1 (northeast), 2 "
"(east), 3 (southeast), 4 (southwest), 5 (west), 6 (northwest)}",
D),
=== modified file 'src/map_io/map_players_view_packet.cc'
--- src/map_io/map_players_view_packet.cc 2017-01-25 18:55:59 +0000
+++ src/map_io/map_players_view_packet.cc 2017-06-24 09:44:24 +0000
@@ -168,7 +168,7 @@
// Errors for the Read* functions.
struct TribeImmovableNonexistent : public FileRead::DataError {
- TribeImmovableNonexistent(const std::string& Name)
+ explicit TribeImmovableNonexistent(const std::string& Name)
: DataError("immovable type \"%s\" does not seem to be a tribe immovable", Name.c_str()),
name(Name) {
}
@@ -176,13 +176,13 @@
std::string name;
};
struct WorldImmovableNonexistent : public FileRead::DataError {
- WorldImmovableNonexistent(char const* const Name)
+ explicit WorldImmovableNonexistent(char const* const Name)
: DataError("world does not define immovable type \"%s\"", Name), name(Name) {
}
char const* const name;
};
struct BuildingNonexistent : public FileRead::DataError {
- BuildingNonexistent(char const* const Name)
+ explicit BuildingNonexistent(char const* const Name)
: DataError("tribes do not define building type \"%s\"", Name), name(Name) {
}
char const* const name;
=== modified file 'src/map_io/world_legacy_lookup_table.cc'
--- src/map_io/world_legacy_lookup_table.cc 2017-02-18 14:03:02 +0000
+++ src/map_io/world_legacy_lookup_table.cc 2017-06-24 09:44:24 +0000
@@ -127,7 +127,7 @@
class OneWorldLegacyLookupTable : public WorldLegacyLookupTable {
public:
- OneWorldLegacyLookupTable(const std::string& old_world_name);
+ explicit OneWorldLegacyLookupTable(const std::string& old_world_name);
// Implements OneWorldLegacyLookupTable.
std::string lookup_resource(const std::string& resource) const override;
=== modified file 'src/network/gamehost.cc'
--- src/network/gamehost.cc 2017-06-23 08:33:03 +0000
+++ src/network/gamehost.cc 2017-06-24 09:44:24 +0000
@@ -64,7 +64,7 @@
#include "wui/interactive_spectator.h"
struct HostGameSettingsProvider : public GameSettingsProvider {
- HostGameSettingsProvider(GameHost* const init_host) : host_(init_host) {
+ explicit HostGameSettingsProvider(GameHost* const init_host) : host_(init_host) {
}
~HostGameSettingsProvider() {
}
@@ -278,7 +278,7 @@
};
struct HostChatProvider : public ChatProvider {
- HostChatProvider(GameHost* const init_host) : h(init_host), kickClient(0) {
+ explicit HostChatProvider(GameHost* const init_host) : h(init_host), kickClient(0) {
}
void send(const std::string& msg) override {
@@ -527,7 +527,7 @@
Md5Checksum syncreport;
bool syncreport_arrived;
- GameHostImpl(GameHost* const h)
+ explicit GameHostImpl(GameHost* const h)
: localdesiredspeed(0),
chat(h),
hp(h),
=== modified file 'src/network/netclient.h'
--- src/network/netclient.h 2017-06-10 16:36:29 +0000
+++ src/network/netclient.h 2017-06-24 09:44:24 +0000
@@ -79,7 +79,7 @@
* If the connection attempt failed, is_connected() will return \c false.
* \param host The host to connect to.
*/
- NetClient(const NetAddress& host);
+ explicit NetClient(const NetAddress& host);
/// An io_service needed by boost.asio. Primarily needed for asynchronous operations.
boost::asio::io_service io_service_;
=== modified file 'src/network/nethost.h'
--- src/network/nethost.h 2017-06-10 16:36:29 +0000
+++ src/network/nethost.h 2017-06-24 09:44:24 +0000
@@ -105,7 +105,7 @@
* If it fails, is_listening() will return \c false.
* \param port The port to listen on.
*/
- NetHost(const uint16_t port);
+ explicit NetHost(const uint16_t port);
bool open_acceptor(boost::asio::ip::tcp::acceptor* acceptor,
const boost::asio::ip::tcp::endpoint& endpoint);
@@ -119,7 +119,7 @@
* \param sock The socket to listen on. The socket is moved by this
* constructor so the given socket is no longer valid.
*/
- Client(boost::asio::ip::tcp::socket&& sock);
+ explicit Client(boost::asio::ip::tcp::socket&& sock);
/// The socket to send/receive with.
boost::asio::ip::tcp::socket socket;
=== modified file 'src/network/network_lan_promotion.h'
--- src/network/network_lan_promotion.h 2017-06-10 16:36:29 +0000
+++ src/network/network_lan_promotion.h 2017-06-24 09:44:24 +0000
@@ -59,7 +59,7 @@
* When both fail, report_network_error() is called.
* \param port The port to listen on.
*/
- LanBase(uint16_t port);
+ explicit LanBase(uint16_t port);
~LanBase();
=== modified file 'src/network/network_player_settings_backend.h'
--- src/network/network_player_settings_backend.h 2017-02-13 13:06:25 +0000
+++ src/network/network_player_settings_backend.h 2017-06-24 09:44:24 +0000
@@ -25,7 +25,7 @@
struct NetworkPlayerSettingsBackend {
- NetworkPlayerSettingsBackend(GameSettingsProvider* const settings) : s(settings) {
+ explicit NetworkPlayerSettingsBackend(GameSettingsProvider* const settings) : s(settings) {
for (uint8_t i = 0; i < kMaxPlayers; ++i)
shared_in_tribe[i] = std::string();
}
=== modified file 'src/notifications/test/notifications_test.cc'
--- src/notifications/test/notifications_test.cc 2017-06-20 10:42:00 +0000
+++ src/notifications/test/notifications_test.cc 2017-06-24 09:44:24 +0000
@@ -32,7 +32,7 @@
struct SimpleNote {
CAN_BE_SENT_AS_NOTE(100)
- SimpleNote(const std::string& init_text) : text(init_text) {
+ explicit SimpleNote(const std::string& init_text) : text(init_text) {
}
std::string text;
=== modified file 'src/profile/profile.h'
--- src/profile/profile.h 2017-05-13 11:25:24 +0000
+++ src/profile/profile.h 2017-06-24 09:44:24 +0000
@@ -182,11 +182,11 @@
public:
enum { err_ignore = 0, err_log, err_throw };
- Profile(int32_t error_level = err_throw);
- Profile(char const* filename,
+ explicit Profile(int32_t error_level = err_throw);
+ explicit Profile(char const* filename,
char const* global_section = nullptr,
int32_t error_level = err_throw);
- Profile(char const* filename,
+ explicit Profile(char const* filename,
char const* global_section,
const std::string& textdomain,
int32_t error_level = err_throw);
=== modified file 'src/scripting/logic.h'
--- src/scripting/logic.h 2017-01-25 18:55:59 +0000
+++ src/scripting/logic.h 2017-06-24 09:44:24 +0000
@@ -31,7 +31,7 @@
class LuaEditorInterface : public LuaInterface {
public:
- LuaEditorInterface(Widelands::EditorGameBase* g);
+ explicit LuaEditorInterface(Widelands::EditorGameBase* g);
virtual ~LuaEditorInterface();
std::unique_ptr<LuaTable> run_script(const std::string& script) override;
@@ -42,7 +42,7 @@
class LuaGameInterface : public LuaInterface {
public:
- LuaGameInterface(Widelands::Game* g);
+ explicit LuaGameInterface(Widelands::Game* g);
virtual ~LuaGameInterface();
// Returns a given hook if one is defined, otherwise returns 0
=== modified file 'src/scripting/lua_bases.h'
--- src/scripting/lua_bases.h 2017-01-25 18:55:59 +0000
+++ src/scripting/lua_bases.h 2017-06-24 09:44:24 +0000
@@ -43,7 +43,7 @@
LuaEditorGameBase() {
}
- LuaEditorGameBase(lua_State* L) {
+ explicit LuaEditorGameBase(lua_State* L) {
report_error(L, "Cannot instantiate a 'EditorGameBase' directly!");
}
virtual ~LuaEditorGameBase() {
@@ -83,10 +83,10 @@
LuaPlayerBase() : player_number_(NONE) {
}
- LuaPlayerBase(lua_State* L) : player_number_(NONE) {
+ explicit LuaPlayerBase(lua_State* L) : player_number_(NONE) {
report_error(L, "Cannot instantiate a 'PlayerBase' directly!");
}
- LuaPlayerBase(Widelands::PlayerNumber n) {
+ explicit LuaPlayerBase(Widelands::PlayerNumber n) {
player_number_ = n;
}
virtual ~LuaPlayerBase() {
=== modified file 'src/scripting/lua_coroutine.h'
--- src/scripting/lua_coroutine.h 2017-01-25 18:55:59 +0000
+++ src/scripting/lua_coroutine.h 2017-06-24 09:44:24 +0000
@@ -47,7 +47,7 @@
// and can be deleted.
enum { DONE = 0, YIELDED = LUA_YIELD };
- LuaCoroutine(lua_State* L);
+ explicit LuaCoroutine(lua_State* L);
virtual ~LuaCoroutine();
// Returns either 'DONE' or 'YIELDED'.
=== modified file 'src/scripting/lua_editor.h'
--- src/scripting/lua_editor.h 2017-01-25 18:55:59 +0000
+++ src/scripting/lua_editor.h 2017-06-24 09:44:24 +0000
@@ -37,9 +37,9 @@
LuaPlayer() : LuaBases::LuaPlayerBase() {
}
- LuaPlayer(Widelands::PlayerNumber n) : LuaBases::LuaPlayerBase(n) {
+ explicit LuaPlayer(Widelands::PlayerNumber n) : LuaBases::LuaPlayerBase(n) {
}
- LuaPlayer(lua_State* L) {
+ explicit LuaPlayer(lua_State* L) {
report_error(L, "Cannot instantiate a 'Player' directly!");
}
=== modified file 'src/scripting/lua_errors.h'
--- src/scripting/lua_errors.h 2017-01-25 18:55:59 +0000
+++ src/scripting/lua_errors.h 2017-06-24 09:44:24 +0000
@@ -26,12 +26,12 @@
class LuaError : public WException {
public:
- LuaError(const std::string& reason);
+ explicit LuaError(const std::string& reason);
};
class LuaScriptNotExistingError : public LuaError {
public:
- LuaScriptNotExistingError(const std::string& name);
+ explicit LuaScriptNotExistingError(const std::string& name);
};
#endif // end of include guard: WL_SCRIPTING_LUA_ERRORS_H
=== modified file 'src/scripting/lua_game.h'
--- src/scripting/lua_game.h 2017-01-25 18:55:59 +0000
+++ src/scripting/lua_game.h 2017-06-24 09:44:24 +0000
@@ -56,9 +56,9 @@
LuaPlayer() : LuaBases::LuaPlayerBase() {
}
- LuaPlayer(Widelands::PlayerNumber n) : LuaBases::LuaPlayerBase(n) {
+ explicit LuaPlayer(Widelands::PlayerNumber n) : LuaBases::LuaPlayerBase(n) {
}
- LuaPlayer(lua_State* L) {
+ explicit LuaPlayer(lua_State* L) {
report_error(L, "Cannot instantiate a 'Player' directly!");
}
@@ -117,10 +117,10 @@
virtual ~LuaObjective() {
}
- LuaObjective(const Widelands::Objective& n);
+ explicit LuaObjective(const Widelands::Objective& n);
LuaObjective() : name_("") {
}
- LuaObjective(lua_State* L) {
+ explicit LuaObjective(lua_State* L) {
report_error(L, "Cannot instantiate a '%s' directly!", className);
}
@@ -161,10 +161,10 @@
virtual ~LuaMessage() {
}
- LuaMessage(uint8_t, Widelands::MessageId);
+ explicit LuaMessage(uint8_t, Widelands::MessageId);
LuaMessage() : player_number_(0), message_id_(0) {
}
- LuaMessage(lua_State* L) {
+ explicit LuaMessage(lua_State* L) {
report_error(L, "Cannot instantiate a '%s' directly!", className);
}
=== modified file 'src/scripting/lua_map.h'
--- src/scripting/lua_map.h 2017-03-26 11:05:06 +0000
+++ src/scripting/lua_map.h 2017-06-24 09:44:24 +0000
@@ -75,7 +75,7 @@
LuaMap() {
}
- LuaMap(lua_State* L) {
+ explicit LuaMap(lua_State* L) {
report_error(L, "Cannot instantiate a 'Map' directly!");
}
@@ -111,9 +111,9 @@
LuaTribeDescription() : tribedescr_(nullptr) {
}
- LuaTribeDescription(const Widelands::TribeDescr* const tribedescr) : tribedescr_(tribedescr) {
+ explicit LuaTribeDescription(const Widelands::TribeDescr* const tribedescr) : tribedescr_(tribedescr) {
}
- LuaTribeDescription(lua_State* L) : tribedescr_(nullptr) {
+ explicit LuaTribeDescription(lua_State* L) : tribedescr_(nullptr) {
report_error(L, "Cannot instantiate a 'LuaTribeDescription' directly!");
}
@@ -169,10 +169,10 @@
LuaMapObjectDescription() : mapobjectdescr_(nullptr) {
}
- LuaMapObjectDescription(const Widelands::MapObjectDescr* const mapobjectdescr)
+ explicit LuaMapObjectDescription(const Widelands::MapObjectDescr* const mapobjectdescr)
: mapobjectdescr_(mapobjectdescr) {
}
- LuaMapObjectDescription(lua_State* L) : mapobjectdescr_(nullptr) {
+ explicit LuaMapObjectDescription(lua_State* L) : mapobjectdescr_(nullptr) {
report_error(L, "Cannot instantiate a 'MapObjectDescription' directly!");
}
@@ -223,10 +223,10 @@
LuaImmovableDescription() {
}
- LuaImmovableDescription(const Widelands::ImmovableDescr* const immovabledescr)
+ explicit LuaImmovableDescription(const Widelands::ImmovableDescr* const immovabledescr)
: LuaMapObjectDescription(immovabledescr) {
}
- LuaImmovableDescription(lua_State* L) : LuaMapObjectDescription(L) {
+ explicit LuaImmovableDescription(lua_State* L) : LuaMapObjectDescription(L) {
}
void __persist(lua_State* L) override;
@@ -265,10 +265,10 @@
LuaBuildingDescription() {
}
- LuaBuildingDescription(const Widelands::BuildingDescr* const buildingdescr)
+ explicit LuaBuildingDescription(const Widelands::BuildingDescr* const buildingdescr)
: LuaMapObjectDescription(buildingdescr) {
}
- LuaBuildingDescription(lua_State* L) : LuaMapObjectDescription(L) {
+ explicit LuaBuildingDescription(lua_State* L) : LuaMapObjectDescription(L) {
}
void __persist(lua_State* L) override;
@@ -316,11 +316,11 @@
LuaConstructionSiteDescription() {
}
- LuaConstructionSiteDescription(
+ explicit LuaConstructionSiteDescription(
const Widelands::ConstructionSiteDescr* const constructionsitedescr)
: LuaBuildingDescription(constructionsitedescr) {
}
- LuaConstructionSiteDescription(lua_State* L) : LuaBuildingDescription(L) {
+ explicit LuaConstructionSiteDescription(lua_State* L) : LuaBuildingDescription(L) {
}
private:
@@ -336,10 +336,10 @@
LuaDismantleSiteDescription() {
}
- LuaDismantleSiteDescription(const Widelands::DismantleSiteDescr* const dismantlesitedescr)
+ explicit LuaDismantleSiteDescription(const Widelands::DismantleSiteDescr* const dismantlesitedescr)
: LuaBuildingDescription(dismantlesitedescr) {
}
- LuaDismantleSiteDescription(lua_State* L) : LuaBuildingDescription(L) {
+ explicit LuaDismantleSiteDescription(lua_State* L) : LuaBuildingDescription(L) {
}
private:
@@ -355,10 +355,10 @@
LuaProductionSiteDescription() {
}
- LuaProductionSiteDescription(const Widelands::ProductionSiteDescr* const productionsitedescr)
+ explicit LuaProductionSiteDescription(const Widelands::ProductionSiteDescr* const productionsitedescr)
: LuaBuildingDescription(productionsitedescr) {
}
- LuaProductionSiteDescription(lua_State* L) : LuaBuildingDescription(L) {
+ explicit LuaProductionSiteDescription(lua_State* L) : LuaBuildingDescription(L) {
}
/*
@@ -395,10 +395,10 @@
LuaMilitarySiteDescription() {
}
- LuaMilitarySiteDescription(const Widelands::MilitarySiteDescr* const militarysitedescr)
+ explicit LuaMilitarySiteDescription(const Widelands::MilitarySiteDescr* const militarysitedescr)
: LuaBuildingDescription(militarysitedescr) {
}
- LuaMilitarySiteDescription(lua_State* L) : LuaBuildingDescription(L) {
+ explicit LuaMilitarySiteDescription(lua_State* L) : LuaBuildingDescription(L) {
}
/*
@@ -428,10 +428,10 @@
LuaTrainingSiteDescription() {
}
- LuaTrainingSiteDescription(const Widelands::TrainingSiteDescr* const trainingsitedescr)
+ explicit LuaTrainingSiteDescription(const Widelands::TrainingSiteDescr* const trainingsitedescr)
: LuaProductionSiteDescription(trainingsitedescr) {
}
- LuaTrainingSiteDescription(lua_State* L) : LuaProductionSiteDescription(L) {
+ explicit LuaTrainingSiteDescription(lua_State* L) : LuaProductionSiteDescription(L) {
}
/*
@@ -476,10 +476,10 @@
LuaWarehouseDescription() {
}
- LuaWarehouseDescription(const Widelands::WarehouseDescr* const warehousedescr)
+ explicit LuaWarehouseDescription(const Widelands::WarehouseDescr* const warehousedescr)
: LuaBuildingDescription(warehousedescr) {
}
- LuaWarehouseDescription(lua_State* L) : LuaBuildingDescription(L) {
+ explicit LuaWarehouseDescription(lua_State* L) : LuaBuildingDescription(L) {
}
/*
@@ -508,10 +508,10 @@
LuaWareDescription() {
}
- LuaWareDescription(const Widelands::WareDescr* const waredescr)
+ explicit LuaWareDescription(const Widelands::WareDescr* const waredescr)
: LuaMapObjectDescription(waredescr) {
}
- LuaWareDescription(lua_State* L) : LuaMapObjectDescription(L) {
+ explicit LuaWareDescription(lua_State* L) : LuaMapObjectDescription(L) {
}
void __persist(lua_State* L) override;
@@ -546,10 +546,10 @@
LuaWorkerDescription() {
}
- LuaWorkerDescription(const Widelands::WorkerDescr* const workerdescr)
+ explicit LuaWorkerDescription(const Widelands::WorkerDescr* const workerdescr)
: LuaMapObjectDescription(workerdescr) {
}
- LuaWorkerDescription(lua_State* L) : LuaMapObjectDescription(L) {
+ explicit LuaWorkerDescription(lua_State* L) : LuaMapObjectDescription(L) {
}
void __persist(lua_State* L) override;
@@ -586,10 +586,10 @@
LuaSoldierDescription() {
}
- LuaSoldierDescription(const Widelands::SoldierDescr* const soldierdescr)
+ explicit LuaSoldierDescription(const Widelands::SoldierDescr* const soldierdescr)
: LuaWorkerDescription(soldierdescr) {
}
- LuaSoldierDescription(lua_State* L) : LuaWorkerDescription(L) {
+ explicit LuaSoldierDescription(lua_State* L) : LuaWorkerDescription(L) {
}
/*
@@ -632,10 +632,10 @@
LuaResourceDescription() : resourcedescr_(nullptr) {
}
- LuaResourceDescription(const Widelands::ResourceDescription* const resourcedescr)
+ explicit LuaResourceDescription(const Widelands::ResourceDescription* const resourcedescr)
: resourcedescr_(resourcedescr) {
}
- LuaResourceDescription(lua_State* L) : resourcedescr_(nullptr) {
+ explicit LuaResourceDescription(lua_State* L) : resourcedescr_(nullptr) {
report_error(L, "Cannot instantiate a 'LuaResourceDescription' directly!");
}
@@ -683,10 +683,10 @@
LuaTerrainDescription() : terraindescr_(nullptr) {
}
- LuaTerrainDescription(const Widelands::TerrainDescription* const terraindescr)
+ explicit LuaTerrainDescription(const Widelands::TerrainDescription* const terraindescr)
: terraindescr_(terraindescr) {
}
- LuaTerrainDescription(lua_State* L) : terraindescr_(nullptr) {
+ explicit LuaTerrainDescription(lua_State* L) : terraindescr_(nullptr) {
report_error(L, "Cannot instantiate a 'LuaTerrainDescription' directly!");
}
@@ -738,9 +738,9 @@
LuaEconomy() : economy_(nullptr) {
}
- LuaEconomy(Widelands::Economy* economy) : economy_(economy) {
+ explicit LuaEconomy(Widelands::Economy* economy) : economy_(economy) {
}
- LuaEconomy(lua_State* L) : economy_(nullptr) {
+ explicit LuaEconomy(lua_State* L) : economy_(nullptr) {
report_error(L, "Cannot instantiate a 'LuaEconomy' directly!");
}
@@ -790,10 +790,10 @@
LuaMapObject() : ptr_(nullptr) {
}
- LuaMapObject(Widelands::MapObject& mo) {
+ explicit LuaMapObject(Widelands::MapObject& mo) {
ptr_ = &mo;
}
- LuaMapObject(lua_State* L) : ptr_(nullptr) {
+ explicit LuaMapObject(lua_State* L) : ptr_(nullptr) {
report_error(L, "Cannot instantiate a '%s' directly!", className);
}
virtual ~LuaMapObject() {
@@ -831,9 +831,9 @@
LuaBaseImmovable() {
}
- LuaBaseImmovable(Widelands::BaseImmovable& mo) : LuaMapObject(mo) {
+ explicit LuaBaseImmovable(Widelands::BaseImmovable& mo) : LuaMapObject(mo) {
}
- LuaBaseImmovable(lua_State* L) : LuaMapObject(L) {
+ explicit LuaBaseImmovable(lua_State* L) : LuaMapObject(L) {
}
virtual ~LuaBaseImmovable() {
}
@@ -859,9 +859,9 @@
LuaPlayerImmovable() {
}
- LuaPlayerImmovable(Widelands::PlayerImmovable& mo) : LuaBaseImmovable(mo) {
+ explicit LuaPlayerImmovable(Widelands::PlayerImmovable& mo) : LuaBaseImmovable(mo) {
}
- LuaPlayerImmovable(lua_State* L) : LuaBaseImmovable(L) {
+ explicit LuaPlayerImmovable(lua_State* L) : LuaBaseImmovable(L) {
}
virtual ~LuaPlayerImmovable() {
}
@@ -888,9 +888,9 @@
LuaPortDock() {
}
- LuaPortDock(Widelands::PortDock& mo) : LuaPlayerImmovable(mo) {
+ explicit LuaPortDock(Widelands::PortDock& mo) : LuaPlayerImmovable(mo) {
}
- LuaPortDock(lua_State* L) : LuaPlayerImmovable(L) {
+ explicit LuaPortDock(lua_State* L) : LuaPlayerImmovable(L) {
}
virtual ~LuaPortDock() {
}
@@ -915,9 +915,9 @@
LuaBuilding() {
}
- LuaBuilding(Widelands::Building& mo) : LuaPlayerImmovable(mo) {
+ explicit LuaBuilding(Widelands::Building& mo) : LuaPlayerImmovable(mo) {
}
- LuaBuilding(lua_State* L) : LuaPlayerImmovable(L) {
+ explicit LuaBuilding(lua_State* L) : LuaPlayerImmovable(L) {
}
virtual ~LuaBuilding() {
}
@@ -943,9 +943,9 @@
LuaFlag() {
}
- LuaFlag(Widelands::Flag& mo) : LuaPlayerImmovable(mo) {
+ explicit LuaFlag(Widelands::Flag& mo) : LuaPlayerImmovable(mo) {
}
- LuaFlag(lua_State* L) : LuaPlayerImmovable(L) {
+ explicit LuaFlag(lua_State* L) : LuaPlayerImmovable(L) {
}
virtual ~LuaFlag() {
}
@@ -974,9 +974,9 @@
LuaRoad() {
}
- LuaRoad(Widelands::Road& mo) : LuaPlayerImmovable(mo) {
+ explicit LuaRoad(Widelands::Road& mo) : LuaPlayerImmovable(mo) {
}
- LuaRoad(lua_State* L) : LuaPlayerImmovable(L) {
+ explicit LuaRoad(lua_State* L) : LuaPlayerImmovable(L) {
}
virtual ~LuaRoad() {
}
@@ -1011,9 +1011,9 @@
LuaConstructionSite() {
}
- LuaConstructionSite(Widelands::ConstructionSite& mo) : LuaBuilding(mo) {
+ explicit LuaConstructionSite(Widelands::ConstructionSite& mo) : LuaBuilding(mo) {
}
- LuaConstructionSite(lua_State* L) : LuaBuilding(L) {
+ explicit LuaConstructionSite(lua_State* L) : LuaBuilding(L) {
}
virtual ~LuaConstructionSite() {
}
@@ -1039,9 +1039,9 @@
LuaWarehouse() {
}
- LuaWarehouse(Widelands::Warehouse& mo) : LuaBuilding(mo) {
+ explicit LuaWarehouse(Widelands::Warehouse& mo) : LuaBuilding(mo) {
}
- LuaWarehouse(lua_State* L) : LuaBuilding(L) {
+ explicit LuaWarehouse(lua_State* L) : LuaBuilding(L) {
}
virtual ~LuaWarehouse() {
}
@@ -1078,9 +1078,9 @@
LuaProductionSite() {
}
- LuaProductionSite(Widelands::ProductionSite& mo) : LuaBuilding(mo) {
+ explicit LuaProductionSite(Widelands::ProductionSite& mo) : LuaBuilding(mo) {
}
- LuaProductionSite(lua_State* L) : LuaBuilding(L) {
+ explicit LuaProductionSite(lua_State* L) : LuaBuilding(L) {
}
virtual ~LuaProductionSite() {
}
@@ -1114,9 +1114,9 @@
LuaMilitarySite() {
}
- LuaMilitarySite(Widelands::MilitarySite& mo) : LuaBuilding(mo) {
+ explicit LuaMilitarySite(Widelands::MilitarySite& mo) : LuaBuilding(mo) {
}
- LuaMilitarySite(lua_State* L) : LuaBuilding(L) {
+ explicit LuaMilitarySite(lua_State* L) : LuaBuilding(L) {
}
virtual ~LuaMilitarySite() {
}
@@ -1144,9 +1144,9 @@
LuaTrainingSite() {
}
- LuaTrainingSite(Widelands::TrainingSite& mo) : LuaProductionSite(mo) {
+ explicit LuaTrainingSite(Widelands::TrainingSite& mo) : LuaProductionSite(mo) {
}
- LuaTrainingSite(lua_State* L) : LuaProductionSite(L) {
+ explicit LuaTrainingSite(lua_State* L) : LuaProductionSite(L) {
}
virtual ~LuaTrainingSite() {
}
@@ -1174,9 +1174,9 @@
LuaBob() {
}
- LuaBob(Widelands::Bob& mo) : LuaMapObject(mo) {
+ explicit LuaBob(Widelands::Bob& mo) : LuaMapObject(mo) {
}
- LuaBob(lua_State* L) : LuaMapObject(L) {
+ explicit LuaBob(lua_State* L) : LuaMapObject(L) {
}
virtual ~LuaBob() {
}
@@ -1203,9 +1203,9 @@
LuaWorker() {
}
- LuaWorker(Widelands::Worker& w) : LuaBob(w) {
+ explicit LuaWorker(Widelands::Worker& w) : LuaBob(w) {
}
- LuaWorker(lua_State* L) : LuaBob(L) {
+ explicit LuaWorker(lua_State* L) : LuaBob(L) {
}
virtual ~LuaWorker() {
}
@@ -1232,9 +1232,9 @@
LuaSoldier() {
}
- LuaSoldier(Widelands::Soldier& w) : LuaWorker(w) {
+ explicit LuaSoldier(Widelands::Soldier& w) : LuaWorker(w) {
}
- LuaSoldier(lua_State* L) : LuaWorker(L) {
+ explicit LuaSoldier(lua_State* L) : LuaWorker(L) {
}
virtual ~LuaSoldier() {
}
@@ -1263,9 +1263,9 @@
LuaShip() {
}
- LuaShip(Widelands::Ship& s) : LuaBob(s) {
+ explicit LuaShip(Widelands::Ship& s) : LuaBob(s) {
}
- LuaShip(lua_State* L) : LuaBob(L) {
+ explicit LuaShip(lua_State* L) : LuaBob(L) {
}
virtual ~LuaShip() {
}
@@ -1304,11 +1304,11 @@
LuaField() {
}
- LuaField(int16_t x, int16_t y) : coords_(Widelands::Coords(x, y)) {
- }
- LuaField(Widelands::Coords c) : coords_(c) {
- }
- LuaField(lua_State* L) {
+ explicit LuaField(int16_t x, int16_t y) : coords_(Widelands::Coords(x, y)) {
+ }
+ explicit LuaField(Widelands::Coords c) : coords_(c) {
+ }
+ explicit LuaField(lua_State* L) {
report_error(L, "Cannot instantiate a 'Field' directly!");
}
virtual ~LuaField() {
@@ -1378,9 +1378,9 @@
LuaPlayerSlot() : player_number_(0) {
}
- LuaPlayerSlot(Widelands::PlayerNumber plr) : player_number_(plr) {
+ explicit LuaPlayerSlot(Widelands::PlayerNumber plr) : player_number_(plr) {
}
- LuaPlayerSlot(lua_State* L) : player_number_(0) {
+ explicit LuaPlayerSlot(lua_State* L) : player_number_(0) {
report_error(L, "Cannot instantiate a 'PlayerSlot' directly!");
}
virtual ~LuaPlayerSlot() {
=== modified file 'src/scripting/lua_path.cc'
--- src/scripting/lua_path.cc 2017-01-25 18:55:59 +0000
+++ src/scripting/lua_path.cc 2017-06-24 09:44:24 +0000
@@ -32,7 +32,7 @@
/// A class that makes iteration over filename_?.png templates easy.
class NumberGlob {
public:
- NumberGlob(const std::string& file_template);
+ explicit NumberGlob(const std::string& file_template);
/// If there is a next filename, puts it in 's' and returns true.
bool next(std::string* s);
=== modified file 'src/scripting/lua_root.h'
--- src/scripting/lua_root.h 2017-01-25 18:55:59 +0000
+++ src/scripting/lua_root.h 2017-06-24 09:44:24 +0000
@@ -45,7 +45,7 @@
LuaGame() {
}
- LuaGame(lua_State* L);
+ explicit LuaGame(lua_State* L);
void __persist(lua_State* L) override;
void __unpersist(lua_State* L) override;
@@ -82,7 +82,7 @@
LuaEditor() {
}
- LuaEditor(lua_State* L);
+ explicit LuaEditor(lua_State* L);
virtual ~LuaEditor() {
}
@@ -111,7 +111,7 @@
LuaWorld() {
}
- LuaWorld(lua_State* L);
+ explicit LuaWorld(lua_State* L);
void __persist(lua_State* L) override;
void __unpersist(lua_State* L) override;
@@ -147,7 +147,7 @@
LuaTribes() {
}
- LuaTribes(lua_State* L);
+ explicit LuaTribes(lua_State* L);
void __persist(lua_State* L) override;
void __unpersist(lua_State* L) override;
=== modified file 'src/scripting/lua_table.h'
--- src/scripting/lua_table.h 2017-01-25 18:55:59 +0000
+++ src/scripting/lua_table.h 2017-06-24 09:44:24 +0000
@@ -33,7 +33,7 @@
class LuaTableKeyError : public LuaError {
public:
- LuaTableKeyError(const std::string& wanted)
+ explicit LuaTableKeyError(const std::string& wanted)
: LuaError(wanted + " is not a field in this table.") {
}
};
=== modified file 'src/scripting/lua_ui.h'
--- src/scripting/lua_ui.h 2017-01-25 18:55:59 +0000
+++ src/scripting/lua_ui.h 2017-06-24 09:44:24 +0000
@@ -48,9 +48,9 @@
LuaPanel() : panel_(nullptr) {
}
- LuaPanel(UI::Panel* p) : panel_(p) {
+ explicit LuaPanel(UI::Panel* p) : panel_(p) {
}
- LuaPanel(lua_State* L) : panel_(nullptr) {
+ explicit LuaPanel(lua_State* L) : panel_(nullptr) {
report_error(L, "Cannot instantiate a '%s' directly!", className);
}
virtual ~LuaPanel() {
@@ -95,9 +95,9 @@
LuaButton() : LuaPanel() {
}
- LuaButton(UI::Panel* p) : LuaPanel(p) {
+ explicit LuaButton(UI::Panel* p) : LuaPanel(p) {
}
- LuaButton(lua_State* L) : LuaPanel(L) {
+ explicit LuaButton(lua_State* L) : LuaPanel(L) {
}
virtual ~LuaButton() {
}
@@ -127,9 +127,9 @@
LuaTab() : LuaPanel() {
}
- LuaTab(UI::Panel* p) : LuaPanel(p) {
+ explicit LuaTab(UI::Panel* p) : LuaPanel(p) {
}
- LuaTab(lua_State* L) : LuaPanel(L) {
+ explicit LuaTab(lua_State* L) : LuaPanel(L) {
}
virtual ~LuaTab() {
}
@@ -159,9 +159,9 @@
LuaWindow() : LuaPanel() {
}
- LuaWindow(UI::Panel* p) : LuaPanel(p) {
+ explicit LuaWindow(UI::Panel* p) : LuaPanel(p) {
}
- LuaWindow(lua_State* L) : LuaPanel(L) {
+ explicit LuaWindow(lua_State* L) : LuaPanel(L) {
}
virtual ~LuaWindow() {
}
@@ -190,9 +190,9 @@
LuaMapView() : LuaPanel() {
}
- LuaMapView(MapView* p) : LuaPanel(p) {
+ explicit LuaMapView(MapView* p) : LuaPanel(p) {
}
- LuaMapView(lua_State* L);
+ explicit LuaMapView(lua_State* L);
virtual ~LuaMapView() {
}
=== modified file 'src/scripting/test/test_luna.cc'
--- src/scripting/test/test_luna.cc 2017-06-23 08:33:03 +0000
+++ src/scripting/test/test_luna.cc 2017-06-24 09:44:24 +0000
@@ -58,7 +58,7 @@
LuaClass() : x(123), prop(246) {
}
virtual ~LuaClass();
- LuaClass(lua_State* /* L */) : x(124), prop(248) {
+ explicit LuaClass(lua_State* /* L */) : x(124), prop(248) {
}
virtual int test(lua_State* L) {
lua_pushuint32(L, x);
@@ -98,7 +98,7 @@
LUNA_CLASS_HEAD(LuaSubClass);
LuaSubClass() : y(1230) {
}
- LuaSubClass(lua_State* L) : LuaClass(L), y(1240) {
+ explicit LuaSubClass(lua_State* L) : LuaClass(L), y(1240) {
}
virtual int subtest(lua_State* L);
void __persist(lua_State* /* L */) override {
@@ -125,7 +125,7 @@
LUNA_CLASS_HEAD(LuaVirtualClass);
LuaVirtualClass() : z(12300) {
}
- LuaVirtualClass(lua_State* L) : LuaClass(L), z(12400) {
+ explicit LuaVirtualClass(lua_State* L) : LuaClass(L), z(12400) {
}
virtual int virtualtest(lua_State* L);
void __persist(lua_State* /* L */) override {
@@ -168,7 +168,7 @@
LUNA_CLASS_HEAD(LuaMultiClass);
LuaMultiClass() : z(12300) {
}
- LuaMultiClass(lua_State* L) : LuaClass(L), z(12400) {
+ explicit LuaMultiClass(lua_State* L) : LuaClass(L), z(12400) {
}
virtual int virtualtest(lua_State* L);
void __persist(lua_State* /* L */) override {
=== modified file 'src/sound/fxset.h'
--- src/sound/fxset.h 2017-01-25 18:55:59 +0000
+++ src/sound/fxset.h 2017-06-24 09:44:24 +0000
@@ -45,7 +45,7 @@
*/
struct FXset {
friend class SoundHandler;
- FXset(uint8_t priority = PRIO_MEDIUM);
+ explicit FXset(uint8_t priority = PRIO_MEDIUM);
~FXset();
void add_fx(Mix_Chunk* fx, uint8_t prio = PRIO_MEDIUM);
=== modified file 'src/ui_basic/progresswindow.h'
--- src/ui_basic/progresswindow.h 2017-05-14 04:38:39 +0000
+++ src/ui_basic/progresswindow.h 2017-06-24 09:44:24 +0000
@@ -47,7 +47,7 @@
/// Manages a progress window on the screen.
struct ProgressWindow : public UI::FullscreenWindow {
- ProgressWindow(const std::string& background = std::string());
+ explicit ProgressWindow(const std::string& background = std::string());
~ProgressWindow();
/// Register additional visualization (tips/hints, animation, etc)
=== modified file 'src/ui_basic/table.h'
--- src/ui_basic/table.h 2017-03-14 06:48:59 +0000
+++ src/ui_basic/table.h 2017-06-24 09:44:24 +0000
@@ -123,7 +123,7 @@
template <> class Table<void*> : public Panel {
public:
struct EntryRecord {
- EntryRecord(void* entry);
+ explicit EntryRecord(void* entry);
void set_picture(uint8_t col, const Image* pic, const std::string& = std::string());
void set_string(uint8_t col, const std::string&);
=== modified file 'src/ui_fsmenu/campaign_select.h'
--- src/ui_fsmenu/campaign_select.h 2017-01-25 18:55:59 +0000
+++ src/ui_fsmenu/campaign_select.h 2017-06-24 09:44:24 +0000
@@ -93,7 +93,7 @@
*/
class FullscreenMenuCampaignMapSelect : public FullscreenMenuLoadMapOrGame {
public:
- FullscreenMenuCampaignMapSelect(bool is_tutorial = false);
+ explicit FullscreenMenuCampaignMapSelect(bool is_tutorial = false);
std::string get_map();
void set_campaign(uint32_t);
=== modified file 'src/ui_fsmenu/options.h'
--- src/ui_fsmenu/options.h 2017-01-25 18:55:59 +0000
+++ src/ui_fsmenu/options.h 2017-06-24 09:44:24 +0000
@@ -79,7 +79,7 @@
uint32_t active_tab;
};
- OptionsCtrl(Section&);
+ explicit OptionsCtrl(Section&);
void handle_menu();
OptionsCtrl::OptionsStruct options_struct(uint32_t active_tab);
void save_options();
@@ -95,7 +95,7 @@
class FullscreenMenuOptions : public FullscreenMenuBase {
public:
- FullscreenMenuOptions(OptionsCtrl::OptionsStruct opt);
+ explicit FullscreenMenuOptions(OptionsCtrl::OptionsStruct opt);
OptionsCtrl::OptionsStruct get_values();
private:
=== modified file 'src/wui/interactive_base.cc'
--- src/wui/interactive_base.cc 2017-06-15 16:34:58 +0000
+++ src/wui/interactive_base.cc 2017-06-24 09:44:24 +0000
@@ -70,7 +70,7 @@
MiniMap::Registry minimap;
std::unique_ptr<QuickNavigation> quicknavigation;
- InteractiveBaseInternals(QuickNavigation* qnav) : mm(nullptr), quicknavigation(qnav) {
+ explicit InteractiveBaseInternals(QuickNavigation* qnav) : mm(nullptr), quicknavigation(qnav) {
}
};
=== modified file 'src/wui/login_box.h'
--- src/wui/login_box.h 2017-01-25 18:55:59 +0000
+++ src/wui/login_box.h 2017-06-24 09:44:24 +0000
@@ -27,7 +27,7 @@
#include "ui_basic/window.h"
struct LoginBox : public UI::Window {
- LoginBox(UI::Panel&);
+ explicit LoginBox(UI::Panel&);
std::string get_nickname() {
return eb_nickname->text();
=== modified file 'src/wui/quicknavigation.h'
--- src/wui/quicknavigation.h 2017-01-25 18:55:59 +0000
+++ src/wui/quicknavigation.h 2017-06-24 09:44:24 +0000
@@ -44,7 +44,7 @@
}
};
- QuickNavigation(MapView* map_view);
+ explicit QuickNavigation(MapView* map_view);
// Set the landmark for 'index' to 'view'. 'index' must be < 10.
void set_landmark(size_t index, const MapView::View& view);
Follow ups