From 92cf853cdb6955a1e9a366a8f3217dcbb931d1fc Mon Sep 17 00:00:00 2001 From: one Date: Mon, 2 Mar 2026 09:35:04 +0800 Subject: [PATCH] fix: use static_cast --- src/linux/btop_collect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp index ce98ecb7..e7c360a5 100644 --- a/src/linux/btop_collect.cpp +++ b/src/linux/btop_collect.cpp @@ -2036,9 +2036,9 @@ namespace Gpu { shared_gpu_percent.at("gpu-average").push_back(avg / gpus.size()); if (mem_total != 0) - shared_gpu_percent.at("gpu-vram-total").push_back((long long)round((double)mem_usage_total * 100.0 / (double)mem_total)); + shared_gpu_percent.at("gpu-vram-total").push_back(static_cast(round(mem_usage_total * 100.0 / mem_total))); if (gpu_pwr_total_max != 0) - shared_gpu_percent.at("gpu-pwr-total").push_back(clamp((long long)round((double)pwr_total * 100.0 / (double)gpu_pwr_total_max), 0ll, 100ll)); + shared_gpu_percent.at("gpu-pwr-total").push_back(clamp(static_cast(round(pwr_total * 100.0 / gpu_pwr_total_max)), 0ll, 100ll)); if (width != 0) { while (cmp_greater(shared_gpu_percent.at("gpu-average").size(), width * 2)) shared_gpu_percent.at("gpu-average").pop_front();