From: Shivani Bhardwaj Date: Tue, 21 May 2024 11:44:34 +0000 (+0530) Subject: flow: minor loop cleanups X-Git-Tag: suricata-8.0.0-beta1~1292 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bd9f88ecdc1746ba71ef157cb05910d15902fe6;p=thirdparty%2Fsuricata.git flow: minor loop cleanups --- diff --git a/src/flow-hash.c b/src/flow-hash.c index c5063f7d37..59aad096b8 100644 --- a/src/flow-hash.c +++ b/src/flow-hash.c @@ -73,7 +73,7 @@ static Flow *FlowGetUsedFlow(ThreadVars *tv, DecodeThreadVars *dtv, const SCTime */ static inline int FlowHashRawAddressIPv6GtU32(const uint32_t *a, const uint32_t *b) { - for (int i = 0; i < 4; i++) { + for (uint8_t i = 0; i < 4; i++) { if (a[i] > b[i]) return 1; if (a[i] < b[i]) diff --git a/src/flow.c b/src/flow.c index a088b4d770..f402733d94 100644 --- a/src/flow.c +++ b/src/flow.c @@ -1013,7 +1013,7 @@ void FlowInitFlowProto(void) } /* validate and if needed update emergency timeout values */ - for (int i = 0; i < FLOW_PROTO_MAX; i++) { + for (uint8_t i = 0; i < FLOW_PROTO_MAX; i++) { const FlowProtoTimeout *n = &flow_timeouts_normal[i]; FlowProtoTimeout *e = &flow_timeouts_emerg[i]; @@ -1046,7 +1046,7 @@ void FlowInitFlowProto(void) } } - for (int i = 0; i < FLOW_PROTO_MAX; i++) { + for (uint8_t i = 0; i < FLOW_PROTO_MAX; i++) { FlowProtoTimeout *n = &flow_timeouts_normal[i]; FlowProtoTimeout *e = &flow_timeouts_emerg[i]; FlowProtoTimeout *d = &flow_timeouts_delta[i];