Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AVRO-3945] Added missing explicit #2761

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lang/c++/impl/FileStream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct BufferCopyIn {
struct FileBufferCopyIn : public BufferCopyIn {
#ifdef _WIN32
HANDLE h_;
FileBufferCopyIn(const char *filename) : h_(::CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) {
explicit FileBufferCopyIn(const char *filename) : h_(::CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) {
if (h_ == INVALID_HANDLE_VALUE) {
throw Exception(boost::format("Cannot open file: %1%") % ::GetLastError());
}
Expand Down Expand Up @@ -232,7 +232,7 @@ struct BufferCopyOut {
struct FileBufferCopyOut : public BufferCopyOut {
#ifdef _WIN32
HANDLE h_;
FileBufferCopyOut(const char *filename) : h_(::CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) {
explicit FileBufferCopyOut(const char *filename) : h_(::CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) {
if (h_ == INVALID_HANDLE_VALUE) {
throw Exception(boost::format("Cannot open file: %1%") % ::GetLastError());
}
Expand Down
12 changes: 6 additions & 6 deletions lang/c++/impl/json/JsonDom.hh
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,22 @@ public:
explicit Entity(size_t line = 0) : type_(EntityType::Null), line_(line) {}
// Not explicit because do want implicit conversion
// NOLINTNEXTLINE(google-explicit-constructor)
Entity(Bool v, size_t line = 0) : type_(EntityType::Bool), value_(v), line_(line) {}
explicit Entity(Bool v, size_t line = 0) : type_(EntityType::Bool), value_(v), line_(line) {}
// Not explicit because do want implicit conversion
// NOLINTNEXTLINE(google-explicit-constructor)
Entity(Long v, size_t line = 0) : type_(EntityType::Long), value_(v), line_(line) {}
explicit Entity(Long v, size_t line = 0) : type_(EntityType::Long), value_(v), line_(line) {}
// Not explicit because do want implicit conversion
// NOLINTNEXTLINE(google-explicit-constructor)
Entity(Double v, size_t line = 0) : type_(EntityType::Double), value_(v), line_(line) {}
explicit Entity(Double v, size_t line = 0) : type_(EntityType::Double), value_(v), line_(line) {}
// Not explicit because do want implicit conversion
// NOLINTNEXTLINE(google-explicit-constructor)
Entity(const std::shared_ptr<String> &v, size_t line = 0) : type_(EntityType::String), value_(v), line_(line) {}
explicit Entity(const std::shared_ptr<String> &v, size_t line = 0) : type_(EntityType::String), value_(v), line_(line) {}
// Not explicit because do want implicit conversion
// NOLINTNEXTLINE(google-explicit-constructor)
Entity(const std::shared_ptr<Array> &v, size_t line = 0) : type_(EntityType::Arr), value_(v), line_(line) {}
explicit Entity(const std::shared_ptr<Array> &v, size_t line = 0) : type_(EntityType::Arr), value_(v), line_(line) {}
// Not explicit because do want implicit conversion
// NOLINTNEXTLINE(google-explicit-constructor)
Entity(const std::shared_ptr<Object> &v, size_t line = 0) : type_(EntityType::Obj), value_(v), line_(line) {}
explicit Entity(const std::shared_ptr<Object> &v, size_t line = 0) : type_(EntityType::Obj), value_(v), line_(line) {}

EntityType type() const { return type_; }

Expand Down
Loading