From 81fca6d4550f635d4846f13cb504d4cb05e3ef59 Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Wed, 6 Oct 2010 17:33:35 +0100 Subject: [PATCH] Style: disable removal of "gratuitous" blocks. This rule removed any {} which were around a single statment, but this removal broke any .h file with short inline function definitions (such as a "getFoo() { return foo; }"). The templates in flower/include/std-vector.hh were hit particularly hard by this rule. --- scripts/auxiliar/fixcc.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/auxiliar/fixcc.py b/scripts/auxiliar/fixcc.py index b77982e2c6..4f74ab94bb 100755 --- a/scripts/auxiliar/fixcc.py +++ b/scripts/auxiliar/fixcc.py @@ -46,9 +46,9 @@ indent_p = 0 rules = { GLOBAL_CXX: [ - # delete gratuitous block - ('''\n( |\t)\s*{\n\s*(.*?)(?![{}]|\b(do|for|else|if|switch|while)\b);\n\s*}''', - '\n\\2;'), + # delete gratuitous block -- disabled because it breaks .h files +# ('''\n( |\t)\s*{\n\s*(.*?)(?![{}]|\b(do|for|else|if|switch|while)\b);\n\s*}''', +# '\n\\2;'), ], CXX: [ @@ -56,9 +56,9 @@ rules = { ('([^\( \]])[ \t]*\(', '\\1 ('), # space after comma ("\([^'],\)[ \t]*", '\1 '), - # delete gratuitous block - ('''\n( |\t)\s*{\n\s*(.*?)(?![{}]|\b(do|for|else|if|switch|while)\b);\n\s*}''', - '\n\\2;'), + # delete gratuitous block -- disabled because it breaks .h files +# ('''\n( |\t)\s*{\n\s*(.*?)(?![{}]|\b(do|for|else|if|switch|while)\b);\n\s*}''', +# '\n\\2;'), # delete inline tabs ('(\w)\t+', '\\1 '), # delete inline double spaces -- 2.39.5