From 3c6128ee266024d164650955f93c7740484abd68 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sun, 28 Jun 2015 06:09:44 -0700 Subject: cleanup: modify unknown lines and append FIXMEs Affects 13 dissectors. --- one-off/cleanup-rewrite.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'one-off') diff --git a/one-off/cleanup-rewrite.py b/one-off/cleanup-rewrite.py index 6853bbe..608109c 100755 --- a/one-off/cleanup-rewrite.py +++ b/one-off/cleanup-rewrite.py @@ -45,6 +45,10 @@ import sys, re, logging _logger = logging.getLogger(__name__) +# Set to True to allow more code to be modified. +# Unknown lines will be suffixed with a " // FIXME" comment. +AUDIT = False + # For quick sanity checking (funcName, is_prototype) RE_FUNCTION_HEADER = re.compile( r''' @@ -175,7 +179,10 @@ class Function(object): handled = True if not handled: - self.unknown_lines += line + if AUDIT: + self.lines_keep += line.replace('\n', ' // FIXME\n') + else: + self.unknown_lines += line if self.unknown_lines: _logger.error('Unknown lines in %s:\n%s', -- cgit v1.2.1