]> granicus.if.org Git - icinga2/commitdiff
Fixed some compiler warnings.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 1 Feb 2013 14:44:03 +0000 (15:44 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 1 Feb 2013 14:44:03 +0000 (15:44 +0100)
components/compatido/compatidocomponent.cpp
lib/base/stream_bio.cpp
lib/base/streamlogger.cpp
lib/base/tlsstream.cpp
lib/icinga/downtimeprocessor.cpp
lib/icinga/externalcommandprocessor.cpp
lib/icinga/nullchecktask.cpp

index bca11b5544789d241e16c968f51ceaa71dfb4d7c..62181c0520cd938a659b32ee95cdc6160191af44 100644 (file)
@@ -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
index ad5a46e1c2ceb04727c6a2dd9a6d345563c1b922..020b79acc2dfaf0cc4a02838d3a68a1bb025a4dd 100644 (file)
@@ -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)
 
index bb624725a2dee0881b49d844142878370271d621..be85af703fc760266874fe1c944fa6ebc1895bad 100644 (file)
@@ -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 << "] "
index ae803a9f362c931f9260f52828038b5890cf96db..646ae0ed8ed4e9e9c48f8418bc83bf718d852613 100644 (file)
@@ -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));
index d21a44fc741bc9ba4bd3f65a31b652190d1cbc34..243f36186642608c38e537ecf04b3e8a885944a5 100644 (file)
@@ -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)
index 5a3d10ddc288721148bf47078cbe1a5a374b2696..527037683fcaeeda4f4f6efe0e9db39d46feffc7 100644 (file)
@@ -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] + "'");
index 5481baa94a198e76c48e160d1f119ab4719eb11c..5c4734366d4658c8e85493f02725faef79e9169a 100644 (file)
@@ -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);