]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: use bool for uint16_t used as bool
authorVictor Julien <vjulien@oisf.net>
Tue, 30 Nov 2021 12:35:48 +0000 (13:35 +0100)
committerVictor Julien <vjulien@oisf.net>
Wed, 27 Apr 2022 09:08:58 +0000 (11:08 +0200)
(cherry picked from commit bb3d49d5bf6376756e124a79b4f25799d934617c)

src/detect.c
src/detect.h

index 3a5c7c6a630a26e4e0387f22cf729731710601b7..49ea27a81440bc89df01a8ce28ec08f98a6c4db8 100644 (file)
@@ -1419,7 +1419,7 @@ static void DetectRunTx(ThreadVars *tv,
         }
 
         det_ctx->tx_id = tx.tx_id;
-        det_ctx->tx_id_set = 1;
+        det_ctx->tx_id_set = true;
         det_ctx->p = p;
 
         /* run rules: inspect the match candidates */
@@ -1487,7 +1487,7 @@ static void DetectRunTx(ThreadVars *tv,
         }
 
         det_ctx->tx_id = 0;
-        det_ctx->tx_id_set = 0;
+        det_ctx->tx_id_set = false;
         det_ctx->p = NULL;
 
         /* see if we have any updated state to store in the tx */
index ed5daa38616d1c4e72968ca8188b97680bbd02ae..209e9036c3d35a28e65deb18d2bda40986fdda97 100644 (file)
@@ -1082,8 +1082,8 @@ typedef struct DetectEngineThreadCtx_ {
     uint16_t discontinue_matching;
     uint16_t flags;
 
-    /* bool: if tx_id is set, this is 1, otherwise 0 */
-    uint16_t tx_id_set;
+    /* true if tx_id is set */
+    bool tx_id_set;
     /** ID of the transaction currently being inspected. */
     uint64_t tx_id;
     Packet *p;