From: Philippe Antoine Date: Tue, 25 Jun 2024 07:39:18 +0000 (+0200) Subject: flow: fix -Wshorten-64-to-32 warnings X-Git-Tag: suricata-8.0.0-beta1~1033 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eeb290384a0e99735ab93da7d902980da492e33f;p=thirdparty%2Fsuricata.git flow: fix -Wshorten-64-to-32 warnings Ticket: #6186 --- diff --git a/src/flow-manager.c b/src/flow-manager.c index de55ed136f..bc688ed43f 100644 --- a/src/flow-manager.c +++ b/src/flow-manager.c @@ -422,7 +422,7 @@ static uint32_t FlowTimeoutHash(FlowManagerTimeoutThread *td, SCTime_t ts, const #define TYPE uint32_t #endif - const uint32_t ts_secs = SCTIME_SECS(ts); + const uint32_t ts_secs = (uint32_t)SCTIME_SECS(ts); for (uint32_t idx = hash_min; idx < hash_max; idx+=BITS) { TYPE check_bits = 0; const uint32_t check = MIN(BITS, (hash_max - idx)); @@ -948,8 +948,8 @@ static TmEcode FlowManager(ThreadVars *th_v, void *thread_data) struct timeval cond_tv; gettimeofday(&cond_tv, NULL); struct timeval add_tv; - add_tv.tv_sec = 0; - add_tv.tv_usec = (sleep_per_wu * 1000); + add_tv.tv_sec = sleep_per_wu / 1000; + add_tv.tv_usec = (sleep_per_wu % 1000) * 1000; timeradd(&cond_tv, &add_tv, &cond_tv); struct timespec cond_time = FROM_TIMEVAL(cond_tv);