build: Fix cppcheck issues

This commit is contained in:
WerWolv
2025-07-10 13:57:08 +02:00
parent e58ce527c6
commit da2aa85a8a
40 changed files with 87 additions and 230 deletions

View File

@@ -30,7 +30,7 @@ namespace hex::plugin::builtin {
if (ImGui::BeginListBox("##files", { -FLT_MIN, 10 * ImGui::GetTextLineHeightWithSpacing() })) {
u32 index = 0;
for (auto &file : files) {
for (const auto &file : files) {
if (ImGui::Selectable(wolv::util::toUTF8String(file).c_str(), index == selectedIndex))
selectedIndex = index;
index++;
@@ -41,7 +41,7 @@ namespace hex::plugin::builtin {
ImGui::TableNextColumn();
ImGui::BeginDisabled(selectedIndex <= 0);
ImGui::BeginDisabled(selectedIndex == 0);
{
if (ImGui::ArrowButton("move_up", ImGuiDir_Up)) {
std::iter_swap(files.begin() + selectedIndex, files.begin() + selectedIndex - 1);