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] Add missing override #2759

Merged
merged 1 commit into from
Feb 22, 2024
Merged

Conversation

mkmkme
Copy link
Contributor

@mkmkme mkmkme commented Feb 21, 2024

This issue has been reported by cppcheck:

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)) {
    ^
impl/FileStream.cc:62:10: style: The function 'seek' overrides a function in a base class but is not marked with a 'override' specifier. [missingOverride]
    void seek(size_t len) {
         ^
impl/FileStream.cc:45:18: note: Virtual function in base class
    virtual void seek(size_t len) = 0;
                 ^
impl/FileStream.cc:62:10: note: Function in derived class
    void seek(size_t len) {
         ^
impl/FileStream.cc:68:10: style: The function 'read' overrides a function in a base class but is not marked with a 'override' specifier. [missingOverride]
    bool read(uint8_t *b, size_t toRead, size_t &actual) {
         ^
impl/FileStream.cc:46:18: note: Virtual function in base class
    virtual bool read(uint8_t *b, size_t toRead, size_t &actual) = 0;
                 ^
impl/FileStream.cc:68:10: note: Function in derived class
    bool read(uint8_t *b, size_t toRead, size_t &actual) {
         ^
impl/FileStream.cc:245:10: style: The function 'write' overrides a function in a base class but is not marked with a 'override' specifier. [missingOverride]
    void write(const uint8_t *b, size_t len) {
         ^
impl/FileStream.cc:229:18: note: Virtual function in base class
    virtual void write(const uint8_t *b, size_t len) = 0;
                 ^
impl/FileStream.cc:245:10: note: Function in derived class
    void write(const uint8_t *b, size_t len) {

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 has been reported by `cppcheck`:

    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)) {
        ^
    impl/FileStream.cc:62:10: style: The function 'seek' overrides a function in a base class but is not marked with a 'override' specifier. [missingOverride]
        void seek(size_t len) {
             ^
    impl/FileStream.cc:45:18: note: Virtual function in base class
        virtual void seek(size_t len) = 0;
                     ^
    impl/FileStream.cc:62:10: note: Function in derived class
        void seek(size_t len) {
             ^
    impl/FileStream.cc:68:10: style: The function 'read' overrides a function in a base class but is not marked with a 'override' specifier. [missingOverride]
        bool read(uint8_t *b, size_t toRead, size_t &actual) {
             ^
    impl/FileStream.cc:46:18: note: Virtual function in base class
        virtual bool read(uint8_t *b, size_t toRead, size_t &actual) = 0;
                     ^
    impl/FileStream.cc:68:10: note: Function in derived class
        bool read(uint8_t *b, size_t toRead, size_t &actual) {
             ^
    impl/FileStream.cc:245:10: style: The function 'write' overrides a function in a base class but is not marked with a 'override' specifier. [missingOverride]
        void write(const uint8_t *b, size_t len) {
             ^
    impl/FileStream.cc:229:18: note: Virtual function in base class
        virtual void write(const uint8_t *b, size_t len) = 0;
                     ^
    impl/FileStream.cc:245:10: note: Function in derived class
        void write(const uint8_t *b, size_t len) {
@github-actions github-actions bot added the C++ Pull Requests for C++ binding label Feb 21, 2024
@mkmkme
Copy link
Contributor Author

mkmkme commented Feb 21, 2024

Does the Avro workflow require one PR per one task? Or can a JIRA issue have multiple PRs? I'd rather create a PR for each stage described in the ticket.

@martin-g
Copy link
Member

Does the Avro workflow require one PR per one task? Or can a JIRA issue have multiple PRs? I'd rather create a PR for each stage described in the ticket.

Several PRs for each task is fine!

@martin-g martin-g merged commit 568b19c into apache:main Feb 22, 2024
4 checks passed
@martin-g
Copy link
Member

Thank you, @mkmkme !

I will not backport it to branch-1.11 - there are talks at dev@ about releasing 1.12.

RanbirK pushed a commit to RanbirK/avro that referenced this pull request May 13, 2024
This issue has been reported by `cppcheck`:

    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)) {
        ^
    impl/FileStream.cc:62:10: style: The function 'seek' overrides a function in a base class but is not marked with a 'override' specifier. [missingOverride]
        void seek(size_t len) {
             ^
    impl/FileStream.cc:45:18: note: Virtual function in base class
        virtual void seek(size_t len) = 0;
                     ^
    impl/FileStream.cc:62:10: note: Function in derived class
        void seek(size_t len) {
             ^
    impl/FileStream.cc:68:10: style: The function 'read' overrides a function in a base class but is not marked with a 'override' specifier. [missingOverride]
        bool read(uint8_t *b, size_t toRead, size_t &actual) {
             ^
    impl/FileStream.cc:46:18: note: Virtual function in base class
        virtual bool read(uint8_t *b, size_t toRead, size_t &actual) = 0;
                     ^
    impl/FileStream.cc:68:10: note: Function in derived class
        bool read(uint8_t *b, size_t toRead, size_t &actual) {
             ^
    impl/FileStream.cc:245:10: style: The function 'write' overrides a function in a base class but is not marked with a 'override' specifier. [missingOverride]
        void write(const uint8_t *b, size_t len) {
             ^
    impl/FileStream.cc:229:18: note: Virtual function in base class
        virtual void write(const uint8_t *b, size_t len) = 0;
                     ^
    impl/FileStream.cc:245:10: note: Function in derived class
        void write(const uint8_t *b, size_t len) {
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