From ccb756d3c702cd80443fee2215e51c13a69c0fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sun, 22 Aug 2021 17:10:40 +0200 Subject: [PATCH] Widen integer type before multiplication Meter.c:320:71: warning: performing an implicit widening conversion to type '__suseconds_t' (aka 'long') of a multiplication performed in type 'int' [bugprone-implicit- widening-of-multiplication-result] struct timeval delay = { .tv_sec = globalDelay / 10, .tv_usec = (globalDelay - ((globalDelay / 10) * 10)) * 100000 }; ^ --- Meter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Meter.c b/Meter.c index 917d5904..a050dfac 100644 --- a/Meter.c +++ b/Meter.c @@ -317,7 +317,7 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) { if (!timercmp(&pl->realtime, &(data->time), <)) { int globalDelay = this->pl->settings->delay; - struct timeval delay = { .tv_sec = globalDelay / 10, .tv_usec = (globalDelay - ((globalDelay / 10) * 10)) * 100000 }; + struct timeval delay = { .tv_sec = globalDelay / 10, .tv_usec = (globalDelay - ((globalDelay / 10) * 10)) * 100000L }; timeradd(&pl->realtime, &delay, &(data->time)); for (int i = 0; i < nValues - 1; i++)