From: Philippe Antoine Date: Tue, 25 Jun 2024 07:35:15 +0000 (+0200) Subject: features: fix -Wshorten-64-to-32 warnings X-Git-Tag: suricata-8.0.0-beta1~1034 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c0875b2a493c493812636c24c63be67d6cae825;p=thirdparty%2Fsuricata.git features: fix -Wshorten-64-to-32 warnings Ticket: #6186 --- diff --git a/src/feature.c b/src/feature.c index 0edf9433ac..1c8de4e94c 100644 --- a/src/feature.c +++ b/src/feature.c @@ -42,9 +42,9 @@ static uint32_t FeatureHashFunc(HashListTable *ht, void *data, { FeatureEntryType *f = (FeatureEntryType *)data; uint32_t hash = 0; - int len = strlen(f->feature); + size_t len = strlen(f->feature); - for (int i = 0; i < len; i++) + for (size_t i = 0; i < len; i++) hash += u8_tolower((unsigned char)f->feature[i]); return (hash % ht->array_size); @@ -55,8 +55,8 @@ static char FeatureHashCompareFunc(void *data1, uint16_t datalen1, { FeatureEntryType *f1 = (FeatureEntryType *)data1; FeatureEntryType *f2 = (FeatureEntryType *)data2; - int len1 = 0; - int len2 = 0; + size_t len1 = 0; + size_t len2 = 0; if (f1 == NULL || f2 == NULL) return 0;