In check_cast, we want to match cast operators with or without spaces
after the closing paren, and then check for spaces after we match.
Also, per the comment, we want to match potential cast operators
followed by an open paren.
# multiplication operator. We will get false positives from
# "(*fp) (args)" and "if (condition) statement", but both of those
# are erroneous anyway.
- for m in re.finditer(r'\(([^(]+)\)(\s+)[a-zA-Z_]', line):
+ for m in re.finditer(r'\(([^(]+)\)(\s*)[a-zA-Z_(]', line):
if m.group(2):
warn(ln, 'Space after cast operator (or inline if/while body)')
# Check for casts like (char*) which should have a space.