Skip to content

Commit c25297e

Browse files
authored
Merge pull request #9729 from Icinga/fix-compiler-warnings-by-removing-unused-variables
Fix compiler warnings by removing unused variables
2 parents 6d98756 + 3d69a31 commit c25297e

Some content is hidden

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

46 files changed

+93
-104
lines changed

icinga-app/icinga.cpp

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

557557
if (autocomplete) {
558-
CLICommand::ShowCommands(argc, argv, &visibleDesc, &hiddenDesc,
558+
CLICommand::ShowCommands(argc, argv, &visibleDesc,
559559
&GlobalArgumentCompletion, true, autoindex);
560560
rc = 0;
561561
} else if (command) {

lib/base/process.cpp

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

225-
static Value ProcessKillImpl(struct msghdr *msgh, const Dictionary::Ptr& request)
225+
static Value ProcessKillImpl(const Dictionary::Ptr& request)
226226
{
227227
pid_t pid = request->Get("pid");
228228
int signum = request->Get("signum");
@@ -238,7 +238,7 @@ static Value ProcessKillImpl(struct msghdr *msgh, const Dictionary::Ptr& request
238238
return response;
239239
}
240240

241-
static Value ProcessWaitPIDImpl(struct msghdr *msgh, const Dictionary::Ptr& request)
241+
static Value ProcessWaitPIDImpl(const Dictionary::Ptr& request)
242242
{
243243
pid_t pid = request->Get("pid");
244244

@@ -321,9 +321,9 @@ static void ProcessHandler()
321321
if (command == "spawn")
322322
response = ProcessSpawnImpl(&msg, request);
323323
else if (command == "waitpid")
324-
response = ProcessWaitPIDImpl(&msg, request);
324+
response = ProcessWaitPIDImpl(request);
325325
else if (command == "kill")
326-
response = ProcessKillImpl(&msg, request);
326+
response = ProcessKillImpl(request);
327327
else
328328
response = Empty;
329329

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
@@ -768,8 +768,10 @@ int DaemonCommand::Run(const po::variables_map& vm, const std::vector<std::strin
768768
// Whether we already forwarded a termination signal to the seamless worker
769769
bool requestedTermination = false;
770770

771+
#ifdef HAVE_SYSTEMD
771772
// Whether we already notified systemd about our termination
772773
bool notifiedTermination = false;
774+
#endif /* HAVE_SYSTEMD */
773775

774776
for (;;) {
775777
#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); });
@@ -240,7 +240,7 @@ void CompatLogger::RemoveDowntimeHandler(const Downtime::Ptr& downtime)
240240
/**
241241
* @threadsafety Always.
242242
*/
243-
void CompatLogger::NotificationSentHandler(const Notification::Ptr& notification, const Checkable::Ptr& checkable,
243+
void CompatLogger::NotificationSentHandler(const Checkable::Ptr& checkable,
244244
const User::Ptr& user, NotificationType notification_type, CheckResult::Ptr const& cr,
245245
const String& author, const String& comment_text, const String& command_name)
246246
{

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

lib/config/expression.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ bool VariableExpression::GetReference(ScriptFrame& frame, bool init_dict, Value
138138

139139
if (dhint && *dhint)
140140
*dhint = new DebugHint((*dhint)->GetChild(m_Variable));
141-
} else if (VMOps::FindVarImportRef(frame, m_Imports, m_Variable, parent, m_DebugInfo)) {
141+
} else if (VMOps::FindVarImportRef(frame, m_Imports, m_Variable, parent)) {
142142
return true;
143143
} else if (frame.GetGlobals()->Contains(m_Variable)) {
144144
*parent = frame.GetGlobals();
@@ -476,7 +476,7 @@ ExpressionResult FunctionCallExpression::DoEvaluate(ScriptFrame& frame, DebugHin
476476
arguments.push_back(argres.GetValue());
477477
}
478478

479-
return VMOps::ConstructorCall(vfunc, arguments, m_DebugInfo);
479+
return VMOps::ConstructorCall(vfunc, arguments);
480480
}
481481

482482
if (!vfunc.IsObjectType<Function>())
@@ -496,7 +496,7 @@ ExpressionResult FunctionCallExpression::DoEvaluate(ScriptFrame& frame, DebugHin
496496
arguments.push_back(argres.GetValue());
497497
}
498498

499-
return VMOps::FunctionCall(frame, self, func, arguments);
499+
return VMOps::FunctionCall(self, func, arguments);
500500
}
501501

502502
ExpressionResult ArrayExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const

0 commit comments

Comments
 (0)