summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2020-03-27 17:43:37 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2020-03-30 23:37:44 +0300
commit62b543e44a5d63dd79dfc7ab68696dc8a3f8e3ef (patch)
tree3e1b27e9cedbc53b43ec952579553618731ab671
parent65f4df5190d764a12a2c8054bfce2838545917e7 (diff)
downloadqtlocation-mapboxgl-62b543e44a5d63dd79dfc7ab68696dc8a3f8e3ef.tar.gz
[core] Fix google-explicit-constructor errors
As reported by clang-tidy-8.
-rw-r--r--platform/default/src/mbgl/storage/local_file_source.cpp2
-rw-r--r--platform/default/src/mbgl/storage/sqlite3.cpp4
-rw-r--r--platform/default/src/mbgl/util/async_task.cpp5
-rw-r--r--platform/default/src/mbgl/util/jpeg_reader.cpp3
-rw-r--r--platform/glfw/glfw_gl_backend.cpp3
-rw-r--r--platform/glfw/test_writer.cpp6
-rw-r--r--platform/linux/src/headless_backend_glx.cpp2
-rw-r--r--src/mbgl/annotation/annotation_tile.cpp3
-rw-r--r--src/mbgl/style/expression/compound_expression.cpp2
-rw-r--r--src/mbgl/style/expression/expression.cpp2
10 files changed, 12 insertions, 20 deletions
diff --git a/platform/default/src/mbgl/storage/local_file_source.cpp b/platform/default/src/mbgl/storage/local_file_source.cpp
index b505303fc0..5d92e711a1 100644
--- a/platform/default/src/mbgl/storage/local_file_source.cpp
+++ b/platform/default/src/mbgl/storage/local_file_source.cpp
@@ -19,7 +19,7 @@ namespace mbgl {
class LocalFileSource::Impl {
public:
- Impl(const ActorRef<Impl>&) {}
+ explicit Impl(const ActorRef<Impl>&) {}
void request(const std::string& url, const ActorRef<FileSourceRequest>& req) {
if (!acceptsURL(url)) {
diff --git a/platform/default/src/mbgl/storage/sqlite3.cpp b/platform/default/src/mbgl/storage/sqlite3.cpp
index 69d03c4e00..03c1c2e44d 100644
--- a/platform/default/src/mbgl/storage/sqlite3.cpp
+++ b/platform/default/src/mbgl/storage/sqlite3.cpp
@@ -46,9 +46,7 @@ void setTempPath(const std::string& path) {
class DatabaseImpl {
public:
- DatabaseImpl(sqlite3* db_)
- : db(db_)
- {
+ explicit DatabaseImpl(sqlite3* db_) : db(db_) {
const int error = sqlite3_extended_result_codes(db, true);
if (error != SQLITE_OK) {
mbgl::Log::Warning(mbgl::Event::Database, error, "Failed to enable extended result codes: %s", sqlite3_errmsg(db));
diff --git a/platform/default/src/mbgl/util/async_task.cpp b/platform/default/src/mbgl/util/async_task.cpp
index 50891056d8..d82b8085a1 100644
--- a/platform/default/src/mbgl/util/async_task.cpp
+++ b/platform/default/src/mbgl/util/async_task.cpp
@@ -12,10 +12,7 @@ namespace util {
class AsyncTask::Impl {
public:
- Impl(std::function<void()>&& fn)
- : async(new uv_async_t),
- task(std::move(fn)) {
-
+ explicit Impl(std::function<void()> fn) : async(new uv_async_t), task(std::move(fn)) {
auto* loop = reinterpret_cast<uv_loop_t*>(RunLoop::getLoopHandle());
if (uv_async_init(loop, async, asyncCallback) != 0) {
throw std::runtime_error("Failed to initialize async.");
diff --git a/platform/default/src/mbgl/util/jpeg_reader.cpp b/platform/default/src/mbgl/util/jpeg_reader.cpp
index 69df494e70..8daa02f076 100644
--- a/platform/default/src/mbgl/util/jpeg_reader.cpp
+++ b/platform/default/src/mbgl/util/jpeg_reader.cpp
@@ -79,8 +79,7 @@ static void on_error_message(j_common_ptr cinfo) {
}
struct jpeg_info_guard {
- jpeg_info_guard(jpeg_decompress_struct* cinfo)
- : i_(cinfo) {}
+ explicit jpeg_info_guard(jpeg_decompress_struct* cinfo) : i_(cinfo) {}
~jpeg_info_guard() {
jpeg_destroy_decompress(i_);
diff --git a/platform/glfw/glfw_gl_backend.cpp b/platform/glfw/glfw_gl_backend.cpp
index 0a949016ed..6eb58d4fa6 100644
--- a/platform/glfw/glfw_gl_backend.cpp
+++ b/platform/glfw/glfw_gl_backend.cpp
@@ -7,8 +7,7 @@
class GLFWGLRenderableResource final : public mbgl::gl::RenderableResource {
public:
- GLFWGLRenderableResource(GLFWGLBackend& backend_) : backend(backend_) {
- }
+ explicit GLFWGLRenderableResource(GLFWGLBackend& backend_) : backend(backend_) {}
void bind() override {
backend.setFramebufferBinding(0);
diff --git a/platform/glfw/test_writer.cpp b/platform/glfw/test_writer.cpp
index 9fe06cc2ca..71dae3ef5d 100644
--- a/platform/glfw/test_writer.cpp
+++ b/platform/glfw/test_writer.cpp
@@ -20,7 +20,7 @@ public:
class SetCamera final : public TestOperationSerializer {
public:
- SetCamera(mbgl::CameraOptions camera_) : camera(std::move(camera_)) {}
+ explicit SetCamera(mbgl::CameraOptions camera_) : camera(std::move(camera_)) {}
void serialize(Writer& writer) const override {
if (camera.zoom) {
@@ -59,7 +59,7 @@ private:
class SetStyle final : public TestOperationSerializer {
public:
- SetStyle(const mbgl::style::Style& style) : url(style.getURL()) {}
+ explicit SetStyle(const mbgl::style::Style& style) : url(style.getURL()) {}
void serialize(Writer& writer) const override {
writer.StartArray();
@@ -74,7 +74,7 @@ private:
class SetInitialSize final : public TestOperationSerializer {
public:
- SetInitialSize(const mbgl::Size& size) : width(size.width), height(size.height) {}
+ explicit SetInitialSize(const mbgl::Size& size) : width(size.width), height(size.height) {}
void serialize(Writer& writer) const override {
writer.Key("width");
diff --git a/platform/linux/src/headless_backend_glx.cpp b/platform/linux/src/headless_backend_glx.cpp
index 4045d6635e..63eafc9a56 100644
--- a/platform/linux/src/headless_backend_glx.cpp
+++ b/platform/linux/src/headless_backend_glx.cpp
@@ -17,7 +17,7 @@ private:
struct Key { explicit Key() = default; };
public:
- GLXDisplayConfig(Key) {
+ explicit GLXDisplayConfig(Key) {
if (!XInitThreads()) {
throw std::runtime_error("Failed to XInitThreads.");
}
diff --git a/src/mbgl/annotation/annotation_tile.cpp b/src/mbgl/annotation/annotation_tile.cpp
index 69c9f07655..c74fcfd4a9 100644
--- a/src/mbgl/annotation/annotation_tile.cpp
+++ b/src/mbgl/annotation/annotation_tile.cpp
@@ -70,8 +70,7 @@ const GeometryCollection& AnnotationTileFeature::getGeometries() const {
class AnnotationTileLayerData {
public:
- AnnotationTileLayerData(std::string name_) : name(std::move(name_)) {
- }
+ explicit AnnotationTileLayerData(std::string name_) : name(std::move(name_)) {}
const std::string name;
std::vector<std::shared_ptr<const AnnotationTileFeatureData>> features;
diff --git a/src/mbgl/style/expression/compound_expression.cpp b/src/mbgl/style/expression/compound_expression.cpp
index 31628617f6..b95dabfc84 100644
--- a/src/mbgl/style/expression/compound_expression.cpp
+++ b/src/mbgl/style/expression/compound_expression.cpp
@@ -33,7 +33,7 @@ bool operator==(const VarargsType& lhs, const VarargsType& rhs) {
template <typename T>
struct Varargs : std::vector<T> {
template <class... Args>
- Varargs(Args&&... args) : std::vector<T>(std::forward<Args>(args)...) {}
+ explicit Varargs(Args&&... args) : std::vector<T>(std::forward<Args>(args)...) {}
};
namespace detail {
diff --git a/src/mbgl/style/expression/expression.cpp b/src/mbgl/style/expression/expression.cpp
index 4f5e3848d5..270fa5eba0 100644
--- a/src/mbgl/style/expression/expression.cpp
+++ b/src/mbgl/style/expression/expression.cpp
@@ -12,7 +12,7 @@ public:
const Feature& feature;
mutable optional<GeometryCollection> geometry;
- GeoJSONFeature(const Feature& feature_) : feature(feature_) {}
+ explicit GeoJSONFeature(const Feature& feature_) : feature(feature_) {}
GeoJSONFeature(const Feature& feature_, const CanonicalTileID& canonical) : feature(feature_) {
geometry = convertGeometry(feature.geometry, canonical);
// https://github.com/mapbox/geojson-vt-cpp/issues/44