From 462245ba9a64c08d33b762b21641f5470a28e678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Mayer?= Date: Sun, 31 Oct 2010 09:05:11 +0000 Subject: 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 --- tools/checkhf.pl | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'tools/checkhf.pl') 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__ -- cgit v1.2.3