From 7bd9f88ecdc1746ba71ef157cb05910d15902fe6 Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Tue, 21 May 2024 17:14:34 +0530 Subject: [PATCH] flow: minor loop cleanups --- src/flow-hash.c | 2 +- src/flow.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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]; -- 2.47.2