Fix ctors that were missing explicit keyword

This commit is contained in:
Marcus Holland-Moritz 2021-10-27 00:06:11 +02:00
parent 7750bc582e
commit 7c0b22d3bd
7 changed files with 10 additions and 10 deletions

View File

@ -72,7 +72,7 @@ struct options {
};
struct dwarfs_userdata {
dwarfs_userdata(std::ostream& os)
explicit dwarfs_userdata(std::ostream& os)
: lgr{os} {}
options opts;

View File

@ -404,7 +404,7 @@ class zstd_block_compressor final : public block_compressor::impl {
class scoped_context {
public:
scoped_context(context_manager& mgr)
explicit scoped_context(context_manager& mgr)
: mgr_{&mgr}
, ctx_{mgr_->acquire()} {}
~scoped_context() { mgr_->release(ctx_); }

View File

@ -168,7 +168,7 @@ class bloom_filter {
static constexpr size_t index_shift = bitcount(value_mask);
static constexpr size_t alignment = 64;
bloom_filter(size_t size)
explicit bloom_filter(size_t size)
: index_mask_{(std::max(size, value_mask + 1) >> index_shift) - 1}
, size_{std::max(size, value_mask + 1)} {
if (size & (size - 1)) {

View File

@ -65,7 +65,7 @@ bool has_callable(py::object obj, char const* method) {
class py_logger {
public:
py_logger(logger& lgr)
explicit py_logger(logger& lgr)
: log_(lgr) {}
void error(std::string const& msg) { LOG_ERROR << "[script] " << msg; }
@ -82,7 +82,7 @@ class py_logger {
template <typename T>
class basic_entry_wrapper {
public:
basic_entry_wrapper(T& entry)
explicit basic_entry_wrapper(T& entry)
: entry_(&entry) {}
size_t size() const { return entry_->size(); }
@ -112,7 +112,7 @@ using mutable_entry_wrapper = basic_entry_wrapper<entry_interface>;
class inode_wrapper {
public:
inode_wrapper(inode const* ino)
explicit inode_wrapper(inode const* ino)
: ino_(ino) {}
size_t similarity_hash() const { return ino_->similarity_hash(); }
@ -158,7 +158,7 @@ class python_script::impl {
class timer {
public:
timer(clock::duration& d)
explicit timer(clock::duration& d)
: start_(clock::now())
, d_(d) {}

View File

@ -34,7 +34,7 @@ namespace dwarfs {
class legacy_string_table : public string_table::impl {
public:
legacy_string_table(string_table::LegacyTableView v)
explicit legacy_string_table(string_table::LegacyTableView v)
: v_{v} {}
std::string lookup(size_t index) const override {

View File

@ -97,7 +97,7 @@ class process_guard {
public:
process_guard() = default;
process_guard(pid_t pid)
explicit process_guard(pid_t pid)
: pid_{pid} {
auto proc_dir =
std::filesystem::path("/proc") / folly::to<std::string>(pid);

View File

@ -128,7 +128,7 @@ void os_access_mock::mock_directory::add(
class dir_reader_mock : public dir_reader {
public:
dir_reader_mock(std::vector<std::string>&& files)
explicit dir_reader_mock(std::vector<std::string>&& files)
: files_(files)
, index_(0) {}