diff options
author | Maxim Pimenov <m@maps.me> | 2019-04-15 17:47:05 +0300 |
---|---|---|
committer | Arsentiy Milchakov <milcars@mapswithme.com> | 2019-04-15 21:01:06 +0300 |
commit | 1d0428d056aa2e6b0024f991991f5c513cff9f73 (patch) | |
tree | cff44256529314ec8fcc9ea22fab87520a76e33a /software_renderer | |
parent | 25087ac0bf7e8c41e0d0684e43b5285a8b8be47c (diff) |
Several explicit constructors per the Cppcheck report.
Diffstat (limited to 'software_renderer')
-rw-r--r-- | software_renderer/feature_styler.cpp | 4 | ||||
-rw-r--r-- | software_renderer/geometry_processors.hpp | 26 | ||||
-rw-r--r-- | software_renderer/path_info.hpp | 2 | ||||
-rw-r--r-- | software_renderer/software_renderer.cpp | 2 | ||||
-rw-r--r-- | software_renderer/text_engine.h | 6 |
5 files changed, 20 insertions, 20 deletions
diff --git a/software_renderer/feature_styler.cpp b/software_renderer/feature_styler.cpp index 78537da09f..0e37081f5d 100644 --- a/software_renderer/feature_styler.cpp +++ b/software_renderer/feature_styler.cpp @@ -270,7 +270,7 @@ template <class IterT> class RangeIterT : { IterT m_iter; public: - RangeIterT(IterT iter) : m_iter(iter) {} + explicit RangeIterT(IterT iter) : m_iter(iter) {} RangeT dereference() const { @@ -289,7 +289,7 @@ template <class ContT> class RangeInserter { ContT & m_cont; public: - RangeInserter(ContT & cont) : m_cont(cont) {} + explicit RangeInserter(ContT & cont) : m_cont(cont) {} RangeInserter & operator*() { return *this; } RangeInserter & operator++(int) { return *this; } diff --git a/software_renderer/geometry_processors.hpp b/software_renderer/geometry_processors.hpp index 7f17e63e90..59b657747e 100644 --- a/software_renderer/geometry_processors.hpp +++ b/software_renderer/geometry_processors.hpp @@ -36,7 +36,7 @@ struct base {} }; - base(params const & p) + explicit base(params const & p) : m_convertor(p.m_convertor) { } @@ -65,7 +65,7 @@ struct base_global : public base params() : m_rect(0){} }; - base_global(params const & p) + explicit base_global(params const & p) : base(p), m_rect(p.m_rect) { } @@ -83,7 +83,7 @@ struct base_screen : public base {} }; - base_screen(params const & p); + explicit base_screen(params const & p); m2::PointD convert_point(m2::PointD const & pt) const { @@ -102,7 +102,7 @@ struct calc_length : public TBase typedef typename TBase::params params; - calc_length(params const & p) : + explicit calc_length(params const & p) : TBase(p), m_exist(false), m_length(0) {} @@ -130,7 +130,7 @@ struct one_point : public base_global typedef base_global::params params; - one_point(params const & p) + explicit one_point(params const & p) : base_global(p), m_exist(false) { } @@ -151,7 +151,7 @@ public: typedef typename TBase::params params; - geometry_base(params const & p) + explicit geometry_base(params const & p) : TBase(p) { } @@ -184,12 +184,12 @@ struct interval_params : public geometry_base<PathInfo, base_screen> params() : m_intervals(0) {} }; - interval_params(params const & p); + explicit interval_params(params const & p); }; struct get_path_intervals : public interval_params { - get_path_intervals(params const & p) : interval_params(p) {} + explicit get_path_intervals(params const & p) : interval_params(p) {} void operator() (m2::PointD const & pt); @@ -200,7 +200,7 @@ struct cut_path_intervals : public interval_params { size_t m_pos; - cut_path_intervals(params const & p) : interval_params(p), m_pos(0) {} + explicit cut_path_intervals(params const & p) : interval_params(p), m_pos(0) {} void operator() (m2::PointD const & p); @@ -239,7 +239,7 @@ public: {} }; - path_points(params const & p) + explicit path_points(params const & p) : base_type(p), m_newPL(true), m_hasPrevPt(false), @@ -264,7 +264,7 @@ public: typedef base_type::params params; - area_base(params const & p) + explicit area_base(params const & p) : base_type(p) { } @@ -276,7 +276,7 @@ class area_tess_points : public area_base public: typedef area_base::params params; - area_tess_points(params const & p) + explicit area_tess_points(params const & p) : area_base(p) { } @@ -308,7 +308,7 @@ public: typedef typename TBase::params params; - filter_screenpts_adapter(params const & p) + explicit filter_screenpts_adapter(params const & p) : TBase(p), m_prev(numeric_limits<double>::min(), numeric_limits<double>::min()), m_center(0, 0) { diff --git a/software_renderer/path_info.hpp b/software_renderer/path_info.hpp index 6d21e93535..2c558d51ed 100644 --- a/software_renderer/path_info.hpp +++ b/software_renderer/path_info.hpp @@ -18,7 +18,7 @@ public: vector<m2::PointD> m_path; // -1.0 means "not" initialized - PathInfo(double offset = -1.0) : m_fullL(-1.0), m_offset(offset) {} + explicit PathInfo(double offset = -1.0) : m_fullL(-1.0), m_offset(offset) {} void swap(PathInfo & r) { diff --git a/software_renderer/software_renderer.cpp b/software_renderer/software_renderer.cpp index 64f46fe450..f19664582b 100644 --- a/software_renderer/software_renderer.cpp +++ b/software_renderer/software_renderer.cpp @@ -594,7 +594,7 @@ m2::RectD SoftwareRenderer::FrameRect() const template <class VertexSource> class conv_count { public: - conv_count(VertexSource & vs) + explicit conv_count(VertexSource & vs) : m_source(&vs) , m_count(0) { diff --git a/software_renderer/text_engine.h b/software_renderer/text_engine.h index a69f5273f3..2b8dd59f8b 100644 --- a/software_renderer/text_engine.h +++ b/software_renderer/text_engine.h @@ -57,7 +57,7 @@ public: struct text_engine_exception : public std::runtime_error { - text_engine_exception(std::string const & s) : std::runtime_error(s) {} + explicit text_engine_exception(std::string const & s) : std::runtime_error(s) {} }; class text_renderer @@ -86,7 +86,7 @@ class text_options float m_ascender; public: - text_options(face const & f) + explicit text_options(face const & f) : m_flip_y(f.flip_y()), m_offset(0, 0), m_horizontal_align(0), @@ -161,7 +161,7 @@ public: }; text() {} - text(strings::UniString const & src) { set_text(src); } + explicit text(strings::UniString const & src) { set_text(src); } void swap(text & t) { |