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

Conversation

mkmkme
Copy link
Contributor

@mkmkme mkmkme commented Feb 22, 2024

This issue is reported by cppcheck:

impl/json/JsonDom.hh:79:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
    Entity(Bool v, size_t line = 0) : type_(EntityType::Bool), value_(v), line_(line) {}
    ^
impl/json/JsonDom.hh:82:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
    Entity(Long v, size_t line = 0) : type_(EntityType::Long), value_(v), line_(line) {}
    ^
impl/json/JsonDom.hh:85:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
    Entity(Double v, size_t line = 0) : type_(EntityType::Double), value_(v), line_(line) {}
    ^
impl/json/JsonDom.hh:88:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
    Entity(const std::shared_ptr<String> &v, size_t line = 0) : type_(EntityType::String), value_(v), line_(line) {}
    ^
impl/json/JsonDom.hh:91:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
    Entity(const std::shared_ptr<Array> &v, size_t line = 0) : type_(EntityType::Arr), value_(v), line_(line) {}
    ^
impl/json/JsonDom.hh:94:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
    Entity(const std::shared_ptr<Object> &v, size_t line = 0) : type_(EntityType::Obj), value_(v), line_(line) {}
    ^
impl/FileStream.cc:52:5: style: Struct 'FileBufferCopyIn' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
    FileBufferCopyIn(const char *filename) : h_(::CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) {
    ^
impl/FileStream.cc:235:5: style: Struct 'FileBufferCopyOut' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
    FileBufferCopyOut(const char *filename) : h_(::CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) {
    ^

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

Documentation

  • Does this pull request introduce a new feature? no

This issue is reported by `cppcheck`:

    impl/json/JsonDom.hh:79:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
        Entity(Bool v, size_t line = 0) : type_(EntityType::Bool), value_(v), line_(line) {}
        ^
    impl/json/JsonDom.hh:82:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
        Entity(Long v, size_t line = 0) : type_(EntityType::Long), value_(v), line_(line) {}
        ^
    impl/json/JsonDom.hh:85:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
        Entity(Double v, size_t line = 0) : type_(EntityType::Double), value_(v), line_(line) {}
        ^
    impl/json/JsonDom.hh:88:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
        Entity(const std::shared_ptr<String> &v, size_t line = 0) : type_(EntityType::String), value_(v), line_(line) {}
        ^
    impl/json/JsonDom.hh:91:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
        Entity(const std::shared_ptr<Array> &v, size_t line = 0) : type_(EntityType::Arr), value_(v), line_(line) {}
        ^
    impl/json/JsonDom.hh:94:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
        Entity(const std::shared_ptr<Object> &v, size_t line = 0) : type_(EntityType::Obj), value_(v), line_(line) {}
        ^
    impl/FileStream.cc:52:5: style: Struct 'FileBufferCopyIn' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
        FileBufferCopyIn(const char *filename) : h_(::CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) {
        ^
    impl/FileStream.cc:235:5: style: Struct 'FileBufferCopyOut' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
        FileBufferCopyOut(const char *filename) : h_(::CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) {
        ^
@github-actions github-actions bot added the C++ Pull Requests for C++ binding label Feb 22, 2024
@martin-g martin-g merged commit f1f3415 into apache:main Feb 23, 2024
4 checks passed
RanbirK pushed a commit to RanbirK/avro that referenced this pull request May 13, 2024
This issue is reported by `cppcheck`:

    impl/json/JsonDom.hh:79:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
        Entity(Bool v, size_t line = 0) : type_(EntityType::Bool), value_(v), line_(line) {}
        ^
    impl/json/JsonDom.hh:82:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
        Entity(Long v, size_t line = 0) : type_(EntityType::Long), value_(v), line_(line) {}
        ^
    impl/json/JsonDom.hh:85:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
        Entity(Double v, size_t line = 0) : type_(EntityType::Double), value_(v), line_(line) {}
        ^
    impl/json/JsonDom.hh:88:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
        Entity(const std::shared_ptr<String> &v, size_t line = 0) : type_(EntityType::String), value_(v), line_(line) {}
        ^
    impl/json/JsonDom.hh:91:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
        Entity(const std::shared_ptr<Array> &v, size_t line = 0) : type_(EntityType::Arr), value_(v), line_(line) {}
        ^
    impl/json/JsonDom.hh:94:5: style: Class 'Entity' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
        Entity(const std::shared_ptr<Object> &v, size_t line = 0) : type_(EntityType::Obj), value_(v), line_(line) {}
        ^
    impl/FileStream.cc:52:5: style: Struct 'FileBufferCopyIn' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
        FileBufferCopyIn(const char *filename) : h_(::CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) {
        ^
    impl/FileStream.cc:235:5: style: Struct 'FileBufferCopyOut' has a constructor with 1 argument that is not explicit. [noExplicitConstructor]
        FileBufferCopyOut(const char *filename) : h_(::CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL)) {
        ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ Pull Requests for C++ binding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants