From: Victor Julien Date: Wed, 24 Apr 2024 07:39:07 +0000 (+0200) Subject: rohash: minor code cleanups X-Git-Tag: suricata-8.0.0-beta1~1415 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea110aca5b9520b40408c83fd533ccacdbab1ac9;p=thirdparty%2Fsuricata.git rohash: minor code cleanups --- diff --git a/src/util-rohash.c b/src/util-rohash.c index 5343743029..35c4e151ea 100644 --- a/src/util-rohash.c +++ b/src/util-rohash.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2007-2012 Open Information Security Foundation +/* Copyright (C) 2007-2024 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free @@ -127,8 +127,7 @@ void *ROHashLookup(ROHashTable *table, void *data, uint16_t size) SCReturnPtr(NULL, "void"); } - uint32_t u; - for (u = 0; u < o->cnt; u++) { + for (uint32_t u = 0; u < o->cnt; u++) { uint32_t offset = (o->offset + u) * table->item_size; if (SCMemcmp(table->data + offset, data, table->item_size) == 0) { @@ -214,8 +213,7 @@ int ROHashInitFinalize(ROHashTable *table) /* calc offsets into the block per hash value */ uint32_t total = 0; - uint32_t x; - for (x = 0; x < hashsize(table->hash_bits); x++) { + for (uint32_t x = 0; x < hashsize(table->hash_bits); x++) { ROHashTableOffsets *o = &os[x]; if (o->cnt == 0)