Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/base/object-packer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,5 +242,5 @@ String icinga::PackObject(const Value& value)
std::string builder;
PackAny(value, builder);

return std::move(builder);
return builder;
}
8 changes: 4 additions & 4 deletions lib/base/tcpsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lib/base/tcpsocket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/base/workqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion lib/config/config_parser.yy
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions lib/config/configcompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/icinga/legacytimeperiod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions lib/icingadb/icingadb-objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1929,10 +1929,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));
}
}

Expand Down
8 changes: 4 additions & 4 deletions lib/icingadb/redisconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
});
}
Expand Down
4 changes: 2 additions & 2 deletions tools/mkclass/class_lexer.ll
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading