diff options
author | Jörg Mayer <jmayer@loplof.de> | 2010-10-31 09:05:11 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2010-10-31 09:05:11 +0000 |
commit | 462245ba9a64c08d33b762b21641f5470a28e678 (patch) | |
tree | d8b9fcd967779f659cae3bb0cddb8686db34d64f /tools/checkhf.pl | |
parent | e52c685b2a3a6ee5c53585fd9ddfd15635757bac (diff) |
Add a few comments and return with an error code if
appropriate, that way the whole stuff gets scriptable.
right now warnings are error code 0 (like completely
fine code).
svn path=/trunk/; revision=34730
Diffstat (limited to 'tools/checkhf.pl')
-rwxr-xr-x | tools/checkhf.pl | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tools/checkhf.pl b/tools/checkhf.pl index e2a086c2f1..fbcdc239d8 100755 --- a/tools/checkhf.pl +++ b/tools/checkhf.pl @@ -83,6 +83,8 @@ my $currfile = ""; my $comment = 0; my $brace = 0; +my $error = 0; + sub printprevfile { my $state; @@ -92,13 +94,20 @@ sub printprevfile { if ($state eq "s_usedarray") { # Everything is fine } elsif ($state eq "s_used") { - print "NO ARRAY: $currfile, $element\n" + # A value is declared and used but the hf_ array + # entry is missing + print "ERROR: NO ARRAY: $currfile, $element\n"; + $error = 1; } elsif ($state eq "s_array") { - print "Unused entry: $currfile, $element\n" + # A value is declared, has an hf_ array entry + # but it is never used + print "Unused entry: $currfile, $element\n"; } elsif ($state eq "s_declared") { + # A value is declared but no error value exists. + # This doesn't matter as it isn't used either. print "Declared only entry: $currfile, $element\n" } elsif ($state eq "s_unknown") { - print "UNKNOWN: $currfile, $element\n" + print "UNKNOWN: $currfile, $element\n"; } else { die "Impossible: State $state for $currfile, $element\n"; } @@ -224,6 +233,6 @@ while (<>) { } &printprevfile(); -exit 0; +exit $error; __END__ |