summaryrefslogtreecommitdiff
path: root/tools/checkhf.pl
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2010-10-29 15:15:26 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2010-10-29 15:15:26 +0000
commit53ba99cd9b766449866f3bc20ab674fc79a216be (patch)
tree495cf5ba8a0fb14896cc1045e3f604174fb8e83b /tools/checkhf.pl
parent3971cb5d13071fce6b95ea40f6d4ea518d01702b (diff)
downloadwireshark-53ba99cd9b766449866f3bc20ab674fc79a216be.tar.gz
Say that an hf_ variable is used if we find "variable = hf_variable".
Add some debug statements. Tweak one regexp to catch more hf_ variable uses. svn path=/trunk/; revision=34684
Diffstat (limited to 'tools/checkhf.pl')
-rwxr-xr-xtools/checkhf.pl16
1 files changed, 15 insertions, 1 deletions
diff --git a/tools/checkhf.pl b/tools/checkhf.pl
index 74ad9e2e32..e2a086c2f1 100755
--- a/tools/checkhf.pl
+++ b/tools/checkhf.pl
@@ -145,6 +145,7 @@ while (<>) {
# Read input
if (/static\s+.*int\s+(hf_\w*)\s*=\s*-1\s*;/) {
$element = $1;
+ $debug && print "t_declaration for $element$D\n";
$type = "t_declaration";
# ignore: declarations without any use are detected by the compiler
next;
@@ -164,14 +165,26 @@ while (<>) {
next;
} elsif ($brace == 1 && /^\s*&\s*(hf_\w*)\W+/) {
$element = $1;
+ $debug && print "t_array1 for $element$D\n";
$type = "t_array";
} elsif (/^\s*\{\s*?&\s*?(hf_\w*)\W+/) {
$element = $1;
+ $debug && print "t_array2 for $element$D\n";
$type = "t_array";
# Order matters: catch all remaining hf_ lines
- } elsif (/\W(hf_\w*)\W/) {
+ } elsif (/\w*\s*=\s*(hf_\w*)\s*;/) {
+ # Catches: variable = hf_*
+ # But we don't check if the variable actually gets used...
$element = $1;
+ $debug && print "in variable usage for $element$D\n";
next if ($skip{$element});
+ $debug && print "set t_usage for $element$D\n";
+ $type = "t_usage";
+ } elsif (/\W(hf_\w*)\W*/) {
+ $element = $1;
+ $debug && print "in usage for $element$D\n";
+ next if ($skip{$element});
+ $debug && print "set t_usage for $element$D\n";
$type = "t_usage";
} else {
# Line with only a {
@@ -179,6 +192,7 @@ while (<>) {
$brace = 1;
} else {
$brace = 0;
+ $debug && print "else: $D\n";
}
next;
}