[core] Fix readability-redundant-member-init errors in header files

As reported by clang-tidy-8.
This commit is contained in:
Thiago Marcos P. Santos
2020-03-27 18:30:35 +02:00
parent dffe00feea
commit c4cb026fa4
21 changed files with 24 additions and 23 deletions

View File

@@ -61,7 +61,7 @@ public:
virtual void deinitialize() = 0;
};
class CustomLayer : public Layer {
class CustomLayer final : public Layer {
public:
CustomLayer(const std::string& id,
std::unique_ptr<CustomLayerHost> host);

View File

@@ -18,8 +18,8 @@ public:
private:
optional<mbgl::Value> legacyFilter;
public:
Filter() : expression() {}
Filter() {}
Filter(expression::ParseResult _expression, optional<mbgl::Value> _filter = {})
: expression(std::move(*_expression)),
legacyFilter(std::move(_filter)){

View File

@@ -14,7 +14,7 @@ namespace style {
class TransitionOptions;
class BackgroundLayer : public Layer {
class BackgroundLayer final : public Layer {
public:
BackgroundLayer(const std::string& layerID);
~BackgroundLayer() final;

View File

@@ -14,7 +14,7 @@ namespace style {
class TransitionOptions;
class CircleLayer : public Layer {
class CircleLayer final : public Layer {
public:
CircleLayer(const std::string& layerID, const std::string& sourceID);
~CircleLayer() final;

View File

@@ -14,7 +14,7 @@ namespace style {
class TransitionOptions;
class FillExtrusionLayer : public Layer {
class FillExtrusionLayer final : public Layer {
public:
FillExtrusionLayer(const std::string& layerID, const std::string& sourceID);
~FillExtrusionLayer() final;

View File

@@ -14,7 +14,7 @@ namespace style {
class TransitionOptions;
class FillLayer : public Layer {
class FillLayer final : public Layer {
public:
FillLayer(const std::string& layerID, const std::string& sourceID);
~FillLayer() final;

View File

@@ -15,7 +15,7 @@ namespace style {
class TransitionOptions;
class HeatmapLayer : public Layer {
class HeatmapLayer final : public Layer {
public:
HeatmapLayer(const std::string& layerID, const std::string& sourceID);
~HeatmapLayer() final;

View File

@@ -14,7 +14,7 @@ namespace style {
class TransitionOptions;
class HillshadeLayer : public Layer {
class HillshadeLayer final : public Layer {
public:
HillshadeLayer(const std::string& layerID, const std::string& sourceID);
~HillshadeLayer() final;

View File

@@ -32,7 +32,7 @@ namespace style {
class TransitionOptions;
class <%- camelize(type) %>Layer : public Layer {
class <%- camelize(type) %>Layer final : public Layer {
public:
<% if ((type === 'background') || (type === 'location-indicator')) { -%>
<%- camelize(type) %>Layer(const std::string& layerID);

View File

@@ -17,7 +17,7 @@ namespace style {
class TransitionOptions;
class LineLayer : public Layer {
class LineLayer final : public Layer {
public:
LineLayer(const std::string& layerID, const std::string& sourceID);
~LineLayer() final;

View File

@@ -15,10 +15,10 @@ namespace style {
class TransitionOptions;
class LocationIndicatorLayer : public Layer {
class LocationIndicatorLayer final : public Layer {
public:
LocationIndicatorLayer(const std::string& layerID);
~LocationIndicatorLayer() final;
~LocationIndicatorLayer();
// Layout properties

View File

@@ -14,7 +14,7 @@ namespace style {
class TransitionOptions;
class RasterLayer : public Layer {
class RasterLayer final : public Layer {
public:
RasterLayer(const std::string& layerID, const std::string& sourceID);
~RasterLayer() final;

View File

@@ -17,7 +17,7 @@ namespace style {
class TransitionOptions;
class SymbolLayer : public Layer {
class SymbolLayer final : public Layer {
public:
SymbolLayer(const std::string& layerID, const std::string& sourceID);
~SymbolLayer() final;

View File

@@ -33,8 +33,7 @@ public:
zoomRange(zoomRange_),
attribution(std::move(attribution_)),
scheme(scheme_),
encoding(encoding_),
bounds(){};
encoding(encoding_){};
// TileJSON also includes center and zoom but they are not used by mbgl.

View File

@@ -11,7 +11,7 @@ namespace mbgl {
class Mailbox;
class FileSourceRequest : public AsyncRequest {
class FileSourceRequest final : public AsyncRequest {
public:
FileSourceRequest(FileSource::Callback&& callback);
~FileSourceRequest() final;

View File

@@ -71,7 +71,7 @@ public:
GLXFBConfig* fbConfigs = nullptr;
};
class GLXBackendImpl : public HeadlessBackend::Impl {
class GLXBackendImpl final : public HeadlessBackend::Impl {
public:
GLXBackendImpl() {
// Try to create a legacy context.

View File

@@ -26,7 +26,7 @@ struct StillImageRequest {
Map::StillImageCallback callback;
};
class Map::Impl : public style::Observer, public RendererObserver {
class Map::Impl final : public style::Observer, public RendererObserver {
public:
Impl(RendererFrontend&, MapObserver&, std::shared_ptr<FileSource>, const MapOptions&);
~Impl() final;

View File

@@ -17,7 +17,7 @@ public:
explicit PropertyEvaluationParameters(float z_)
: z(z_),
now(Clock::time_point::max()),
zoomHistory(),
defaultFadeDuration(0) {}
PropertyEvaluationParameters(ZoomHistory zoomHistory_, TimePoint now_, Duration defaultFadeDuration_)

View File

@@ -11,7 +11,7 @@ class CanonicalTileID;
namespace style {
class GeoJSONSource::Impl : public Source::Impl {
class GeoJSONSource::Impl final : public Source::Impl {
public:
Impl(std::string id, Immutable<GeoJSONOptions>);
Impl(const GeoJSONSource::Impl&, std::shared_ptr<GeoJSONData>);

View File

@@ -9,7 +9,7 @@ namespace mbgl {
namespace style {
class ImageSource::Impl : public Source::Impl {
class ImageSource::Impl final : public Source::Impl {
public:
Impl(std::string id, std::array<LatLng, 4> coords);
Impl(const Impl& other, std::array<LatLng, 4> coords);

View File

@@ -25,6 +25,7 @@ public:
template <class... Args>
GeometryCoordinates(Args&&... args) : std::vector<GeometryCoordinate>(std::forward<Args>(args)...) {}
GeometryCoordinates(std::initializer_list<GeometryCoordinate> args) : std::vector<GeometryCoordinate>(args) {}
GeometryCoordinates() = default;
};
class GeometryCollection : public std::vector<GeometryCoordinates> {
@@ -35,6 +36,7 @@ public:
GeometryCollection(std::initializer_list<GeometryCoordinates> args) : std::vector<GeometryCoordinates>(args) {}
GeometryCollection(GeometryCollection&&) = default;
GeometryCollection& operator=(GeometryCollection&&) = default;
GeometryCollection() = default;
GeometryCollection clone() const { return GeometryCollection(*this); }