From b58d508bff6c4458edef4e266b71d7f6d5c98dea Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Sat, 30 Nov 2019 11:17:50 +0100 Subject: [PATCH] qa/coccinelle: reformat struct-flags.py --- qa/coccinelle/struct-flags.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qa/coccinelle/struct-flags.py b/qa/coccinelle/struct-flags.py index 3a91157b4a..e7a3b63940 100755 --- a/qa/coccinelle/struct-flags.py +++ b/qa/coccinelle/struct-flags.py @@ -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;"