From 85892a9fe3968b9c72806eb0cb030cf77bd1e3e4 Mon Sep 17 00:00:00 2001 From: aristocratos Date: Mon, 5 Jun 2023 21:59:26 +0200 Subject: [PATCH] Fix type: ulong -> size_t and compare std::cmp_less --- src/btop_draw.cpp | 2 +- src/linux/btop_collect.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/btop_draw.cpp b/src/btop_draw.cpp index da06b43..9ebd40c 100644 --- a/src/btop_draw.cpp +++ b/src/btop_draw.cpp @@ -612,7 +612,7 @@ namespace Cpu { graphs.resize(1); graph_width = graph_default_width; graphs[0] = Draw::Graph{ graph_width, graph_height, "cpu", cpu.cpu_percent.at(graph_field), graph_symbol, invert, true }; - if ((ulong)Gpu::shown < gpus.size()) { + if (std::cmp_less(Gpu::shown, gpus.size())) { gpu_temp_graphs.resize(gpus.size()); gpu_mem_graphs.resize(gpus.size()); gpu_meters.resize(gpus.size()); diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp index 2e85aad..d9ef56b 100644 --- a/src/linux/btop_collect.cpp +++ b/src/linux/btop_collect.cpp @@ -253,7 +253,7 @@ namespace Shared { using namespace Gpu; gpu_b_height_offsets.resize(gpus.size()); - for (ulong i = 0; i < gpu_b_height_offsets.size(); ++i) + for (size_t i = 0; i < gpu_b_height_offsets.size(); ++i) gpu_b_height_offsets[i] = gpus[i].supported_functions.gpu_utilization + gpus[i].supported_functions.pwr_usage + (gpus[i].supported_functions.mem_total or gpus[i].supported_functions.mem_used)