Skip to content

Fix codechecker warnings #8650

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
8 changes: 8 additions & 0 deletions src/common/IntlParametersBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class IntlParametersBlock
virtual TagType checkTag(UCHAR tag, const char** tagName) = 0;
virtual UCHAR getUtf8Tag() = 0;

virtual ~IntlParametersBlock() = default;

void toUtf8(ClumpletWriter& pb);
void fromUtf8(ClumpletWriter& pb);

Expand All @@ -56,13 +58,17 @@ class IntlDpb : public IntlParametersBlock
public:
TagType checkTag(UCHAR tag, const char** tagName);
UCHAR getUtf8Tag();

~IntlDpb() override = default;
};

class IntlSpb : public IntlParametersBlock
{
public:
TagType checkTag(UCHAR tag, const char** tagName);
UCHAR getUtf8Tag();

~IntlSpb() override = default;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The destructors with override = default should not be needed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it really is. I checked and realized that they are optional. The main thing is to have a virtual destructor in the base class. I will fix this code soon. Thanks for the review.

};

class IntlSpbStart : public IntlParametersBlock
Expand All @@ -75,6 +81,8 @@ class IntlSpbStart : public IntlParametersBlock
TagType checkTag(UCHAR tag, const char** tagName);
UCHAR getUtf8Tag();

~IntlSpbStart() override = default;

private:
UCHAR mode;
};
Expand Down
2 changes: 1 addition & 1 deletion src/common/ThreadStart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Thread Thread::start(ThreadEntryPoint* routine, void* arg, int priority_arg, Han
{
#ifdef HAVE_PTHREAD_CANCEL
int dummy; // We do not want to know old cancel type
state = pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &dummy);
state = pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &dummy);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this @AlexPeshkoff ?

if (state)
Firebird::system_call_failed::raise("pthread_setcanceltype", state);
#endif
Expand Down
1 change: 1 addition & 0 deletions src/common/classes/BatchCompletionState.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ namespace Firebird {
{
public:
virtual void transliterate(IStatus* status) = 0;
virtual ~Transliterate() = default;
};

class BatchCompletionState final :
Expand Down
1 change: 1 addition & 0 deletions src/common/classes/Hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ namespace Firebird

void link(Entry** where)
{
fb_assert(where != nullptr);
unLink();

// set our pointers
Expand Down
2 changes: 1 addition & 1 deletion src/yvalve/gds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2657,7 +2657,7 @@ void API_ROUTINE gds__unregister_cleanup(FPTR_VOID_PTR routine, void *arg)
Firebird::MutexLockGuard guard(cleanup_handlers_mutex, "gds__unregister_cleanup");

clean_t* clean;
for (clean_t** clean_ptr = &cleanup_handlers; clean = *clean_ptr; clean_ptr = &clean->clean_next)
for (clean_t** clean_ptr = &cleanup_handlers; (clean = *clean_ptr); clean_ptr = &clean->clean_next)
{
if (clean->clean_routine == routine && clean->clean_arg == arg)
{
Expand Down
Loading