Lines Matching refs:line
62 'BANNEDPREPROC' => 'a banned symbol was used on a preprocessor line',
63 'BRACEELSE' => '} else on the same line',
72 'EMPTYLINEBRACE' => 'Empty line before the open brace',
80 'SPACEBEFORELABEL' => 'labels not at the start of the line',
84 'ONELINECONDITION' => 'conditional block on the same line as the if()',
98 'TRAILINGSPACE' => 'Trailing whitespace on the line',
145 die "Invalid format in $dir/.checksrc on line $i\n";
152 my ($name, $num, $col, $file, $line, $msg, $error) = @_;
162 if($skiplist{$line}) {
172 enable_warn($name, $num, $file, $line);
196 print " $line\n";
249 print " -m<n> Maximum line length. Default: 79\n";
308 my ($what, $line, $file, $l) = @_;
313 $line, length($what) + 11, $file, $l,
321 my ($cmd, $line, $file, $l) = @_;
346 $line, 0, $file, $l,
351 $line, 0, $file, $l,
352 "$warn already disabled from line $ignore_set{$warn}");
356 $ignore_set{$warn}=$line;
357 $ignore_line[$line]=$l;
361 enable_warn($what, $line, $file, $l);
365 $line, 0, $file, $l,
380 my $line = 1;
397 my $ol = $l; # keep the unmodified line for error reporting
403 checksrc($cmd, $line, $file, $l)
406 if($l =~ /^#line (\d+) \"([^\"]*)\"/) {
407 # a #line instruction
409 $line = $1;
419 line => $line,
429 line => $line,
438 checkwarn("LONGLINE", $line, length($l), $file, $l,
444 $line, length($1), $file, $l, "Contains TAB character", 1);
449 $line, length($1), $file, $l, "Trailing whitespace");
455 $line, length($1) + 2, $file, $l,
461 $line, length($1) + 1, $file, $l,
498 # prev line was a preprocessor **and** ended with a backslash
500 # this is still a preprocessor line
510 $line, length($1), $file, $l, "\/\/ comment");
517 $line, length($1), $file, $l, "duplicated include");
524 # preprocessor line
550 checkwarn("SPACEBEFOREPAREN", $line, length($leading)+length($word), $file, $l,
557 checkwarn("EQUALSNULL", $line,
565 checkwarn("NOTEQUALSZERO", $line,
572 checkwarn("DOBRACE", $line, length($1) + 2, $file, $l, "one space after do before brace");
576 checkwarn("BRACEWHILE", $line, length($1) + 2, $file, $l, "one space between brace and while");
584 $line, $pos+1, $file, $l,
602 $line, length($l)-length($postparen), $file, $l,
603 "conditional block on the same line");
609 $line, length($1)+1, $file, $l,
617 $line, length($1)+1, $file, $l,
624 $line, length($1)+1, $file, $l,
634 checkwarn("RETURNNOSPACE", $line, length($1)+6, $file, $l,
645 checkwarn("SIZEOFNOPAREN", $line, length($1)+6, $file, $l,
677 checkwarn("COMMANOSPACE", $line, length($pref)+1, $file, $l,
685 $line, length($1), $file, $l, "else after closing brace on same line");
690 $line, length($1)+1, $file, $l, "missing space after close paren");
692 # check for "^{" with an empty line before it
695 $line, 0, $file, $l, "empty line before open brace");
698 # check for space before the semicolon last in a line
701 $line, length($1), $file, $ol, "no space before semicolon");
707 $line, length($1), $file, $ol, "no space before colon of switch label");
712 $line, length($1), $file, $ol, "no space before label");
726 $line, length($1), $file, $ol,
736 $line, length($1), $file, $ol,
748 $line, length($1), $file, $ol,
756 $line, length($1), $file, $ol,
765 $line, length($1), $file, $ol,
770 # check for open brace first on line but not first column only alert
771 # if previous line ended with a close paren and it wasn't a cpp line
774 $line, length($1), $file, $ol, "badly placed open brace");
777 # if the previous line starts with if/while/for AND ends with an open
778 # brace, or an else statement, check that this line is indented $indent
779 # more steps, if not a cpp line
782 # this line has some character besides spaces
788 checkwarn("INDENTATION", $line, length($1), $file, $ol,
795 # if the previous line starts with if/while/for AND ends with a closed
797 # parentheses, check that this line is indented $indent more steps, if
798 # not a cpp line
808 # this line has some character besides spaces
814 checkwarn("INDENTATION", $line, length($1), $file, $ol,
824 $line, length($1), $file, $ol,
830 $line, length($1)-1, $file, $ol,
842 $line, length($l)-1, $file, $ol,
850 $line, length($1)+1, $file, $ol,
856 $line, length($1)+1, $file, $ol,
863 $line, length($1)+1, $file, $ol,
869 $line, length($1)+1, $file, $ol,
876 $line, length($1)+1, $file, $ol,
883 $line, length($1)+1, $file, $ol,
889 $line, length($1)+1, $file, $ol,
899 $line, length($1)+1, $file, $ol,
904 # scan for use of banned symbols on a preprocessor line
910 $line, length($1), $file, $ol,
915 $line++;
962 checkwarn("COPYRIGHTYEAR", $copyright[0]{line}, $copyright[0]{col},