-
Notifications
You must be signed in to change notification settings - Fork 0
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
Remove clang-tidy checks in source code #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fksfhskfh |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,17 +142,12 @@ void Payload_event_buffer_istream::update_buffer() { | |
#ifndef NDEBUG | ||
// "nolint": clang-tidy reports an unnecessary warning since 'if' | ||
// and 'else' branches may compile to the same. Suppressing that. | ||
// NOLINTBEGIN(bugprone-branch-clone) | ||
if (m_managed_buffer_ptr.use_count() == 0) | ||
BAPI_LOG("info", "Allocating managed buffer for the first time."); | ||
else | ||
BAPI_LOG("info", | ||
"Allocating new managed buffer. " | ||
"The previous one cannot be reused since there are " | ||
<< m_managed_buffer_ptr.use_count() | ||
<< ">1 shared pointer references to " | ||
"it."); | ||
// NOLINTEND(bugprone-branch-clone) | ||
if (m_managed_buffer_ptr.use_count() == 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
BAPI_LOG("info", "Allocating managed buffer for the first time. "); | ||
} | ||
else { | ||
BAPI_LOG("info", "Allocating new managed buffer. The previous one cannot be reused since there are " << m_managed_buffer_ptr.use_count() << ">1 shared pointer references to it."); | ||
} | ||
#endif | ||
try { | ||
auto allocator = Allocator_t<Managed_buffer_t>(m_memory_resource); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,8 +95,6 @@ class Thread_stage_guard { | |
const unsigned int m_line; | ||
}; | ||
|
||
// NOLINTBEGIN(cppcoreguidelines-macro-usage) | ||
|
||
/// Set the thread stage for the given thread, and make it restore the | ||
/// previous stage at the end of the invoking scope, using the named | ||
/// local RAII variable. | ||
|
@@ -110,9 +108,9 @@ class Thread_stage_guard { | |
/// @param new_stage The new stage. `thd` will use this stage until | ||
/// the end of the scope where the macro is invoked. At that point, | ||
/// the stage is reverted to what it was before invoking this macro. | ||
#define NAMED_THD_STAGE_GUARD(name, thd, new_stage) \ | ||
raii::Thread_stage_guard name { \ | ||
(thd), (new_stage), __func__, __FILE__, __LINE__ \ | ||
#define NAMED_THD_STAGE_GUARD(name, thd, new_stage) \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
raii::Thread_stage_guard name { \ | ||
(thd),(new_stage), __func__, __FILE__, __LINE__ \ | ||
} | ||
|
||
/// Set the thread stage for the given thread, and make it restore the | ||
|
@@ -123,10 +121,8 @@ class Thread_stage_guard { | |
/// @param new_stage The new stage. `thd` will use this stage until | ||
/// the end of the scope where the macro is invoked. At that point, | ||
/// the stage is reverted to what it was before invoking this macro. | ||
#define THD_STAGE_GUARD(thd, new_stage) \ | ||
NAMED_THD_STAGE_GUARD(_thread_stage_guard_##new_stage, (thd), (new_stage)) | ||
|
||
// NOLINTEND(cppcoreguidelines-macro-usage) | ||
#define THD_STAGE_GUARD(thd,new_stage) \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
NAMED_THD_STAGE_GUARD(_thread_stage_guard_##new_stage, (thd),(new_stage)) | ||
|
||
} // namespace raii | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,21 +80,19 @@ using Difference_t = mysqlns::buffer::Rw_buffer_sequence<>::Difference_t; | |
// make the program stop with assertion. | ||
[[maybe_unused]] static int n_assertions = 0; | ||
static bool _shall_stop_after_assertion = false; | ||
// NOLINTBEGIN(cppcoreguidelines-macro-usage) | ||
#define ASSERTION_TAIL \ | ||
<< debug_output(fileline) << (_shall_stop_after_assertion = true, ""), \ | ||
assert(!_shall_stop_after_assertion) | ||
#define AEQ(v1, v2) \ | ||
do { \ | ||
ASSERT_EQ(v1, v2) ASSERTION_TAIL; \ | ||
++n_assertions; \ | ||
} while (0) | ||
#define ANE(v1, v2) \ | ||
do { \ | ||
ASSERT_NE(v1, v2) ASSERTION_TAIL; \ | ||
++n_assertions; \ | ||
} while (0) | ||
// NOLINTEND(cppcoreguidelines-macro-usage) | ||
#define ASSERTION_TAIL \ | ||
<< debug_output(fileline) << (_shall_stop_after_assertion = true,""), \ | ||
assert(!_shall_stop_after_assertion ) | ||
#define AEQ(v1,v2) \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
do{ \ | ||
ASSERT_EQ(v1,v2) ASSERTION_TAIL; \ | ||
++n_assertions; \ | ||
} while(0) | ||
#define ANE(v1,v2) \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
do{ \ | ||
ASSERT_NE(v1,v2) ASSERTION_TAIL; \ | ||
++n_assertions; \ | ||
} while(0) | ||
|
||
// Requirements: | ||
// | ||
|
@@ -251,10 +249,8 @@ class Grow_tester { | |
Size_t extra_container_capacity, Size_t position, | ||
Size_t capacity, Size_t max_capacity, | ||
Size_t requested_capacity, Size_t requested_position) { | ||
// NOLINTBEGIN(cppcoreguidelines-macro-usage) | ||
#define CHECK_SIZES(POSITION, CAPACITY) \ | ||
check_sizes(FILELINE(), debug_output, mbs, buffer_size, POSITION, CAPACITY) | ||
// NOLINTEND(cppcoreguidelines-macro-usage) | ||
#define CHECK_SIZES(POSITION,CAPACITY) \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
check_sizes(FILELINE(), debug_output, mbs, buffer_size, POSITION,CAPACITY) | ||
|
||
// This does the following: | ||
// | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -363,8 +363,7 @@ class PayloadEventBufferStreamTest { | |
// "nolint": as a general rule, malloc should not be used, so | ||
// clang-tidy warns about it. But this is an allocator so it is | ||
// appropriate to use malloc and therefore we suppress the check. | ||
// NOLINTNEXTLINE(cppcoreguidelines-no-malloc) | ||
return std::malloc(n); | ||
return std::malloc(n); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
}; | ||
Memory_resource_t failing_memory_resource(failing_allocator, std::free); | ||
auto debug_func = [&] { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constructor does not initialize these fields: m_default_buffer_size