fix: use static_cast

This commit is contained in:
one
2026-03-02 09:35:04 +08:00
committed by Jakob P. Liljenberg
parent 2899c58118
commit 92cf853cdb

View File

@@ -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<long long>(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<long long>(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();