mirror of
https://github.com/Icinga/icinga2.git
synced 2025-10-25 09:13:54 +02:00
Merge pull request #9411 from Icinga/compiler-warnings
Fix compiler warnings
This commit is contained in:
commit
f42510f981
@ -242,5 +242,5 @@ String icinga::PackObject(const Value& value)
|
||||
std::string builder;
|
||||
PackAny(value, builder);
|
||||
|
||||
return std::move(builder);
|
||||
return builder;
|
||||
}
|
||||
|
||||
@ -32,8 +32,8 @@ void TcpSocket::Bind(const String& node, const String& service, int family)
|
||||
{
|
||||
addrinfo hints;
|
||||
addrinfo *result;
|
||||
int error;
|
||||
const char *func;
|
||||
int error = 0;
|
||||
const char *func = nullptr;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = family;
|
||||
@ -126,8 +126,8 @@ void TcpSocket::Connect(const String& node, const String& service)
|
||||
{
|
||||
addrinfo hints;
|
||||
addrinfo *result;
|
||||
int error;
|
||||
const char *func;
|
||||
int error = 0;
|
||||
const char *func = nullptr;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
|
||||
@ -54,7 +54,7 @@ void Connect(Socket& socket, const String& node, const String& service)
|
||||
} catch (const std::exception& ex) {
|
||||
auto se (dynamic_cast<const boost::system::system_error*>(&ex));
|
||||
|
||||
if (se && se->code() == boost::asio::error::operation_aborted || ++current == result.end()) {
|
||||
if ((se && se->code() == boost::asio::error::operation_aborted) || ++current == result.end()) {
|
||||
throw;
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ void Connect(Socket& socket, const String& node, const String& service, boost::a
|
||||
} catch (const std::exception& ex) {
|
||||
auto se (dynamic_cast<const boost::system::system_error*>(&ex));
|
||||
|
||||
if (se && se->code() == boost::asio::error::operation_aborted || ++current == result.end()) {
|
||||
if ((se && se->code() == boost::asio::error::operation_aborted) || ++current == result.end()) {
|
||||
throw;
|
||||
}
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ boost::thread_specific_ptr<WorkQueue *> l_ThreadWorkQueue;
|
||||
|
||||
WorkQueue::WorkQueue(size_t maxItems, int threadCount, LogSeverity statsLogLevel)
|
||||
: m_ID(m_NextID++), m_ThreadCount(threadCount), m_MaxItems(maxItems),
|
||||
m_TaskStats(15 * 60), m_StatsLogLevel(statsLogLevel)
|
||||
m_StatsLogLevel(statsLogLevel), m_TaskStats(15 * 60)
|
||||
{
|
||||
/* Initialize logger. */
|
||||
m_StatusTimerTimeout = Utility::GetTime();
|
||||
|
||||
@ -280,7 +280,7 @@ std::unique_ptr<Expression> ConfigCompiler::Compile()
|
||||
|
||||
std::unique_ptr<DictExpression> expr{new DictExpression(std::move(dlist))};
|
||||
expr->MakeInline();
|
||||
return std::move(expr);
|
||||
return expr;
|
||||
}
|
||||
|
||||
#define scanner (context->GetScanner())
|
||||
|
||||
@ -146,7 +146,7 @@ std::unique_ptr<Expression> ConfigCompiler::HandleInclude(const String& relative
|
||||
|
||||
std::unique_ptr<DictExpression> expr{new DictExpression(std::move(expressions))};
|
||||
expr->MakeInline();
|
||||
return std::move(expr);
|
||||
return expr;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -174,7 +174,7 @@ std::unique_ptr<Expression> ConfigCompiler::HandleIncludeRecursive(const String&
|
||||
|
||||
std::unique_ptr<DictExpression> dict{new DictExpression(std::move(expressions))};
|
||||
dict->MakeInline();
|
||||
return std::move(dict);
|
||||
return dict;
|
||||
}
|
||||
|
||||
void ConfigCompiler::HandleIncludeZone(const String& relativeBase, const String& tag, const String& path, const String& pattern, const String& package, std::vector<std::unique_ptr<Expression> >& expressions)
|
||||
|
||||
@ -541,7 +541,7 @@ Dictionary::Ptr LegacyTimePeriod::FindNextSegment(const String& daydef, const St
|
||||
ProcessTimeRanges(timeranges, &iter, segments);
|
||||
|
||||
Dictionary::Ptr bestSegment;
|
||||
double bestBegin;
|
||||
double bestBegin = 0;
|
||||
|
||||
ObjectLock olock(segments);
|
||||
for (Dictionary::Ptr segment : segments) {
|
||||
|
||||
@ -1928,10 +1928,10 @@ unsigned short GetPreviousState(const Checkable::Ptr& checkable, const Service::
|
||||
{
|
||||
auto phs ((type == StateTypeHard ? checkable->GetLastHardStatesRaw() : checkable->GetLastSoftStatesRaw()) % 100u);
|
||||
|
||||
if (service) {
|
||||
if (service || phs == 99) {
|
||||
return phs;
|
||||
} else {
|
||||
return phs == 99 ? phs : Host::CalculateState(ServiceState(phs));
|
||||
return Host::CalculateState(ServiceState(phs));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -41,11 +41,11 @@ RedisConnection::RedisConnection(const String& host, int port, const String& pat
|
||||
RedisConnection::RedisConnection(boost::asio::io_context& io, String host, int port, String path, String username, String password,
|
||||
int db, bool useTls, bool insecure, String certPath, String keyPath, String caPath, String crlPath,
|
||||
String tlsProtocolmin, String cipherList, double connectTimeout, DebugInfo di, const RedisConnection::Ptr& parent)
|
||||
: m_Host(std::move(host)), m_Port(port), m_Path(std::move(path)), m_Username(std::move(username)), m_Password(std::move(password)),
|
||||
: m_Path(std::move(path)), m_Host(std::move(host)), m_Port(port), m_Username(std::move(username)), m_Password(std::move(password)),
|
||||
m_DbIndex(db), m_CertPath(std::move(certPath)), m_KeyPath(std::move(keyPath)), m_Insecure(insecure),
|
||||
m_CaPath(std::move(caPath)), m_CrlPath(std::move(crlPath)), m_TlsProtocolmin(std::move(tlsProtocolmin)),
|
||||
m_CipherList(std::move(cipherList)), m_ConnectTimeout(connectTimeout), m_DebugInfo(std::move(di)), m_Connecting(false), m_Connected(false),
|
||||
m_Started(false), m_Strand(io), m_QueuedWrites(io), m_QueuedReads(io), m_LogStatsTimer(io), m_Parent(parent)
|
||||
m_CipherList(std::move(cipherList)), m_ConnectTimeout(connectTimeout), m_DebugInfo(std::move(di)), m_Strand(io),
|
||||
m_Connecting(false), m_Connected(false), m_Started(false), m_QueuedWrites(io), m_QueuedReads(io), m_LogStatsTimer(io), m_Parent(parent)
|
||||
{
|
||||
if (useTls && m_Path.IsEmpty()) {
|
||||
UpdateTLSContext();
|
||||
@ -224,7 +224,7 @@ void RedisConnection::EnqueueCallback(const std::function<void(boost::asio::yiel
|
||||
auto ctime (Utility::GetTime());
|
||||
|
||||
asio::post(m_Strand, [this, callback, priority, ctime]() {
|
||||
m_Queues.Writes[priority].emplace(WriteQueueItem{nullptr, nullptr, nullptr, nullptr, callback, ctime});
|
||||
m_Queues.Writes[priority].emplace(WriteQueueItem{nullptr, nullptr, nullptr, nullptr, callback, ctime, QueryAffects{}});
|
||||
m_QueuedWrites.Set();
|
||||
});
|
||||
}
|
||||
|
||||
@ -26,8 +26,8 @@ do { \
|
||||
} while (0)
|
||||
|
||||
struct lex_buf {
|
||||
char *buf;
|
||||
size_t size;
|
||||
char *buf = NULL;
|
||||
size_t size = 0;
|
||||
};
|
||||
|
||||
static void lb_init(lex_buf *lb)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user