History

checkpatch: improve "no space after cast" test

This --strict test previously worked only for what appeared to be cast to pointer types. Make it work for all casts. Also, there's no reason to show the previous line for this type of message, so don't.

Joe Perches committed 12 years ago

Commit f27c95d1 parent 1574a291 file · +3 −3Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+3−3
@@ -2260,12 +2260,12 @@ sub process { · 2259 unmodified lines
2260 }2260 }
2261 }2261 }
2262 2262
2263 if ($line =~ /^\+.*\*[ \t]*\)[ \t]+(?!$Assignment|$Arithmetic)/) {2263 if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic)/) {
2264 if (CHK("SPACING",2264 if (CHK("SPACING",
2265 "No space is necessary after a cast\n" . $hereprev) &&2265 "No space is necessary after a cast\n" . $herecurr) &&
2266 $fix) {2266 $fix) {
2267 $fixed[$linenr - 1] =~2267 $fixed[$linenr - 1] =~
2268 s/^(\+.*\*[ \t]*\))[ \t]+/$1/;2268 s/(\(\s*$Type\s*\))[ \t]+/$1/;
2269 }2269 }
2270 }2270 }
2271 2271

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t