From: Gunnar Beutner Date: Sat, 4 Aug 2012 07:58:31 +0000 (+0200) Subject: Fixed compiler warnings. X-Git-Tag: v0.0.1~168 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d4c68240562eaa57ef6a8f8dc1c771e4693ae61c;p=icinga2 Fixed compiler warnings. --- diff --git a/base/application.cpp b/base/application.cpp index 0d0cd1a9b..54d7d3487 100644 --- a/base/application.cpp +++ b/base/application.cpp @@ -82,7 +82,9 @@ Application::Ptr Application::GetInstance(void) */ void Application::RunEventLoop(void) { +#ifdef _DEBUG double nextProfile = 0; +#endif /* _DEBUG */ while (!m_ShuttingDown) { Object::ClearHeldObjects(); @@ -148,7 +150,7 @@ String Application::GetExePath(void) const executablePath = argv0; bool foundSlash = false; - for (int i = 0; i < argv0.GetLength(); i++) { + for (size_t i = 0; i < argv0.GetLength(); i++) { if (argv0[i] == '/') { foundSlash = true; break; diff --git a/base/process.cpp b/base/process.cpp index 01598b094..97ac04541 100644 --- a/base/process.cpp +++ b/base/process.cpp @@ -199,6 +199,8 @@ bool Process::RunTask(void) outputbuf << "Process was terminated by signal " << WTERMSIG(status); output = outputbuf.str(); exitcode = 128; + } else { + exitcode = 128; } #endif /* _MSC_VER */ diff --git a/base/sysloglogger.cpp b/base/sysloglogger.cpp index 94455cd56..8b66997b9 100644 --- a/base/sysloglogger.cpp +++ b/base/sysloglogger.cpp @@ -10,8 +10,6 @@ using namespace icinga; */ void SyslogLogger::ProcessLogEntry(const LogEntry& entry) { - char timestamp[100]; - int severity; switch (entry.Severity) { case LogDebug: diff --git a/base/tlsclient.cpp b/base/tlsclient.cpp index 2ba222d14..ac2fb522e 100644 --- a/base/tlsclient.cpp +++ b/base/tlsclient.cpp @@ -112,13 +112,9 @@ shared_ptr TlsClient::GetPeerCertificate(void) const */ void TlsClient::HandleReadable(void) { - int result; - m_BlockRead = false; m_BlockWrite = false; - result = 0; - for (;;) { char data[1024]; int rc; diff --git a/components/delegation/delegationcomponent.cpp b/components/delegation/delegationcomponent.cpp index e30d0429c..bc4a053af 100644 --- a/components/delegation/delegationcomponent.cpp +++ b/components/delegation/delegationcomponent.cpp @@ -95,7 +95,6 @@ void DelegationComponent::DelegationTimerHandler(void) std::random_shuffle(services.begin(), services.end()); - bool need_clear = false; int delegated = 0; /* re-assign services */ @@ -135,7 +134,6 @@ void DelegationComponent::DelegationTimerHandler(void) /* clear the service's current checker */ if (!checker.IsEmpty()) { - need_clear = true; service->SetChecker(""); if (oldEndpoint)