diff options
author | Bill Meier <wmeier@newsguy.com> | 2013-01-25 20:12:09 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2013-01-25 20:12:09 +0000 |
commit | be4c8badd8f6e6e43b63249b9010c0c368218080 (patch) | |
tree | 411c040e2420f7f1b3b219bff01b42640baba417 /tools/checkhf.pl | |
parent | 703263901be8c77a65a4d6fab899a5841bfaee15 (diff) |
Handle hf_... definitions which are not static;
For .../dissectors/(non-generated dissectors):
Reduces the number of "unused" false positives (and
adds about 2 different false positives).
svn path=/trunk/; revision=47280
Diffstat (limited to 'tools/checkhf.pl')
-rwxr-xr-x | tools/checkhf.pl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/checkhf.pl b/tools/checkhf.pl index 2bef98805a..e9bde6ddfd 100755 --- a/tools/checkhf.pl +++ b/tools/checkhf.pl @@ -152,12 +152,16 @@ while (<>) { } # Read input - if (/static\s+.*int\s+(hf_\w*)\s*=\s*-1\s*;/) { + if (/^\s*(?: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; + if (/^\s*static/) { + # ignore: static declarations without any use are detected by the compiler + next; + } + $debug && print "extern declaration: t_usage for $element$D\n"; + $type = "t_usage"; # hack: decl is extern so pretend we've seen a usage # Skip function parameter declarations with hf_ names } elsif (/(int\s+?|int\s*?\*\s*?|header_field_info\s+?|header_field_info\s*?\*\s*?|hf_register_info\s+?|hf_register_info\s*?\*\s*?|->\s*?)(hf_\w*)\W(.*)/) { $element = $2; |