]> granicus.if.org Git - icinga2/commitdiff
Remove unused variables
authorGunnar Beutner <gunnar.beutner@icinga.com>
Wed, 13 Dec 2017 11:47:51 +0000 (12:47 +0100)
committerGunnar Beutner <gunnar.beutner@icinga.com>
Thu, 14 Dec 2017 07:50:09 +0000 (08:50 +0100)
icinga-app/icinga.cpp
lib/base/utility.cpp
lib/cli/consolecommand.cpp
lib/config/expression.cpp
lib/remote/apiclient.cpp
lib/remote/apilistener.cpp
lib/remote/filterutility.cpp
lib/remote/httpclientconnection.cpp
plugins/check_nscp_api.cpp
plugins/check_service.cpp

index 597961ecc710ad7f4d6ad093ea1cee3876a1a4d2..f206708632f17dff58e89e2a7475a62d58304afd 100644 (file)
@@ -106,7 +106,7 @@ static int Main(void)
 
                try {
                        autoindex = Convert::ToLong(argv[2]);
-               } catch (const std::invalid_argument& ex) {
+               } catch (const std::invalid_argument&) {
                        Log(LogCritical, "icinga-app")
                            << "Invalid index for --autocomplete: " << argv[2];
                        return EXIT_FAILURE;
index fddc40cfc96bfc1b13f21898104589d685d41a33..24d5b1b9250d45c405a206695dd989f9d66f63c3 100644 (file)
@@ -1780,7 +1780,7 @@ String Utility::CreateTempFile(const String& path, int mode, std::fstream& fp)
 
        try {
                fp.open(&targetPath[0], std::ios_base::trunc | std::ios_base::out);
-       } catch (const std::fstream::failure& e) {
+       } catch (const std::fstream::failure&) {
                close(fd);
                throw;
        }
index 89cb892bc5564cec0d8d79e2e50f8cd9c2f2b8df..42a225b4a8905d691b2b038c19b17f20f2c60677 100644 (file)
@@ -515,7 +515,7 @@ void ConsoleCommand::ExecuteScriptCompletionHandler(boost::mutex& mutex, boost::
        if (eptr) {
                try {
                        boost::rethrow_exception(eptr);
-               } catch (const ScriptError& ex) {
+               } catch (const ScriptError&) {
                        eptrOut = boost::current_exception();
                } catch (const std::exception& ex) {
                        Log(LogCritical, "ConsoleCommand")
index a2a75f62f731a39656a7b0ef84b39819d1811bfe..f7dcb1a22ff264d7edf0e1b8acd43990f075db2c 100644 (file)
@@ -948,7 +948,7 @@ ExpressionResult TryExceptExpression::DoEvaluate(ScriptFrame& frame, DebugHint *
        try {
                ExpressionResult tryResult = m_TryBody->Evaluate(frame, dhint);
                CHECK_RESULT(tryResult);
-       } catch (const std::exception& ex) {
+       } catch (const std::exception&) {
                ExpressionResult exceptResult = m_ExceptBody->Evaluate(frame, dhint);
                CHECK_RESULT(exceptResult);
        }
index 124c5b9d1493af3c12dd0124631b3dca917b08d5..8cf41d38fc938ffb6d5962be6e63e16cd39f559e 100644 (file)
@@ -48,7 +48,7 @@ void ApiClient::GetTypes(const TypesCompletionCallback& callback) const
                req->AddHeader("Authorization", "Basic " + Base64::Encode(m_User + ":" + m_Password));
                req->AddHeader("Accept", "application/json");
                m_Connection->SubmitRequest(req, std::bind(TypesHttpCompletionCallback, _1, _2, callback));
-       } catch (const std::exception& ex) {
+       } catch (const std::exception&) {
                callback(boost::current_exception(), std::vector<ApiType::Ptr>());
        }
 }
@@ -133,7 +133,7 @@ void ApiClient::GetObjects(const String& pluralType, const ObjectsCompletionCall
                req->AddHeader("Authorization", "Basic " + Base64::Encode(m_User + ":" + m_Password));
                req->AddHeader("Accept", "application/json");
                m_Connection->SubmitRequest(req, std::bind(ObjectsHttpCompletionCallback, _1, _2, callback));
-       } catch (const std::exception& ex) {
+       } catch (const std::exception&) {
                callback(boost::current_exception(), std::vector<ApiObject::Ptr>());
        }
 }
@@ -242,7 +242,7 @@ void ApiClient::ExecuteScript(const String& session, const String& command, bool
                req->AddHeader("Authorization", "Basic " + Base64::Encode(m_User + ":" + m_Password));
                req->AddHeader("Accept", "application/json");
                m_Connection->SubmitRequest(req, std::bind(ExecuteScriptHttpCompletionCallback, _1, _2, callback));
-       } catch (const std::exception& ex) {
+       } catch (const std::exception&) {
                callback(boost::current_exception(), Empty);
        }
 }
index 83e023728fe07198c9ca15391a2a45c386de560d..1daf0352d67dffedaf04fee689761b6c8b609c32 100644 (file)
@@ -449,7 +449,7 @@ void ApiListener::NewClientHandlerInternal(const Socket::Ptr& client, const Stri
 
        try {
                tlsStream->Handshake();
-       } catch (const std::exception& ex) {
+       } catch (const std::exception&) {
                Log(LogCritical, "ApiListener")
                    << "Client TLS handshake failed (" << conninfo << ")";
                return;
index fbe0e0f2918bd235f5d8404e969551ad886a6de7..8038314d6c98850d3ecef10d94738c75194c3b49 100644 (file)
@@ -271,7 +271,7 @@ std::vector<Value> FilterUtility::GetFilterTargets(const QueryDescription& qd, c
                        provider->FindTargets(type, std::bind(&FilteredAddTarget,
                            std::ref(permissionFrame), permissionFilter,
                            std::ref(frame), ufilter, std::ref(result), variableName, _1));
-               } catch (const std::exception& ex) {
+               } catch (const std::exception&) {
                        delete ufilter;
                        throw;
                }
index 8cb6bbfddc38517a2e2947ae798d484b9d017abf..99ce94c093ebe93752369d3942f86c80750c2021 100644 (file)
@@ -115,7 +115,7 @@ bool HttpClientConnection::ProcessMessage(void)
 
        try {
                res = response.Parse(m_Context, false);
-       } catch (const std::exception& ex) {
+       } catch (const std::exception&) {
                callback(request, response);
 
                m_Stream->Shutdown();
index 116120c6ca69b3dee2dea0c41294d9b6c67c9610..a363dc6c93e1d6875c6fb8e630e30f2deb92604e 100644 (file)
@@ -146,7 +146,7 @@ static int FormatOutput(const Dictionary::Ptr& result)
        Dictionary::Ptr payload;
        try {
                payload = payloads->Get(0);
-       } catch (const std::exception& ex) {
+       } catch (const std::exception&) {
                std::cout << "UNKNOWN: Answer format error: 'payload' was not a Dictionary.\n";
                return 3;
        }
@@ -171,7 +171,7 @@ static int FormatOutput(const Dictionary::Ptr& result)
                Dictionary::Ptr line;
                try {
                        line = vline;
-               } catch (const std::exception& ex) {
+               } catch (const std::exception&) {
                        std::cout << "UNKNOWN: Answer format error: 'lines' entry was not a Dictionary.\n";
                        return 3;
                }
index f5f0f463b46ec5676f6bedc7a7b94cdf085a966f..fbd7ef2577c0e9f477a79400762982e9ba9956f3 100644 (file)
@@ -255,7 +255,7 @@ DWORD ServiceStatus(CONST printInfoStruct& printInfo)
 {
        SC_HANDLE hSCM;
        SC_HANDLE hService;
-       DWORD cbBufSize, lpServicesReturned, pcbBytesNeeded;
+       DWORD cbBufSize;
        DWORD lpResumeHandle = 0;
        LPBYTE lpBuf = NULL;