stylecheck: fix deprecation warnings for newer perl
Simply escape the { chars as directed.
This commit is contained in:
parent
c94a58e844
commit
2db3d290e7
@ -2456,8 +2456,8 @@ sub process {
|
||||
|
||||
# function brace can't be on same line, except for #defines of do while,
|
||||
# or if closed on same line
|
||||
if (($line=~/$Type\s*$Ident\(.*\).*\s{/) and
|
||||
!($line=~/\#\s*define.*do\s{/) and !($line=~/}/)) {
|
||||
if (($line=~/$Type\s*$Ident\(.*\).*\s\{/) and
|
||||
!($line=~/\#\s*define.*do\s\{/) and !($line=~/}/)) {
|
||||
ERROR("OPEN_BRACE",
|
||||
"open brace '{' following function declarations go on the next line\n" . $herecurr);
|
||||
}
|
||||
@ -2732,15 +2732,15 @@ sub process {
|
||||
## }
|
||||
|
||||
#need space before brace following if, while, etc
|
||||
if (($line =~ /\(.*\){/ && $line !~ /\($Type\){/) ||
|
||||
$line =~ /do{/) {
|
||||
if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\)\{/) ||
|
||||
$line =~ /do\{/) {
|
||||
ERROR("SPACING",
|
||||
"space required before the open brace '{'\n" . $herecurr);
|
||||
}
|
||||
|
||||
# closing brace should have a space following it when it has anything
|
||||
# on the line
|
||||
if ($line =~ /}(?!(?:,|;|\)))\S/) {
|
||||
if ($line =~ /\}(?!(?:,|;|\)))\S/) {
|
||||
ERROR("SPACING",
|
||||
"space required after that close brace '}'\n" . $herecurr);
|
||||
}
|
||||
@ -3031,8 +3031,8 @@ sub process {
|
||||
$dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ && # do {...} while (...); // do {...} while (...)
|
||||
$dstat !~ /^for\s*$Constant$/ && # for (...)
|
||||
$dstat !~ /^for\s*$Constant\s+(?:$Ident|-?$Constant)$/ && # for (...) bar()
|
||||
$dstat !~ /^do\s*{/ && # do {...
|
||||
$dstat !~ /^\({/) # ({...
|
||||
$dstat !~ /^do\s*\{/ && # do {...
|
||||
$dstat !~ /^\(\{/) # ({...
|
||||
{
|
||||
$ctx =~ s/\n*$//;
|
||||
my $herectx = $here . "\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user