aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-07-19 07:02:00 +0000
committerGuy Harris <guy@alum.mit.edu>2012-07-19 07:02:00 +0000
commit41be8e4344cb6f8b7db491a954b9f083b9ebd69e (patch)
treeb71539dffc08fd1ef3c85603cdc53be79fe14739 /tools
parent66ed910844d9d2da3b6b46d67c2e27f19322a7dd (diff)
Add a local errorCount variable to functions that use it, have them
return it, and use the return value. svn path=/trunk/; revision=43818
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checkAPIs.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl
index debf364984..0f50ca7517 100755
--- a/tools/checkAPIs.pl
+++ b/tools/checkAPIs.pl
@@ -1414,6 +1414,7 @@ sub check_proto_tree_add_XXX_encoding($$)
{
my ($fileContentsRef, $filename) = @_;
my @items;
+ my $errorCount = 0;
@items = (${$fileContentsRef} =~ m/ (proto_tree_add_[_a-z0-9]+) \( ([^;]*) \) \s* ; /xsg);
@@ -1442,6 +1443,8 @@ sub check_proto_tree_add_XXX_encoding($$)
}
}
}
+
+ return $errorCount;
}
@@ -1453,6 +1456,7 @@ sub check_ett_registration($$)
my @ett_declarations;
my %ett_registrations;
my @unRegisteredEtts;
+ my $errorCount = 0;
# A pattern to match ett variable names. Obviously this assumes that
# they start with ett_
@@ -1542,6 +1546,7 @@ sub check_ett_registration($$)
$errorCount++;
}
+ return $errorCount;
}
# Given the file contents and a file name, check all of the hf entries for
@@ -1785,7 +1790,7 @@ while ($_ = $ARGV[0])
# Remove all the C-comments and strings
$fileContents =~ s {$commentAndStringRegex} []xog;
- #check_ett_registration(\$fileContents, $filename);
+ #$errorCount += check_ett_registration(\$fileContents, $filename);
if ($fileContents =~ m{ // }xo)
{
@@ -1804,7 +1809,7 @@ while ($_ = $ARGV[0])
checkAddTextCalls(\$fileContents, $filename);
}
- check_proto_tree_add_XXX_encoding(\$fileContents, $filename);
+ $errorCount += check_proto_tree_add_XXX_encoding(\$fileContents, $filename);
# Brute force check for value_string arrays which are missing {0, NULL} as the final (terminating) array entry
if ($check_value_string_array_null_termination) {