From 86a9deffbf085194b5a0b72c754234ed55dddc13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 20 Apr 2018 08:18:49 +0200 Subject: [PATCH] misc.py: removed bailouts --- addons/misc.py | 8 -------- addons/test/misc-test.cpp | 15 +-------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/addons/misc.py b/addons/misc.py index 4a19bb56a..33df09369 100644 --- a/addons/misc.py +++ b/addons/misc.py @@ -63,14 +63,6 @@ def stringConcatInArrayInit(rawTokens): elif tok1 == ']' and tok2 == '=' and tok3 == '{': arrayInit = True elif arrayInit and (tok1 in [',', '{']) and isStringLiteral(tok2) and isStringLiteral(tok3): - if tok1 == '{': - i2 = i + 1 - while i2 < len(rawTokens) and rawTokens[i2].str not in [',', '}']: - i2 = i2 + 1 - if i2 >= len(rawTokens) or rawTokens[i2].str != ',': - continue - if i + 2 < len(rawTokens) and isStringLiteral(rawTokens[i+1].str) and isStringLiteral(rawTokens[i+2].str): - continue reportError(rawTokens[i], 'style', 'String concatenation in array initialization, missing comma?', 'stringConcatInArrayInit') def implicitlyVirtual(data): diff --git a/addons/test/misc-test.cpp b/addons/test/misc-test.cpp index f0f2cef17..758c158d2 100644 --- a/addons/test/misc-test.cpp +++ b/addons/test/misc-test.cpp @@ -3,21 +3,8 @@ // Warn about string concatenation in array initializers.. -const char *a[] = {"a" "b"}; +const char *a[] = {"a" "b"}; // stringConcatInArrayInit const char *b[] = {"a","b" "c"}; // stringConcatInArrayInit -const char *c[] = { - "a\n" - "a\n" - "a\n" - "a\n" - "a\n" - , - "b\n" - "b\n" - "b\n" - "b\n" - "b\n" -}; // Function is implicitly virtual