hunyadi-dev commented on a change in pull request #1020:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1020#discussion_r585471199
##########
File path: extensions/pcap/CapturePacket.h
##########
@@ -167,7 +167,7 @@ class CapturePacket : public core::Processor {
REGISTER_RESOURCE(CapturePacket, "CapturePacket captures and writes one or
more packets into a PCAP file that will be used as the content of a flow file."
" Configuration options exist to adjust the batching of PCAP files. PCAP
batching will place a single PCAP into a flow file. "
- "A regular expression selects network interfaces. Bluetooth network
interfaces can be selected through a separate option.")
+ "A regular expression selects network interfaces. Bluetooth network
interfaces can be selected through a separate option.");
Review comment:
How did this work beforehand? Do we even compile this?
##########
File path: extensions/script/python/ExecutePythonProcessor.h
##########
@@ -34,6 +34,8 @@
#include "PythonScriptEngine.h"
#include "core/Property.h"
+#pragma GCC visibility push(hidden)
Review comment:
Does this solve the `declared with greater visibility than the type of
its field` error? If so, how does this work?
I found these refs: [[1]](https://github.com/vgc/vgc/issues/11),
[[2]](https://stackoverflow.com/questions/49252686/exported-class-with-non-exported-data-member?newreg=b2adafbe461c42faa7888ff23b6b05c3)
on the issue; how does this relate?
##########
File path: extensions/sensors/GetEnvironmentalSensors.h
##########
@@ -75,7 +75,7 @@ class GetEnvironmentalSensors : public SensorBase {
static std::shared_ptr<utils::IdGenerator> id_generator_;
};
-REGISTER_RESOURCE(GetEnvironmentalSensors, "Provides sensor information from
known sensors to include humidity and pressure data")
+REGISTER_RESOURCE(GetEnvironmentalSensors, "Provides sensor information from
known sensors to include humidity and pressure data");
Review comment:
Again, why did this work, if the semicolon is required?
##########
File path: extensions/sensors/GetEnvironmentalSensors.h
##########
@@ -75,7 +75,7 @@ class GetEnvironmentalSensors : public SensorBase {
static std::shared_ptr<utils::IdGenerator> id_generator_;
};
-REGISTER_RESOURCE(GetEnvironmentalSensors, "Provides sensor information from
known sensors to include humidity and pressure data")
+REGISTER_RESOURCE(GetEnvironmentalSensors, "Provides sensor information from
known sensors to include humidity and pressure data");
Review comment:
Again, why did these work, if the semicolon is required?
##########
File path: extensions/sensors/GetEnvironmentalSensors.h
##########
@@ -75,7 +75,7 @@ class GetEnvironmentalSensors : public SensorBase {
static std::shared_ptr<utils::IdGenerator> id_generator_;
};
-REGISTER_RESOURCE(GetEnvironmentalSensors, "Provides sensor information from
known sensors to include humidity and pressure data")
+REGISTER_RESOURCE(GetEnvironmentalSensors, "Provides sensor information from
known sensors to include humidity and pressure data");
Review comment:
Again, why did these and smart enums work beforehand, if the semicolon
is required?
##########
File path: extensions/standard-processors/processors/GenerateFlowFile.cpp
##########
@@ -87,7 +87,7 @@ void generateData(std::vector<char>& data, bool textData =
false) {
std::uniform_int_distribution<> distr(0, index_of_last_char);
auto rand = std::bind(distr, eng);
std::generate_n(data.begin(), data.size(), rand);
- std::for_each(data.begin(), data.end(), [](char & c) { c =
TEXT_CHARS[c];});
+ std::for_each(data.begin(), data.end(), [](char & c) { c =
TEXT_CHARS[static_cast<uint8_t>(c)];});
Review comment:
Minor, but this could be moved to `rand`.
##########
File path:
extensions/standard-processors/tests/integration/TLSServerSocketSupportedProtocolsTest.cpp
##########
@@ -151,10 +151,12 @@ class SimpleSSLTestClient {
gsl::not_null<std::shared_ptr<logging::Logger>>
logger_{gsl::make_not_null(logging::LoggerFactory<SimpleSSLTestClient>::getLogger())};
static SocketDescriptor openConnection(const char *host_name, const char
*port, logging::Logger& logger) {
- struct addrinfo hints = {0}, *addrs;
+ struct addrinfo hints;
+ hints.ai_flags = 0;
Review comment:
Is this the same behaviour? What was the issue with the `{0}`
initialization?
https://man7.org/linux/man-pages/man3/getaddrinfo.3.html
##########
File path: libminifi/src/utils/StringUtils.cpp
##########
@@ -305,8 +305,10 @@ bool StringUtils::from_base64(uint8_t* data, size_t*
data_length, const char* ba
case 1:
return false;
case 2:
- digits[2] = 0x00;
case 3: {
+ if (digit_counter == 2) {
Review comment:
You probably did not mean to do this.
##########
File path: libminifi/src/utils/StringUtils.cpp
##########
@@ -305,8 +305,10 @@ bool StringUtils::from_base64(uint8_t* data, size_t*
data_length, const char* ba
case 1:
return false;
case 2:
- digits[2] = 0x00;
case 3: {
+ if (digit_counter == 2) {
Review comment:
You probably did not mean to do this. If you want to fix fallthrough
errors here, until C++ 17 just pop the diagnostics on implicit fallthrough.
##########
File path: libminifi/src/utils/StringUtils.cpp
##########
@@ -305,8 +305,10 @@ bool StringUtils::from_base64(uint8_t* data, size_t*
data_length, const char* ba
case 1:
return false;
case 2:
- digits[2] = 0x00;
case 3: {
+ if (digit_counter == 2) {
Review comment:
You probably did not mean to do this. If you want to fix fallthrough
errors here, until C++ 17 just push and pop the diagnostics on implicit
fallthrough.
##########
File path: nanofi/examples/monitor_directory.c
##########
@@ -75,11 +77,11 @@ int main(int argc, char **argv) {
port.port_id = portStr;
- C2_Server server;
- server.url = argv[4];
- server.ack_url = argv[5];
- server.identifier = "monitor_directory";
- server.type = REST;
+ // C2_Server server;
Review comment:
This is probably leftover commented-out code.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]