Skip to content

Commit c897a66

Browse files
committed
silence clang-tidy warning and simplify enum
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.
1 parent 2d56593 commit c897a66

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/models/eventmodel.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
#include <QSet>
1414

15-
static bool operator<(const EventModel::Process& process, qint32 pid)
15+
// silence clang warnings
16+
// NOLINTNEXTLINE(misc-use-anonymous-namespace)
17+
[[maybe_unused]] static bool operator<(const EventModel::Process& process, qint32 pid)
1618
{
1719
return process.pid < pid;
1820
}
@@ -21,15 +23,14 @@ namespace {
2123
enum class Tag : quint8
2224
{
2325
Invalid = 0,
24-
Root = 1,
25-
Overview = 2,
26-
Cpus = 3,
27-
Processes = 4,
28-
Threads = 5,
29-
Tracepoints = 6,
26+
Root,
27+
Overview,
28+
Cpus,
29+
Processes,
30+
Threads,
31+
Tracepoints,
3032
LAST_TAG,
3133
};
32-
3334
const auto DATATAG_SHIFT = sizeof(Tag) * 8;
3435
const auto DATATAG_UNSHIFT = (sizeof(quintptr) - sizeof(Tag)) * 8;
3536

0 commit comments

Comments
 (0)