aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2010-10-30 13:23:58 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2010-10-30 13:23:58 +0000
commit9dcabb82c9ab12679f7f8179b41ad7b9885a202b (patch)
tree225e0eb7511fe33aeb49834cedef2d7db29a124d
parent58da72c54e3658edc42bf3f187e7b6b3ee662fa0 (diff)
Make the hf_ checks errors (they've been running clean for a while now anyway).
svn path=/trunk/; revision=34711
-rwxr-xr-xtools/checkAPIs.pl35
1 files changed, 24 insertions, 11 deletions
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl
index 443221028b..18f7de2f5b 100755
--- a/tools/checkAPIs.pl
+++ b/tools/checkAPIs.pl
@@ -957,6 +957,7 @@ sub findAPIinFile($$$)
sub check_hf_entries($$)
{
my ($fileContentsRef, $filename) = @_;
+ my $errorCount = 0;
my @items;
@items = (${$fileContentsRef} =~ m{
@@ -990,34 +991,44 @@ sub check_hf_entries($$)
#print "name=$name, abbrev=$abbrev, ft=$ft, display=$display, convert=$convert, bitmask=$bitmask, blurb=$blurb\n";
if ($name eq $abbrev) {
- print STDERR "Warning: the abbreviation for field $name matches the field name in $filename\n";
+ print STDERR "Error: the abbreviation for field $name matches the field name in $filename\n";
+ $errorCount++;
}
if (lc($name) eq lc($blurb)) {
- print STDERR "Warning: the blurb for field $name ($abbrev) matches the field name in $filename\n";
+ print STDERR "Error: the blurb for field $name ($abbrev) matches the field name in $filename\n";
+ $errorCount++;
}
if ($name =~ m/"\s+/) {
- print STDERR "Warning: the name for field $name ($abbrev) has leading space in $filename\n";
+ print STDERR "Error: the name for field $name ($abbrev) has leading space in $filename\n";
+ $errorCount++;
}
if ($name =~ m/\s+"/) {
- print STDERR "Warning: the name for field $name ($abbrev) has trailing space in $filename\n";
+ print STDERR "Error: the name for field $name ($abbrev) has trailing space in $filename\n";
+ $errorCount++;
}
if ($blurb =~ m/"\s+/) {
- print STDERR "Warning: the blurb for field $name ($abbrev) has leading space in $filename\n";
+ print STDERR "Error: the blurb for field $name ($abbrev) has leading space in $filename\n";
+ $errorCount++;
}
if ($blurb =~ m/\s+"/) {
- print STDERR "Warning: the blurb for field $name ($abbrev) has trailing space in $filename\n";
+ print STDERR "Error: the blurb for field $name ($abbrev) has trailing space in $filename\n";
+ $errorCount++;
}
if ($abbrev =~ m/\s+/) {
- print STDERR "Warning: the abbreviation for field $name ($abbrev) has white space in $filename\n";
+ print STDERR "Error: the abbreviation for field $name ($abbrev) has white space in $filename\n";
+ $errorCount++;
}
if ("\"".$hf ."\"" eq $name) {
- print STDERR "Warning: name is the hf_variable_name in field $name ($abbrev) in $filename\n";
+ print STDERR "Error: name is the hf_variable_name in field $name ($abbrev) in $filename\n";
+ $errorCount++;
}
if ("\"".$hf ."\"" eq $abbrev) {
- print STDERR "Warning: abbreviation is the hf_variable_name in field $name ($abbrev) in $filename\n";
+ print STDERR "Error: abbreviation is the hf_variable_name in field $name ($abbrev) in $filename\n";
+ $errorCount++;
}
-
}
+
+ return $errorCount;
}
# The below Regexp are based on those from:
@@ -1141,7 +1152,9 @@ while ($_ = $ARGV[0])
}
# optionally check the hf entries
- check_hf_entries(\$fileContents, $filename) if $check_hf;
+ if ($check_hf) {
+ $errorCount += check_hf_entries(\$fileContents, $filename)
+ }
# Remove all the C-comments and strings
$fileContents =~ s {$commentAndStringRegex} []xog;