From 56d7622902c2eed2f9f3a86591881ad3cf96f73b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sat, 6 Apr 2024 20:30:22 +0200 Subject: Use uppercase floating point literals --- linux/GPU.c | 6 +++--- linux/LibNl.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'linux') diff --git a/linux/GPU.c b/linux/GPU.c index 37d5d7c4..a4af9207 100644 --- a/linux/GPU.c +++ b/linux/GPU.c @@ -87,7 +87,7 @@ void GPU_readProcessData(LinuxProcessTable* lpt, LinuxProcess* lp, openat_arg_t /* check only if active in last check or last scan was more than 5s ago */ if (lp->gpu_activityMs != 0 && host->monotonicMs - lp->gpu_activityMs < 5000) { - lp->gpu_percent = 0.0f; + lp->gpu_percent = 0.0F; return; } lp->gpu_activityMs = host->monotonicMs; @@ -222,11 +222,11 @@ void GPU_readProcessData(LinuxProcessTable* lpt, LinuxProcess* lp, openat_arg_t gputimeDelta = saturatingSub(new_gpu_time, lp->gpu_time); monotonicTimeDelta = host->monotonicMs - host->prevMonotonicMs; - lp->gpu_percent = 100.0f * gputimeDelta / (1000 * 1000) / monotonicTimeDelta; + lp->gpu_percent = 100.0F * gputimeDelta / (1000 * 1000) / monotonicTimeDelta; lp->gpu_activityMs = 0; } else - lp->gpu_percent = 0.0f; + lp->gpu_percent = 0.0F; out: diff --git a/linux/LibNl.c b/linux/LibNl.c index a256ede2..ba1359f2 100644 --- a/linux/LibNl.c +++ b/linux/LibNl.c @@ -179,7 +179,7 @@ static int handleNetlinkMsg(struct nl_msg* nlmsg, void* linuxProcess) { // The xxx_delay_total values wrap around on overflow. // (Linux Kernel "Documentation/accounting/taskstats-struct.rst") unsigned long long int timeDelta = stats.ac_etime * 1000 - lp->delay_read_time; - #define DELTAPERC(x, y) (timeDelta ? MINIMUM((float)((x) - (y)) / timeDelta * 100.0f, 100.0f) : NAN) + #define DELTAPERC(x, y) (timeDelta ? MINIMUM((float)((x) - (y)) / timeDelta * 100.0F, 100.0F) : NAN) lp->cpu_delay_percent = DELTAPERC(stats.cpu_delay_total, lp->cpu_delay_total); lp->blkio_delay_percent = DELTAPERC(stats.blkio_delay_total, lp->blkio_delay_total); lp->swapin_delay_percent = DELTAPERC(stats.swapin_delay_total, lp->swapin_delay_total); -- cgit v1.2.3