src: clazy compiler warnings

get rid of most clazy warnings (https://github.com/KDE/clazy)
* range loop use refs
* qcolor ctor with ints
* missing Q_OBJECT macro
* use .constfirst instead of .first

enabled ccache for unix systems for fasterr recompiling
* if ccache is in path we use it now
This commit is contained in:
Andreas Stallinger
2017-08-10 09:45:55 +02:00
parent bb5c1d49b6
commit 37ead804bf
97 changed files with 339 additions and 344 deletions
+6 -6
View File
@@ -42,7 +42,7 @@ void Tracer::printTraces()
std::lock_guard<std::mutex> lock(m_mutex);
size_t unfinishEvents = 0;
for (auto p : m_startedEvents)
for (auto& p : m_startedEvents)
{
unfinishEvents += p.second.size();
}
@@ -67,11 +67,11 @@ void Tracer::printTraces()
std::cout << "-----------------------------------------------------------------";
std::cout << "------------------------------------------------------------\n";
for (auto p : m_events)
for (auto& p : m_events)
{
std::cout << "thread: " << p.first << std::endl;
for (const std::shared_ptr<TraceEvent> event : p.second)
for (const std::shared_ptr<TraceEvent>& event : p.second)
{
std::cout.width(8 + 2 * event->depth);
std::cout << std::right << std::setprecision(3) << std::fixed << event->time;
@@ -104,9 +104,9 @@ void Tracer::printTraces()
std::map<std::string, AccumulatedTraceEvent> accumulatedEvents;
for (auto p : m_events)
for (auto& p : m_events)
{
for (const std::shared_ptr<TraceEvent> event : p.second)
for (const std::shared_ptr<TraceEvent>& event : p.second)
{
std::string name = event->eventName + event->functionName + event->locationName;
@@ -136,7 +136,7 @@ void Tracer::printTraces()
}
);
for (const std::pair<std::string, AccumulatedTraceEvent> p : accumulatedEvents)
for (const std::pair<std::string, AccumulatedTraceEvent>& p : accumulatedEvents)
{
sortedEvents.insert(p.second);
}