Skip to content

Commit ab8b335

Browse files
committed
Fix compiler warnings by removing unused variables
1 parent 66b039d commit ab8b335

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+143
-173
lines changed

icinga-app/icinga.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ static int Main()
551551
int rc = 1;
552552

553553
if (autocomplete) {
554-
CLICommand::ShowCommands(argc, argv, &visibleDesc, &hiddenDesc,
554+
CLICommand::ShowCommands(argc, argv, &visibleDesc,
555555
&GlobalArgumentCompletion, true, autoindex);
556556
rc = 0;
557557
} else if (command) {

lib/base/process.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static Value ProcessSpawnImpl(struct msghdr *msgh, const Dictionary::Ptr& reques
210210
return response;
211211
}
212212

213-
static Value ProcessKillImpl(struct msghdr *msgh, const Dictionary::Ptr& request)
213+
static Value ProcessKillImpl(const Dictionary::Ptr& request)
214214
{
215215
pid_t pid = request->Get("pid");
216216
int signum = request->Get("signum");
@@ -226,7 +226,7 @@ static Value ProcessKillImpl(struct msghdr *msgh, const Dictionary::Ptr& request
226226
return response;
227227
}
228228

229-
static Value ProcessWaitPIDImpl(struct msghdr *msgh, const Dictionary::Ptr& request)
229+
static Value ProcessWaitPIDImpl(const Dictionary::Ptr& request)
230230
{
231231
pid_t pid = request->Get("pid");
232232

@@ -309,9 +309,9 @@ static void ProcessHandler()
309309
if (command == "spawn")
310310
response = ProcessSpawnImpl(&msg, request);
311311
else if (command == "waitpid")
312-
response = ProcessWaitPIDImpl(&msg, request);
312+
response = ProcessWaitPIDImpl(request);
313313
else if (command == "kill")
314-
response = ProcessKillImpl(&msg, request);
314+
response = ProcessKillImpl(request);
315315
else
316316
response = Empty;
317317

lib/base/tlsutility.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,6 @@ int GetCertificateVersion(const std::shared_ptr<X509>& cert)
10041004

10051005
String GetSignatureAlgorithm(const std::shared_ptr<X509>& cert)
10061006
{
1007-
int alg;
10081007
int sign_alg;
10091008
X509_PUBKEY *key;
10101009
X509_ALGOR *algor;
@@ -1013,7 +1012,7 @@ String GetSignatureAlgorithm(const std::shared_ptr<X509>& cert)
10131012

10141013
X509_PUBKEY_get0_param(nullptr, nullptr, 0, &algor, key); //TODO: Error handling
10151014

1016-
alg = OBJ_obj2nid (algor->algorithm);
1015+
OBJ_obj2nid (algor->algorithm);
10171016

10181017
#if OPENSSL_VERSION_NUMBER < 0x10100000L
10191018
sign_alg = OBJ_obj2nid((cert.get())->sig_alg->algorithm);

lib/cli/clicommand.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ bool CLICommand::ParseCommand(int argc, char **argv, po::options_description& vi
220220
}
221221

222222
void CLICommand::ShowCommands(int argc, char **argv, po::options_description *visibleDesc,
223-
po::options_description *hiddenDesc,
224223
ArgumentCompletionCallback globalArgCompletionCallback,
225224
bool autocomplete, int autoindex)
226225
{

lib/cli/clicommand.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class CLICommand : public Object
5959

6060
static void ShowCommands(int argc, char **argv,
6161
boost::program_options::options_description *visibleDesc = nullptr,
62-
boost::program_options::options_description *hiddenDesc = nullptr,
6362
ArgumentCompletionCallback globalArgCompletionCallback = nullptr,
6463
bool autocomplete = false, int autoindex = -1);
6564

lib/cli/daemoncommand.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,8 +767,10 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::strin
767767
// Whether we already forwarded a termination signal to the seamless worker
768768
bool requestedTermination = false;
769769

770+
#ifdef HAVE_SYSTEMD
770771
// Whether we already notified systemd about our termination
771772
bool notifiedTermination = false;
773+
#endif /* HAVE_SYSTEMD */
772774

773775
for (;;) {
774776
#ifdef HAVE_SYSTEMD

lib/cli/nodesetupcommand.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ int NodeSetupCommand::Run(const boost::program_options::variables_map& vm, const
8888
}
8989

9090
if (vm.count("master"))
91-
return SetupMaster(vm, ap);
91+
return SetupMaster(vm);
9292
else
93-
return SetupNode(vm, ap);
93+
return SetupNode(vm);
9494
}
9595

96-
int NodeSetupCommand::SetupMaster(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap)
96+
int NodeSetupCommand::SetupMaster(const boost::program_options::variables_map& vm)
9797
{
9898
/* Ignore not required parameters */
9999
if (vm.count("ticket"))
@@ -250,7 +250,7 @@ int NodeSetupCommand::SetupMaster(const boost::program_options::variables_map& v
250250
return 0;
251251
}
252252

253-
int NodeSetupCommand::SetupNode(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap)
253+
int NodeSetupCommand::SetupNode(const boost::program_options::variables_map& vm)
254254
{
255255
/* require at least one endpoint. Ticket is optional. */
256256
if (!vm.count("endpoint")) {

lib/cli/nodesetupcommand.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class NodeSetupCommand final : public CLICommand
2727
int Run(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap) const override;
2828

2929
private:
30-
static int SetupMaster(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap);
31-
static int SetupNode(const boost::program_options::variables_map& vm, const std::vector<std::string>& ap);
30+
static int SetupMaster(const boost::program_options::variables_map& vm);
31+
static int SetupNode(const boost::program_options::variables_map& vm);
3232
};
3333

3434
}

lib/compat/compatlogger.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ void CompatLogger::Start(bool runtimeCreated)
5252
Checkable::OnNewCheckResult.connect([this](const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, const MessageOrigin::Ptr&) {
5353
CheckResultHandler(checkable, cr);
5454
});
55-
Checkable::OnNotificationSentToUser.connect([this](const Notification::Ptr& notification, const Checkable::Ptr& checkable,
55+
Checkable::OnNotificationSentToUser.connect([this](const Notification::Ptr&, const Checkable::Ptr& checkable,
5656
const User::Ptr& user, const NotificationType& type, const CheckResult::Ptr& cr, const String& author,
5757
const String& commentText, const String& commandName, const MessageOrigin::Ptr&) {
58-
NotificationSentHandler(notification, checkable, user, type, cr, author, commentText, commandName);
58+
NotificationSentHandler(checkable, user, type, cr, author, commentText, commandName);
5959
});
6060

6161
Downtime::OnDowntimeTriggered.connect([this](const Downtime::Ptr& downtime) { TriggerDowntimeHandler(downtime); });
@@ -238,7 +238,7 @@ void CompatLogger::RemoveDowntimeHandler(const Downtime::Ptr& downtime)
238238
/**
239239
* @threadsafety Always.
240240
*/
241-
void CompatLogger::NotificationSentHandler(const Notification::Ptr& notification, const Checkable::Ptr& checkable,
241+
void CompatLogger::NotificationSentHandler(const Checkable::Ptr& checkable,
242242
const User::Ptr& user, NotificationType notification_type, CheckResult::Ptr const& cr,
243243
const String& author, const String& comment_text, const String& command_name)
244244
{

lib/compat/compatlogger.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CompatLogger final : public ObjectImpl<CompatLogger>
3535
void Flush();
3636

3737
void CheckResultHandler(const Checkable::Ptr& service, const CheckResult::Ptr& cr);
38-
void NotificationSentHandler(const Notification::Ptr& notification, const Checkable::Ptr& service,
38+
void NotificationSentHandler(const Checkable::Ptr& service,
3939
const User::Ptr& user, NotificationType notification_type, CheckResult::Ptr const& cr,
4040
const String& author, const String& comment_text, const String& command_name);
4141
void FlappingChangedHandler(const Checkable::Ptr& checkable);

0 commit comments

Comments
 (0)