diff options
author | Bill Meier <wmeier@newsguy.com> | 2014-05-27 20:55:42 -0400 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2014-06-03 01:40:41 +0000 |
commit | e05dc825bab36c5e660e015c6058c5f0e855c5dd (patch) | |
tree | 0ce514c076016bd1deba3c20eb21fc00ebe64da9 /tools/checkAPIs.pl | |
parent | fae972606761d0169342f906cf25e510e9e2ca49 (diff) | |
download | wireshark-e05dc825bab36c5e660e015c6058c5f0e855c5dd.tar.gz |
Add a few more ad-hoc validations of the hf[] FIELDCONVERT field.
Change-Id: Icd817a950331a2e7416a28c3d4a5a004d297e6f9
Reviewed-on: https://code.wireshark.org/review/1845
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Diffstat (limited to 'tools/checkAPIs.pl')
-rwxr-xr-x | tools/checkAPIs.pl | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl index babf96d76e..30f29c466a 100755 --- a/tools/checkAPIs.pl +++ b/tools/checkAPIs.pl @@ -337,6 +337,7 @@ my %APIs = ( my @apiGroups = qw(prohibited deprecated soft-deprecated); + # Deprecated GTK+ (and GDK) functions/macros with (E)rror or (W)arning flag: # (The list is based upon the GTK+ 2.24.8 documentation; # E: There should be no current Wireshark use so Error if seen; @@ -1765,7 +1766,7 @@ sub check_hf_entries($$) \s*,\s* ([A-Z0-9x\|_]+) # display \s*,\s* - ([A-Z0-9&_\(\)' -]+) # convert + ([^,]+?) # convert \s*,\s* ([A-Z0-9_]+) # bitmask \s*,\s* @@ -1776,10 +1777,11 @@ sub check_hf_entries($$) #print "Found @items items\n"; while (@items) { + ##my $errorCount_save = $errorCount; my ($hf, $name, $abbrev, $ft, $display, $convert, $bitmask, $blurb) = @items; shift @items; shift @items; shift @items; shift @items; shift @items; shift @items; shift @items; shift @items; - #print "name=$name, abbrev=$abbrev, ft=$ft, display=$display, convert=$convert, bitmask=$bitmask, blurb=$blurb\n"; + #print "name=$name, abbrev=$abbrev, ft=$ft, display=$display, convert=>$convert<, bitmask=$bitmask, blurb=$blurb\n"; if ($abbrev eq '""' || $abbrev eq "NULL") { print STDERR "Error: $hf does not have an abbreviation in $filename\n"; @@ -1837,6 +1839,10 @@ sub check_hf_entries($$) print STDERR "Error: $hf: FT_BOOLEAN with a bitmask must specify a 'parent field width' for 'display' in $filename\n"; $errorCount++; } + if (($ft eq "FT_BOOLEAN") && ($convert !~ m/^((0[xX]0?)?0$|NULL$|TFS)/)) { + print STDERR "Error: $hf: FT_BOOLEAN with non-null 'convert' field missing TFS in $filename\n"; + $errorCount++; + } if ($convert =~ m/RVALS/ && $display !~ m/BASE_RANGE_STRING/) { print STDERR "Error: $hf uses RVALS but 'display' does not include BASE_RANGE_STRING in $filename\n"; $errorCount++; @@ -1849,11 +1855,19 @@ sub check_hf_entries($$) print STDERR "Error: $hf is passing the address of a pointer to RVALS in $filename\n"; $errorCount++; } + if ($convert !~ m/^((0[xX]0?)?0$|NULL$|VALS|VALS64|RVALS|TFS|&)/ && $display !~ /BASE_CUSTOM/) { + print STDERR "Error: non-null $hf 'convert' field missing 'VALS|VALS64|RVALS|TFS|&' in $filename ?\n"; + $errorCount++; + } ## Benign... ## if (($ft eq "FT_BOOLEAN") && ($bitmask =~ /^(0x)?0+$/) && ($display ne "BASE_NONE")) { ## print STDERR "Error: $abbrev: FT_BOOLEAN with no bitmask must use BASE_NONE for 'display' in $filename\n"; ## $errorCount++; ## } + ##if ($errorCount != $errorCount_save) { + ## print STDERR "name=$name, abbrev=$abbrev, ft=$ft, display=$display, convert=>$convert<, bitmask=$bitmask, blurb=$blurb\n"; + ##} + } return $errorCount; |