# HG changeset patch # User Matt Mackall # Date 2013-09-17 23:13:54 # Node ID 436a3f728375d9b64de4c76f1ed8db58ba0f3fcc # Parent d184bae667e41d953648aa3c2641a3608c27f45a check-code: make casting style check more precise diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -288,7 +288,7 @@ cpats = [ (r'return\(', "return is not a function"), (r' ;', "no space before ;"), (r'\w+\* \w+', "use int *foo, not int* foo"), - (r'\([^\)]+\) \w+', "use (int)foo, not (int) foo"), + (r'\W\([^\)]+\) \w+', "use (int)foo, not (int) foo"), (r'\w+ (\+\+|--)', "use foo++, not foo ++"), (r'\w,\w', "missing whitespace after ,"), (r'^[^#]\w[+/*]\w', "missing whitespace in expression"),