From 925c7a998a578e4a944f9f568c9ad930b9b4d509 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 20 Feb 2020 22:54:30 -0800 Subject: [PATCH] [clang-tidy] mark single argument constructors explicit Found with hicpp-explicit-conversions Signed-off-by: Rosen Penev --- src/builtin_argparse.cpp | 2 +- src/env_universal_common.cpp | 2 +- src/iothread.cpp | 2 +- src/screen.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/builtin_argparse.cpp b/src/builtin_argparse.cpp index 0483e79c3..58e941d63 100644 --- a/src/builtin_argparse.cpp +++ b/src/builtin_argparse.cpp @@ -40,7 +40,7 @@ struct option_spec_t { int num_allowed{0}; int num_seen{0}; - option_spec_t(wchar_t s) : short_flag(s) {} + explicit option_spec_t(wchar_t s) : short_flag(s) {} }; using option_spec_ref_t = std::unique_ptr; diff --git a/src/env_universal_common.cpp b/src/env_universal_common.cpp index 889d7acff..507f2301f 100644 --- a/src/env_universal_common.cpp +++ b/src/env_universal_common.cpp @@ -1299,7 +1299,7 @@ class universal_notifier_named_pipe_t : public universal_notifier_t { } public: - universal_notifier_named_pipe_t(const wchar_t *test_path) + explicit universal_notifier_named_pipe_t(const wchar_t *test_path) : pipe_fd(-1), readback_time_usec(0), readback_amount(0), diff --git a/src/iothread.cpp b/src/iothread.cpp index 8fc54902a..6f2adc51a 100644 --- a/src/iothread.cpp +++ b/src/iothread.cpp @@ -58,7 +58,7 @@ struct main_thread_request_t { relaxed_atomic_bool_t done{false}; void_function_t func; - main_thread_request_t(void_function_t &&f) : func(f) {} + explicit main_thread_request_t(void_function_t &&f) : func(f) {} // No moving OR copying // main_thread_requests are always stack allocated, and we deal in pointers to them diff --git a/src/screen.cpp b/src/screen.cpp index 0a4cac0b4..908591bf4 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -59,7 +59,7 @@ class scoped_buffer_t { screen_t &screen_; public: - scoped_buffer_t(screen_t &s) : screen_(s) { screen_.outp().beginBuffering(); } + explicit scoped_buffer_t(screen_t &s) : screen_(s) { screen_.outp().beginBuffering(); } ~scoped_buffer_t() { screen_.outp().endBuffering(); } };