]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
qa/coccinelle: reformat struct-flags.py
authorEric Leblond <eric@regit.org>
Sat, 30 Nov 2019 10:17:50 +0000 (11:17 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 5 Dec 2019 12:40:02 +0000 (13:40 +0100)
qa/coccinelle/struct-flags.py

index 3a91157b4a0a4dc45bf338c515be8da71ef746e9..e7a3b63940db26a8d2c2a72478ecb54fd46d9ef3 100755 (executable)
@@ -2,12 +2,14 @@
 import re
 from os import listdir
 
-SRC_DIR="../../src/"
+SRC_DIR = "../../src/"
+
 
 class Structure:
     def __init__(self, string):
         (self.struct, self.flags, self.values) = string.split(":")
 
+
 cmd = "grep -h coccinelle ../../src/*[ch] | sed -e 's/.*coccinelle: \(.*\) \*\//\1/'"
 
 struct_list = []
@@ -28,7 +30,7 @@ i = 0
 for struct in struct_list:
     header += """
 %s *struct%d;
-identifier struct_flags%d =~ "^(?!%s).+";""" % ( struct.struct, i, i, struct.values)
+identifier struct_flags%d =~ "^(?!%s).+";""" % (struct.struct, i, i, struct.values)
 
     body.append("""
 struct%d->%s@p1 |= struct_flags%d
@@ -38,7 +40,7 @@ struct%d->%s@p1 & struct_flags%d
 struct%d->%s@p1 &= ~struct_flags%d
 """ % (i, struct.flags, i, i, struct.flags, i, i, struct.flags, i))
 
-    i+=1
+    i += 1
 
 print header
 print "position p1;"