clang-tidy: clang-analyzer-*

This commit aims to fix all clang-analyzer-* warnings from clang-tidy.
Here is the list of the ones found in project:
    "clang-analyzer-core.uninitialized.UndefReturn",
    "clang-analyzer-deadcode.DeadStores",
    "clang-analyzer-optin.core.EnumCastOutOfRange",
Some exceptions:
  clang-analyzer-cplusplus.NewDeleteLeaks -> may need to disable it as
is a false positive
  clang-analyzer-optin.cplusplus.VirtualCall -> may need to disable it
(or refactor a bunch of code to drop the virtual from those functions)

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2026-02-25 17:15:36 +02:00
parent 323c25d83b
commit 6699d3eca0
No known key found for this signature in database
GPG key ID: 55EF5DA53DB36318
11 changed files with 50 additions and 62 deletions

View file

@ -511,8 +511,7 @@ void InstanceView::paintEvent([[maybe_unused]] QPaintEvent* event)
int wpWidth = viewport()->width();
option.rect.setWidth(wpWidth);
for (int i = 0; i < m_groups.size(); ++i) {
VisualGroup* category = m_groups.at(i);
for (auto* category : m_groups) {
int y = category->verticalPosition();
y -= verticalOffset();
QRect backup = option.rect;
@ -522,7 +521,6 @@ void InstanceView::paintEvent([[maybe_unused]] QPaintEvent* event)
option.rect.setLeft(m_leftMargin);
option.rect.setRight(wpWidth - m_rightMargin);
category->drawHeader(&painter, option);
y += category->totalHeight() + m_categoryMargin;
option.rect = backup;
}