lordgamez commented on code in PR #1671:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1671#discussion_r1371278925


##########
extensions/sftp/tests/PutSFTPTests.cpp:
##########
@@ -201,7 +201,7 @@ class PutSFTPTestsFixture {
 
 namespace {
 std::size_t directoryContentCount(const std::filesystem::path& dir) {
-  return (std::size_t)std::distance(std::filesystem::directory_iterator{dir}, 
std::filesystem::directory_iterator{});
+  return 
static_cast<std::size_t>(std::distance(std::filesystem::directory_iterator{dir},
 std::filesystem::directory_iterator{}));

Review Comment:
   Updated in fdbd40841b88732109b084214e3cb027492d4bac



##########
libminifi/src/core/ProcessSession.cpp:
##########
@@ -175,7 +175,7 @@ std::shared_ptr<core::FlowFile> 
ProcessSession::cloneDuringTransfer(const std::s
 }
 
 std::shared_ptr<core::FlowFile> ProcessSession::clone(const 
std::shared_ptr<core::FlowFile> &parent, int64_t offset, int64_t size) {
-  if ((uint64_t) (offset + size) > parent->getSize()) {
+  if (static_cast<uint64_t>(offset + size) > parent->getSize()) {

Review Comment:
   Updated in fdbd40841b88732109b084214e3cb027492d4bac



##########
libminifi/src/core/flow/StructuredConfiguration.cpp:
##########
@@ -266,10 +266,10 @@ void StructuredConfiguration::parseProcessorNode(const 
Node& processors_node, co
       logger_->log_debug("setting scheduling strategy as {}", 
procCfg.schedulingStrategy);
     }
 
-    int32_t maxConcurrentTasks;
+    int32_t maxConcurrentTasks = 0;
     if (core::Property::StringToInt(procCfg.maxConcurrentTasks, 
maxConcurrentTasks)) {
       logger_->log_debug("parseProcessorNode: maxConcurrentTasks => [{}]", 
maxConcurrentTasks);
-      processor->setMaxConcurrentTasks((uint8_t) maxConcurrentTasks);
+      
processor->setMaxConcurrentTasks(static_cast<uint8_t>(maxConcurrentTasks));
     }

Review Comment:
   Yes, good idea, updated in fdbd40841b88732109b084214e3cb027492d4bac



##########
libminifi/src/provenance/Provenance.cpp:
##########
@@ -249,17 +249,17 @@ bool ProvenanceEventRecord::deserialize(io::InputStream 
&input_stream) {
     }
   }
 
-  uint32_t eventType;
+  uint32_t eventType = 0;
   {
     const auto ret = input_stream.read(eventType);
     if (ret != 4) {
       return false;
     }
   }
 
-  this->_eventType = (ProvenanceEventRecord::ProvenanceEventType) eventType;
+  _eventType = 
static_cast<ProvenanceEventRecord::ProvenanceEventType>(eventType);

Review Comment:
   Good point, updated in fdbd40841b88732109b084214e3cb027492d4bac



-- 
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]

Reply via email to