Skip to content

Commit 2dad63e

Browse files
committed
Fix compiler warnings
1 parent 583db7c commit 2dad63e

19 files changed

+34
-47
lines changed

icinga-app/icinga.cpp

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

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

lib/base/namespace.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ void ConstEmbeddedNamespaceValue::Set(const Value& value, bool overrideFrozen, c
160160
EmbeddedNamespaceValue::Set(value, overrideFrozen, debugInfo);
161161
}
162162

163+
// A derived class instance destroyed via pointer to the base class requires the base class to provide a virtual destructor.
164+
NamespaceBehavior::~NamespaceBehavior()
165+
{
166+
}
167+
163168
void NamespaceBehavior::Register(const Namespace::Ptr& ns, const String& field, const Value& value, bool, const DebugInfo&) const
164169
{
165170
ns->SetAttribute(field, new EmbeddedNamespaceValue(value));

lib/base/namespace.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class Namespace;
4545

4646
struct NamespaceBehavior
4747
{
48+
virtual ~NamespaceBehavior();
49+
4850
virtual void Register(const boost::intrusive_ptr<Namespace>& ns, const String& field, const Value& value, bool overrideFrozen, const DebugInfo& debugInfo) const;
4951
virtual void Remove(const boost::intrusive_ptr<Namespace>& ns, const String& field, bool overrideFrozen);
5052
};

lib/base/process.cpp

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

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

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

@@ -310,9 +310,9 @@ static void ProcessHandler()
310310
if (command == "spawn")
311311
response = ProcessSpawnImpl(&msg, request);
312312
else if (command == "waitpid")
313-
response = ProcessWaitPIDImpl(&msg, request);
313+
response = ProcessWaitPIDImpl(request);
314314
else if (command == "kill")
315-
response = ProcessKillImpl(&msg, request);
315+
response = ProcessKillImpl(request);
316316
else
317317
response = Empty;
318318

lib/base/workqueue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ boost::thread_specific_ptr<WorkQueue *> l_ThreadWorkQueue;
1616

1717
WorkQueue::WorkQueue(size_t maxItems, int threadCount, LogSeverity statsLogLevel)
1818
: m_ID(m_NextID++), m_ThreadCount(threadCount), m_MaxItems(maxItems),
19-
m_TaskStats(15 * 60), m_StatsLogLevel(statsLogLevel)
19+
m_StatsLogLevel(statsLogLevel), m_TaskStats(15 * 60)
2020
{
2121
/* Initialize logger. */
2222
m_StatusTimerTimeout = Utility::GetTime();

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

782+
#ifdef HAVE_SYSTEMD
782783
// Whether we already notified systemd about our termination
783784
bool notifiedTermination = false;
785+
#endif /* HAVE_SYSTEMD */
784786

785787
for (;;) {
786788
#ifdef HAVE_SYSTEMD

lib/config/expression.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ ExpressionResult FunctionCallExpression::DoEvaluate(ScriptFrame& frame, DebugHin
491491
arguments.push_back(argres.GetValue());
492492
}
493493

494-
return VMOps::FunctionCall(frame, self, func, arguments);
494+
return VMOps::FunctionCall(self, func, arguments);
495495
}
496496

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

lib/config/vmops.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace icinga
2626
class VMOps
2727
{
2828
public:
29-
static inline bool FindVarImportRef(ScriptFrame& frame, const std::vector<Expression::Ptr>& imports, const String& name, Value *result, const DebugInfo& debugInfo = DebugInfo())
29+
static inline bool FindVarImportRef(ScriptFrame& frame, const std::vector<Expression::Ptr>& imports, const String& name, Value *result)
3030
{
3131
for (const auto& import : imports) {
3232
ExpressionResult res = import->Evaluate(frame);
@@ -52,7 +52,7 @@ class VMOps
5252
return false;
5353
}
5454

55-
static inline Value ConstructorCall(const Type::Ptr& type, const std::vector<Value>& args, const DebugInfo& debugInfo = DebugInfo())
55+
static inline Value ConstructorCall(const Type::Ptr& type, const std::vector<Value>& args)
5656
{
5757
if (type->GetName() == "String") {
5858
if (args.empty())
@@ -81,7 +81,7 @@ class VMOps
8181
return type->Instantiate(args);
8282
}
8383

84-
static inline Value FunctionCall(ScriptFrame& frame, const Value& self, const Function::Ptr& func, const std::vector<Value>& arguments)
84+
static inline Value FunctionCall(const Value& self, const Function::Ptr& func, const std::vector<Value>& arguments)
8585
{
8686
if (!self.IsEmpty() || self.IsString())
8787
return func->InvokeThis(self, arguments);

0 commit comments

Comments
 (0)