nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ald...@apache.org
Subject [1/3] nifi-minifi-cpp git commit: MINIFICPP-12: Resolve warnings found during compilation
Date Thu, 07 Dec 2017 20:06:32 GMT
Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 9032c0f71 -> 002b07434


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/002b0743/libminifi/test/unit/ThreadPoolTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/ThreadPoolTests.cpp b/libminifi/test/unit/ThreadPoolTests.cpp
index 0436f05..6849aa6 100644
--- a/libminifi/test/unit/ThreadPoolTests.cpp
+++ b/libminifi/test/unit/ThreadPoolTests.cpp
@@ -29,8 +29,8 @@ bool function() {
 class WorkerNumberExecutions : public utils::AfterExecute<int> {
  public:
   explicit WorkerNumberExecutions(int tasks)
-      : tasks(tasks),
-        runs(0) {
+      : runs(0),
+        tasks(tasks) {
   }
 
   explicit WorkerNumberExecutions(WorkerNumberExecutions && other)

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/002b0743/libminifi/test/unit/YamlConfigurationTests.cpp
----------------------------------------------------------------------
diff --git a/libminifi/test/unit/YamlConfigurationTests.cpp b/libminifi/test/unit/YamlConfigurationTests.cpp
index 2c78c7b..0020bba 100644
--- a/libminifi/test/unit/YamlConfigurationTests.cpp
+++ b/libminifi/test/unit/YamlConfigurationTests.cpp
@@ -137,7 +137,7 @@ TEST_CASE("Test YAML Config Processing", "[YamlConfiguration]") {
   "    batch size: 1000";
 
   std::istringstream configYamlStream(CONFIG_YAML_WITHOUT_IDS);
-  std::unique_ptr<core::ProcessGroup> rootFlowConfig = yamlConfig->getRoot(configYamlStream);
+  std::unique_ptr<core::ProcessGroup> rootFlowConfig = yamlConfig->getYamlRoot(configYamlStream);
 
   REQUIRE(rootFlowConfig);
   REQUIRE(rootFlowConfig->findProcessor("TailFile"));
@@ -184,6 +184,6 @@ TEST_CASE("Test YAML Config Processing", "[YamlConfiguration]") {
   "\n";
 
   std::istringstream configYamlStream(CONFIG_YAML_NO_RPG_PORT_ID);
-  REQUIRE_THROWS_AS(yamlConfig->getRoot(configYamlStream), std::invalid_argument);
+  REQUIRE_THROWS_AS(yamlConfig->getYamlRoot(configYamlStream), std::invalid_argument);
 }
 }

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/002b0743/main/MiNiFiMain.cpp
----------------------------------------------------------------------
diff --git a/main/MiNiFiMain.cpp b/main/MiNiFiMain.cpp
index d8fb3ca..2bf4ac6 100644
--- a/main/MiNiFiMain.cpp
+++ b/main/MiNiFiMain.cpp
@@ -81,7 +81,7 @@ void sigHandler(int signal) {
  * @return true if home_path represents a valid MINIFI_HOME
  */
 bool validHome(const std::string &home_path) {
-  struct stat stat_result{};
+  struct stat stat_result { };
   auto properties_file_path = home_path + "/" + DEFAULT_NIFI_PROPERTIES_FILE;
   return (stat(properties_file_path.c_str(), &stat_result) == 0);
 }
@@ -135,12 +135,11 @@ int main(int argc, char **argv) {
 
   if (!validHome(minifiHome)) {
     logger->log_error("No valid MINIFI_HOME could be inferred. "
-                          "Please set MINIFI_HOME or run minifi from a valid location.");
+                      "Please set MINIFI_HOME or run minifi from a valid location.");
     return -1;
   }
 
-  if (signal(SIGINT, sigHandler) == SIG_ERR || signal(SIGTERM, sigHandler) == SIG_ERR
-      || signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
+  if (signal(SIGINT, sigHandler) == SIG_ERR || signal(SIGTERM, sigHandler) == SIG_ERR ||
signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
     logger->log_error("Can not install signal handler");
     return -1;
   }
@@ -168,13 +167,11 @@ int main(int argc, char **argv) {
     } catch (const std::out_of_range &e) {
       logger->log_error("%s is out of range. %s", minifi::Configure::nifi_graceful_shutdown_seconds,
e.what());
     } catch (const std::invalid_argument &e) {
-      logger->log_error("%s contains an invalid argument set. %s",
-                        minifi::Configure::nifi_graceful_shutdown_seconds,
-                        e.what());
+      logger->log_error("%s contains an invalid argument set. %s", minifi::Configure::nifi_graceful_shutdown_seconds,
e.what());
     }
   } else {
     logger->log_debug("%s not set, defaulting to %d", minifi::Configure::nifi_graceful_shutdown_seconds,
-                      STOP_WAIT_TIME_MS);
+    STOP_WAIT_TIME_MS);
   }
 
   configure->get(minifi::Configure::nifi_provenance_repository_class_name, prov_repo_class);
@@ -190,8 +187,7 @@ int main(int argc, char **argv) {
 
   configure->get(minifi::Configure::nifi_content_repository_class_name, content_repo_class);
 
-  std::shared_ptr<core::ContentRepository>
-      content_repo = core::createContentRepository(content_repo_class, true, "content");
+  std::shared_ptr<core::ContentRepository> content_repo = core::createContentRepository(content_repo_class,
true, "content");
 
   content_repo->initialize(configure);
 
@@ -199,12 +195,7 @@ int main(int argc, char **argv) {
 
   std::shared_ptr<minifi::io::StreamFactory> stream_factory = std::make_shared<minifi::io::StreamFactory>(configure);
 
-  std::unique_ptr<core::FlowConfiguration> flow_configuration = std::move(core::createFlowConfiguration(prov_repo,
-                                                                                        
               flow_repo,
-                                                                                        
               content_repo,
-                                                                                        
               configure,
-                                                                                        
               stream_factory,
-                                                                                        
               nifi_configuration_class_name));
+  std::unique_ptr<core::FlowConfiguration> flow_configuration = core::createFlowConfiguration(prov_repo,
flow_repo, content_repo, configure, stream_factory, nifi_configuration_class_name);
 
   std::shared_ptr<minifi::FlowController> controller = std::unique_ptr<minifi::FlowController>(
       new minifi::FlowController(prov_repo, flow_repo, configure, std::move(flow_configuration),
content_repo));


Mime
View raw message