From b5140c43ca3999ef8720c895da7962c34620b6a0 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Tue, 25 Jun 2024 09:34:08 +0200 Subject: [PATCH] counters: fix -Wshorten-64-to-32 warnings Ticket: #6186 --- src/counters.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/counters.c b/src/counters.c index f6014d096c..7d141efb01 100644 --- a/src/counters.c +++ b/src/counters.c @@ -1040,9 +1040,9 @@ static uint32_t CountersIdHashFunc(HashTable *ht, void *data, uint16_t datalen) { CountersIdType *t = (CountersIdType *)data; uint32_t hash = 0; - int len = strlen(t->string); + size_t len = strlen(t->string); - for (int i = 0; i < len; i++) + for (size_t i = 0; i < len; i++) hash += u8_tolower((unsigned char)t->string[i]); hash = hash % ht->array_size; @@ -1054,8 +1054,8 @@ static char CountersIdHashCompareFunc(void *data1, uint16_t datalen1, { CountersIdType *t1 = (CountersIdType *)data1; CountersIdType *t2 = (CountersIdType *)data2; - int len1 = 0; - int len2 = 0; + size_t len1 = 0; + size_t len2 = 0; if (t1 == NULL || t2 == NULL) return 0; -- 2.47.2