[icinga-checkins] icinga.org: icinga2/feature/collector-3446: Replace if( with if (

git at icinga.org git at icinga.org
Thu Feb 12 14:42:20 CET 2015


Module: icinga2
Branch: feature/collector-3446
Commit: cb6f1043e1714f2ca1b4cbba664525f0a52b9f88
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=cb6f1043e1714f2ca1b4cbba664525f0a52b9f88

Author: Gunnar Beutner <gunnar at beutner.name>
Date:   Wed Feb 11 15:47:45 2015 +0100

Replace if( with if (

---

 lib/cli/daemoncommand.cpp             |    2 +-
 lib/cli/nodewizardcommand.cpp         |    2 +-
 lib/cli/repositoryutility.cpp         |    2 +-
 lib/icinga/command.cpp                |    4 ++--
 lib/icinga/customvarobject.cpp        |   10 +++++-----
 lib/livestatus/contactgroupstable.cpp |    6 +++---
 lib/perfdata/graphitewriter.cpp       |    3 ++-
 lib/perfdata/perfdatawriter.cpp       |    5 +++--
 8 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/lib/cli/daemoncommand.cpp b/lib/cli/daemoncommand.cpp
index bee3806..3b77e45 100644
--- a/lib/cli/daemoncommand.cpp
+++ b/lib/cli/daemoncommand.cpp
@@ -347,7 +347,7 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::strin
 		return EXIT_SUCCESS;
 	}
 
-	if(vm.count("reload-internal")) {
+	if (vm.count("reload-internal")) {
 		int parentpid = vm["reload-internal"].as<int>();
 		Log(LogInformation, "cli")
 		    << "Terminating previous instance of Icinga (PID " << parentpid << ")";
diff --git a/lib/cli/nodewizardcommand.cpp b/lib/cli/nodewizardcommand.cpp
index cfc1e68..307065c 100644
--- a/lib/cli/nodewizardcommand.cpp
+++ b/lib/cli/nodewizardcommand.cpp
@@ -151,7 +151,7 @@ wizard_endpoint_loop_start:
 		std::getline(std::cin, answer);
 		boost::algorithm::to_lower(answer);
 
-		if(answer.empty()) {
+		if (answer.empty()) {
 			Log(LogWarning, "cli", "Master CN is required! Please retry.");
 			goto wizard_endpoint_loop_start;
 		}
diff --git a/lib/cli/repositoryutility.cpp b/lib/cli/repositoryutility.cpp
index 187304d..cd3c597 100644
--- a/lib/cli/repositoryutility.cpp
+++ b/lib/cli/repositoryutility.cpp
@@ -493,7 +493,7 @@ bool RepositoryUtility::SetObjectAttributeInternal(const String& name, const Str
 	std::cout << "Writing object '" << name << "' to path '" << path << "'.\n";
 
 	//TODO: Create a patch file
-	if(!WriteObjectToRepository(path, name, type, obj)) {
+	if (!WriteObjectToRepository(path, name, type, obj)) {
 		Log(LogCritical, "cli")
 		    << "Can't write object " << name << " to repository.\n";
 		return false;
diff --git a/lib/icinga/command.cpp b/lib/icinga/command.cpp
index a3071da..9a98b76 100644
--- a/lib/icinga/command.cpp
+++ b/lib/icinga/command.cpp
@@ -81,7 +81,7 @@ void Command::ValidateArguments(const String& location, const Command::Ptr& obje
 
 		String argstr = argval;
 
-		if(!Utility::ValidateMacroString(argstr)) {
+		if (!Utility::ValidateMacroString(argstr)) {
 			BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
 			    location + ": Closing $ not found in macro format string '" + argstr + "'.", object->GetDebugInfo()));
 		}
@@ -102,7 +102,7 @@ void Command::ValidateEnvironmentVariables(const String& location, const Command
 		if (!envval.IsString() || envval.IsEmpty())
 			continue;
 
-		if(!Utility::ValidateMacroString(envval)) {
+		if (!Utility::ValidateMacroString(envval)) {
 			BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
 			    location + ": Closing $ not found in macro format string '" + envval + "'.", object->GetDebugInfo()));
 		}
diff --git a/lib/icinga/customvarobject.cpp b/lib/icinga/customvarobject.cpp
index ca7e4bb..e86587d 100644
--- a/lib/icinga/customvarobject.cpp
+++ b/lib/icinga/customvarobject.cpp
@@ -85,10 +85,10 @@ void CustomVarObject::ValidateCustomAttributes(const String& location, const Cus
 
 			ObjectLock xlock(varval_dict);
 			BOOST_FOREACH(const Dictionary::Pair& kv_var, varval_dict) {
-				if(kv_var.second.IsEmpty())
+				if (kv_var.second.IsEmpty())
 					continue;
 
-				if(!Utility::ValidateMacroString(kv_var.second)) {
+				if (!Utility::ValidateMacroString(kv_var.second)) {
 					BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
 					    location + ": Closing $ not found in macro format string '" + kv_var.second + "'.", object->GetDebugInfo()));
 				}
@@ -102,7 +102,7 @@ void CustomVarObject::ValidateCustomAttributes(const String& location, const Cus
 				if (arrval.IsEmpty())
 					continue;
 
-				if(!Utility::ValidateMacroString(arrval)) {
+				if (!Utility::ValidateMacroString(arrval)) {
 					BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
 					    location + ": Closing $ not found in macro format string '" + arrval + "'.", object->GetDebugInfo()));
 				}
@@ -113,10 +113,10 @@ void CustomVarObject::ValidateCustomAttributes(const String& location, const Cus
 
 			String varstr = varval;
 
-			if(!Utility::ValidateMacroString(varstr)) {
+			if (!Utility::ValidateMacroString(varstr)) {
 				BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
 				    location + ": Closing $ not found in macro format string '" + varstr + "'.", object->GetDebugInfo()));
 			}
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/lib/livestatus/contactgroupstable.cpp b/lib/livestatus/contactgroupstable.cpp
index 3e513a6..43ef038 100644
--- a/lib/livestatus/contactgroupstable.cpp
+++ b/lib/livestatus/contactgroupstable.cpp
@@ -58,7 +58,7 @@ Value ContactGroupsTable::NameAccessor(const Value& row)
 {
 	UserGroup::Ptr user_group = static_cast<UserGroup::Ptr>(row);
 
-	if(!user_group)
+	if (!user_group)
 		return Empty;
 
 	return user_group->GetName();
@@ -68,7 +68,7 @@ Value ContactGroupsTable::AliasAccessor(const Value& row)
 {
 	UserGroup::Ptr user_group = static_cast<UserGroup::Ptr>(row);
 
-	if(!user_group)
+	if (!user_group)
 		return Empty;
 
 	return user_group->GetName();
@@ -78,7 +78,7 @@ Value ContactGroupsTable::MembersAccessor(const Value& row)
 {
 	UserGroup::Ptr user_group = static_cast<UserGroup::Ptr>(row);
 
-	if(!user_group)
+	if (!user_group)
 		return Empty;
 
 	Array::Ptr members = new Array();
diff --git a/lib/perfdata/graphitewriter.cpp b/lib/perfdata/graphitewriter.cpp
index f4790a7..59a7abf 100644
--- a/lib/perfdata/graphitewriter.cpp
+++ b/lib/perfdata/graphitewriter.cpp
@@ -234,10 +234,11 @@ Value GraphiteWriter::EscapeMacroMetric(const Value& value)
 
 void GraphiteWriter::ValidateNameTemplates(const String& location, const GraphiteWriter::Ptr& object)
 {
-	if(!Utility::ValidateMacroString(object->GetHostNameTemplate())) {
+	if (!Utility::ValidateMacroString(object->GetHostNameTemplate())) {
 		BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
 		    location + ": Closing $ not found in macro format string '" + object->GetHostNameTemplate() + "'.", object->GetDebugInfo()));
 	}
+
 	if (!Utility::ValidateMacroString(object->GetServiceNameTemplate())) {
 		BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
 		    location + ": Closing $ not found in macro format string '" + object->GetServiceNameTemplate() + "'.", object->GetDebugInfo()));
diff --git a/lib/perfdata/perfdatawriter.cpp b/lib/perfdata/perfdatawriter.cpp
index 902d778..f3e1ad6 100644
--- a/lib/perfdata/perfdatawriter.cpp
+++ b/lib/perfdata/perfdatawriter.cpp
@@ -142,12 +142,13 @@ void PerfdataWriter::RotationTimerHandler(void)
 
 void PerfdataWriter::ValidateFormatTemplates(const String& location, const PerfdataWriter::Ptr& object)
 {
-	if(!Utility::ValidateMacroString(object->GetHostFormatTemplate())) {
+	if (!Utility::ValidateMacroString(object->GetHostFormatTemplate())) {
 		BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
 		    location + ": Closing $ not found in macro format string '" + object->GetHostFormatTemplate() + "'.", object->GetDebugInfo()));
 	}
+
 	if (!Utility::ValidateMacroString(object->GetServiceFormatTemplate())) {
 		BOOST_THROW_EXCEPTION(ScriptError("Validation failed for " +
 		    location + ": Closing $ not found in macro format string '" + object->GetHostFormatTemplate() + "'.", object->GetDebugInfo()));
 	}
-}
\ No newline at end of file
+}



More information about the icinga-checkins mailing list