[icinga-checkins] icinga.org: icinga2/master: Fixed some compiler warnings.

git at icinga.org git at icinga.org
Fri Feb 1 19:02:19 CET 2013


Module: icinga2
Branch: master
Commit: 7835563e035a50b6d7deee7225b26cf00e895e94
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=7835563e035a50b6d7deee7225b26cf00e895e94

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Fri Feb  1 15:44:03 2013 +0100

Fixed some compiler warnings.

---

 components/compatido/compatidocomponent.cpp |    4 +---
 lib/base/stream_bio.cpp                     |    2 --
 lib/base/streamlogger.cpp                   |    7 ++-----
 lib/base/tlsstream.cpp                      |    2 +-
 lib/icinga/downtimeprocessor.cpp            |    2 --
 lib/icinga/externalcommandprocessor.cpp     |    8 ++++----
 lib/icinga/nullchecktask.cpp                |    2 --
 7 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/components/compatido/compatidocomponent.cpp b/components/compatido/compatidocomponent.cpp
index bca11b5..62181c0 100644
--- a/components/compatido/compatidocomponent.cpp
+++ b/components/compatido/compatidocomponent.cpp
@@ -94,13 +94,11 @@ void CompatIdoComponent::Start(void)
 {
 	const int StatusTimerInterval = 60;
 	const int ConfigTimerInterval = 3600;
-	const int ProgramStatusTimerInterval = 15;
+	//const int ProgramStatusTimerInterval = 15;
 	const double ReconnectTimerInterval = GetReconnectInterval();
 
 	/* FIXME - make this a config option when unix sockets are realdy */
 
-	bool IdoSocketType = true;
-
 	/* HINTS - XXX
 	 * - only tcp sockets
 	 * - only icinga idoutils 1.8
diff --git a/lib/base/stream_bio.cpp b/lib/base/stream_bio.cpp
index ad5a46e..020b79a 100644
--- a/lib/base/stream_bio.cpp
+++ b/lib/base/stream_bio.cpp
@@ -26,8 +26,6 @@ static int I2Stream_free(BIO *bi);
 static int I2Stream_read(BIO *bi, char *out, int outl);
 static int I2Stream_write(BIO *bi, const char *in, int inl);
 static long I2Stream_ctrl(BIO *bi, int cmd, long num, void *ptr);
-static int I2Stream_gets(BIO *bi, char *buf, int size);
-static int I2Stream_puts(BIO *bi, const char *str);
 
 #define BIO_TYPE_I2STREAM		(99|0x0400|0x0100)
 
diff --git a/lib/base/streamlogger.cpp b/lib/base/streamlogger.cpp
index bb62472..be85af7 100644
--- a/lib/base/streamlogger.cpp
+++ b/lib/base/streamlogger.cpp
@@ -82,17 +82,14 @@ void StreamLogger::ProcessLogEntry(ostream& stream, bool tty, const LogEntry& en
 	strftime(timestamp, sizeof(timestamp), "%Y/%m/%d %H:%M:%S %z", &tmnow);
 
 	if (tty) {
-		String colorCode;
 		switch (entry.Severity) {
 			case LogWarning:
-				colorCode = "\x1b[1;33m"; // yellow;
+				stream << "\x1b[1;33m"; // yellow;
 				break;
 			case LogCritical:
-				colorCode = "\x1b[1;31m"; // red
+				stream << "\x1b[1;31m"; // red
 				break;
 		}
-
-		stream << colorCode;
 	}
 
 	stream << "[" << timestamp << "] "
diff --git a/lib/base/tlsstream.cpp b/lib/base/tlsstream.cpp
index ae803a9..646ae0e 100644
--- a/lib/base/tlsstream.cpp
+++ b/lib/base/tlsstream.cpp
@@ -31,7 +31,7 @@ bool I2_EXPORT TlsStream::m_SSLIndexInitialized = false;
  * @param sslContext The SSL context for the client.
  */
 TlsStream::TlsStream(const Stream::Ptr& innerStream, TlsRole role, shared_ptr<SSL_CTX> sslContext)
-	: m_InnerStream(innerStream), m_Role(role), m_SSLContext(sslContext),
+	: m_InnerStream(innerStream), m_SSLContext(sslContext), m_Role(role),
 	  m_SendQueue(boost::make_shared<FIFO>()), m_RecvQueue(boost::make_shared<FIFO>())
 {
 	m_InnerStream->OnDataAvailable.connect(boost::bind(&TlsStream::DataAvailableHandler, this));
diff --git a/lib/icinga/downtimeprocessor.cpp b/lib/icinga/downtimeprocessor.cpp
index d21a44f..243f361 100644
--- a/lib/icinga/downtimeprocessor.cpp
+++ b/lib/icinga/downtimeprocessor.cpp
@@ -198,8 +198,6 @@ void DowntimeProcessor::AddDowntimesToCache(const DynamicObject::Ptr& owner)
 	String id;
 	Dictionary::Ptr downtime;
 	BOOST_FOREACH(tie(id, downtime), downtimes) {
-		double end_time = downtime->Get("end_time");
-
 		int legacy_id = downtime->Get("legacy_id");
 
 		if (legacy_id >= m_NextDowntimeID)
diff --git a/lib/icinga/externalcommandprocessor.cpp b/lib/icinga/externalcommandprocessor.cpp
index 5a3d10d..5270376 100644
--- a/lib/icinga/externalcommandprocessor.cpp
+++ b/lib/icinga/externalcommandprocessor.cpp
@@ -141,10 +141,10 @@ void ExternalCommandProcessor::ProcessServiceCheckResult(double time, const vect
 	result->Set("state", PluginCheckTask::ExitStatusToState(exitStatus));
 
 	double now = Utility::GetTime();
-	result->Set("schedule_start", time);
-	result->Set("schedule_end", time);
-	result->Set("execution_start", time);
-	result->Set("execution_end", time);
+	result->Set("schedule_start", now);
+	result->Set("schedule_end", now);
+	result->Set("execution_start", now);
+	result->Set("execution_end", now);
 	result->Set("active", 0);
 
 	Logger::Write(LogInformation, "icinga", "Processing passive check result for service '" + arguments[1] + "'");
diff --git a/lib/icinga/nullchecktask.cpp b/lib/icinga/nullchecktask.cpp
index 5481baa..5c47343 100644
--- a/lib/icinga/nullchecktask.cpp
+++ b/lib/icinga/nullchecktask.cpp
@@ -28,8 +28,6 @@ void NullCheckTask::ScriptFunc(const ScriptTask::Ptr& task, const vector<Value>&
 	if (arguments.size() < 1)
 		throw_exception(invalid_argument("Missing argument: Service must be specified."));
 
-	double now = Utility::GetTime();
-
 	Dictionary::Ptr cr = boost::make_shared<Dictionary>();
 	cr->Set("state", StateUnknown);
 





More information about the icinga-checkins mailing list