[icinga-checkins] icinga.org: icinga-core/next: fix warnings with CLANG compiler

git at icinga.org git at icinga.org
Sat Jul 27 21:00:14 CEST 2013


Module: icinga-core
Branch: next
Commit: 2d4ac422dbace518ebdd144af2761dfb9f77e556
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=2d4ac422dbace518ebdd144af2761dfb9f77e556

Author: Michael Friedrich <Michael.Friedrich at netways.de>
Date:   Sat Jul 27 20:58:09 2013 +0200

fix warnings with CLANG compiler

fixes #4159

---

 Changelog                       |    1 +
 common/objects.c                |    8 ++++----
 module/idoutils/src/dbqueries.c |    2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/Changelog b/Changelog
index a5158b1..600bc2d 100644
--- a/Changelog
+++ b/Changelog
@@ -54,6 +54,7 @@ FIXES
 SUPPORT
 * fixed gcc warnings about unused vars and unused return values #3984 - RB
 * fixed gcc errors in extinfo.c and ido2db.c #4392 - CF
+* fix warnings with CLANG compiler #4159 - MF
 
 * classic ui: javascript cleanup and common.lib added #4324 - RB
 
diff --git a/common/objects.c b/common/objects.c
index 15e4f5e..37bf590 100644
--- a/common/objects.c
+++ b/common/objects.c
@@ -530,11 +530,11 @@ timerange *add_timerange_to_timeperiod(timeperiod *period, int day, unsigned lon
 		logit(NSLOG_CONFIG_ERROR, TRUE, "Error: Day %d is not valid for timeperiod '%s'\n", day, period->name);
 		return NULL;
 	}
-	if (start_time < 0 || start_time > 86400) {
+	if (start_time > 86400) {
 		logit(NSLOG_CONFIG_ERROR, TRUE, "Error: Start time %lu on day %d is not valid for timeperiod '%s'\n", start_time, day, period->name);
 		return NULL;
 	}
-	if (end_time < 0 || end_time > 86400) {
+	if (end_time > 86400) {
 		logit(NSLOG_CONFIG_ERROR, TRUE, "Error: End time %lu on day %d is not value for timeperiod '%s'\n", end_time, day, period->name);
 		return NULL;
 	}
@@ -599,11 +599,11 @@ timerange *add_timerange_to_daterange(daterange *drange, unsigned long start_tim
 	if (drange == NULL)
 		return NULL;
 
-	if (start_time < 0 || start_time > 86400) {
+	if (start_time > 86400) {
 		logit(NSLOG_CONFIG_ERROR, TRUE, "Error: Start time %lu is not valid for timeperiod\n", start_time);
 		return NULL;
 	}
-	if (end_time < 0 || end_time > 86400) {
+	if (end_time > 86400) {
 		logit(NSLOG_CONFIG_ERROR, TRUE, "Error: End time %lu is not value for timeperiod\n", end_time);
 		return NULL;
 	}
diff --git a/module/idoutils/src/dbqueries.c b/module/idoutils/src/dbqueries.c
index 2d39f55..9a8c522 100644
--- a/module/idoutils/src/dbqueries.c
+++ b/module/idoutils/src/dbqueries.c
@@ -10363,7 +10363,7 @@ int ido2db_query_insert_or_update_timeperiodefinition_definition_add(ido2db_idi
                 		        *id = dbi_conn_sequence_last(idi->dbinfo.dbi_conn, NULL);
 		                        ido2db_log_debug_info(IDO2DB_DEBUGL_PROCESSINFO, 2, "ido2db_handle_timeperiodefinition(%lu) timeperiod_id\n", *id);
 				}
-+
+
                         	dbi_result_free(idi->dbinfo.dbi_result);
 	                        idi->dbinfo.dbi_result = NULL;
 			}





More information about the icinga-checkins mailing list