szaszm commented on code in PR #1671:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1671#discussion_r1340352435
##########
extensions/expression-language/tests/ExpressionLanguageTests.cpp:
##########
@@ -1321,13 +1321,13 @@ TEST_CASE("Now Date", "[expressionNowDate]") {
TEST_CASE("Parse RFC3339 with Expression Language toDate") {
using date::sys_days;
using org::apache::nifi::minifi::utils::timeutils::parseRfc3339;
- using namespace date::literals;
+ using namespace date::literals; // NOLINT(google-build-using-namespace)
using namespace std::literals::chrono_literals;
using std::chrono::milliseconds;
- milliseconds expected_second =
std::chrono::floor<milliseconds>((sys_days(2023_y / 03 / 01) + 19h + 04min +
55s).time_since_epoch());
- milliseconds expected_tenth_second =
std::chrono::floor<milliseconds>((sys_days(2023_y / 03 / 01) + 19h + 04min +
55s + 100ms).time_since_epoch());
- milliseconds expected_milli_second =
std::chrono::floor<milliseconds>((sys_days(2023_y / 03 / 01) + 19h + 04min +
55s + 190ms).time_since_epoch());
+ milliseconds expected_second =
std::chrono::floor<milliseconds>((sys_days{2023_y / 03 / 01} + 19h + 04min +
55s).time_since_epoch()); // NOLINT(whitespace/braces)
+ milliseconds expected_tenth_second =
std::chrono::floor<milliseconds>((sys_days{2023_y / 03 / 01} + 19h + 04min +
55s + 100ms).time_since_epoch()); // NOLINT(whitespace/braces)
+ milliseconds expected_milli_second =
std::chrono::floor<milliseconds>((sys_days{2023_y / 03 / 01} + 19h + 04min +
55s + 190ms).time_since_epoch()); // NOLINT(whitespace/braces)
Review Comment:
What was the error here?
##########
extensions/sftp/client/SFTPClient.cpp:
##########
@@ -83,7 +83,7 @@ static const char* sftp_strerror(unsigned long err) { //
NOLINT(runtime/int) un
}
}
-static SFTPError libssh2_sftp_error_to_sftp_error(unsigned long
libssh2_sftp_error) { // NOLINT(runtime/int) unsigned long comes from libssh2
API
+static SFTPError libssh2_sftp_error_to_sftp_error(unsigned long
libssh2_sftp_error) { // NOLINT(runtime/int,google-runtime-int) unsigned long
comes from libssh2 API
Review Comment:
We can disable one of these, so we only need one NOLINT for the same rule
##########
extensions/systemd/tests/ConsumeJournaldTest.cpp:
##########
@@ -90,7 +90,7 @@ struct TestJournal final : libwrapper::Journal {
}
int getCursor(gsl::owner<char*>* const cursor_out) noexcept override {
- *cursor_out = gsl::owner<char*>(strdup(std::to_string(consumed).c_str()));
+ *cursor_out = strdup(std::to_string(consumed).c_str()); //
NOLINT(cppcoreguidelines-owning-memory)
Review Comment:
Why remove the `gsl::owner` annotation?
##########
extensions/systemd/libwrapper/DlopenWrapper.cpp:
##########
@@ -72,7 +72,7 @@ class DlopenJournal : public Journal {
template<typename F>
F loadSymbol(const char* const symbol_name) {
// The cast below is supported by POSIX platforms.
https://stackoverflow.com/a/1096349
- F const symbol = (F)dlsym(libhandle_.get(), symbol_name);
+ F const symbol = reinterpret_cast<F>(dlsym(libhandle_.get(), symbol_name));
Review Comment:
A cast from object to function pointers is normally undefined behavior, but
in the case of dlsym, this is allowed on POSIX. I'm not sure that a
`reinterpret_cast` is guaranteed to do the right thing in this case. I'd rather
keep the C-style cast here, because that's guaranteed to work, while with
`reinterpret_cast`, an implementation may decide later that it's undefined
behavior to do this cast even with `dlsym`.
##########
extensions/standard-processors/processors/PutTCP.cpp:
##########
@@ -215,7 +215,7 @@ asio::awaitable<std::error_code>
ConnectionHandler<SocketType>::establishNewConn
continue;
}
if (max_size_of_socket_send_buffer_)
-
socket.lowest_layer().set_option(TcpSocket::send_buffer_size(*max_size_of_socket_send_buffer_));
+
socket.lowest_layer().set_option(TcpSocket::send_buffer_size(*max_size_of_socket_send_buffer_));
// NOLINT(google-readability-casting)
Review Comment:
What was the problem here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]