Skip to content

Commit

Permalink
silence clang-tidy warning and simplify enum
Browse files Browse the repository at this point in the history
The warning is plain wrong, the function isn't detected by qt if it is
in an anonymous namespace and it is used.
Enum automatically counts up so there is no need to manually set these
values.
  • Loading branch information
lievenhey committed Sep 21, 2023
1 parent 2d56593 commit c897a66
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/models/eventmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

#include <QSet>

static bool operator<(const EventModel::Process& process, qint32 pid)
// silence clang warnings
// NOLINTNEXTLINE(misc-use-anonymous-namespace)
[[maybe_unused]] static bool operator<(const EventModel::Process& process, qint32 pid)
{
return process.pid < pid;
}
Expand All @@ -21,15 +23,14 @@ namespace {
enum class Tag : quint8
{
Invalid = 0,
Root = 1,
Overview = 2,
Cpus = 3,
Processes = 4,
Threads = 5,
Tracepoints = 6,
Root,
Overview,
Cpus,
Processes,
Threads,
Tracepoints,
LAST_TAG,
};

const auto DATATAG_SHIFT = sizeof(Tag) * 8;
const auto DATATAG_UNSHIFT = (sizeof(quintptr) - sizeof(Tag)) * 8;

Expand Down

0 comments on commit c897a66

Please sign in to comment.