[core] Fix google-explicit-constructor errors

As reported by clang-tidy-8.
This commit is contained in:
Thiago Marcos P. Santos
2020-03-27 17:43:37 +02:00
parent 65f4df5190
commit 62b543e44a
10 changed files with 12 additions and 20 deletions

View File

@@ -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)) {

View File

@@ -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));

View File

@@ -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.");

View File

@@ -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_);