Remove unused variables

This commit is contained in:
Gunnar Beutner 2017-12-13 12:47:51 +01:00
parent c7a37090d0
commit 96e214221d
10 changed files with 13 additions and 13 deletions

View 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;

View 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;
}

View 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")

View 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);
}

View 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);
}
}

View 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;

View 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;
}

View 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();

View 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;
}

View 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;