From 22149c5523a77e642ec13d12064b2ccef29e51fb Mon Sep 17 00:00:00 2001 From: Evan Huus Date: Sat, 22 Feb 2014 08:39:57 -0500 Subject: TVB API deprecations and cleanup - rename tvb_length and similar to tvb_captured_length and similar; leave #defines in place for backwards-compat, but mark them clearly as deprecated in code comments and in checkAPI - remove tvb_get_string as C code and just leave a #define in place for backwards-compat; mark it clearly as deprecated in code comment and checkAPI - update READMEs and sample dissector for all of the above - while in the neighbourhood, make checkAPI skip (and warn) for missing files instead of bailing on the whole check, so subsequent files still get checked Change-Id: I32fc437896ca86ca73e9b49d5f50400adf8ec5ad Reviewed-on: https://code.wireshark.org/review/311 Reviewed-by: Evan Huus --- tools/checkAPIs.pl | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'tools/checkAPIs.pl') diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl index 2ab20c3e37..e21f75323d 100755 --- a/tools/checkAPIs.pl +++ b/tools/checkAPIs.pl @@ -124,10 +124,16 @@ my %APIs = ( '_snwprintf' # use StringCchPrintf ] }, - ### Deprecated emem functions (use wmem instead!) - # These will become errors once they've been removed from all the - # existing code - 'emem' => { 'count_errors' => 0, 'functions' => [ + ### Soft-Deprecated functions that should not be used in new code but + # have not been entirely removed from old code. These will become errors + # once they've been removed from all existing code. + 'soft-deprecated' => { 'count_errors' => 0, 'functions' => [ + 'tvb_length', # replaced with tvb_captured_length + 'tvb_length_remaining', # replaced with tvb_captured_length_remaining + 'tvb_ensure_length_remaining', # replaced with tvb_ensure_captured_length_remaining + 'tvb_get_string', # replaced with tvb_get_string_enc + + # wmem calls should replace all emem calls (see doc/README.wmem) 'ep_alloc', 'ep_new', 'ep_alloc0', @@ -329,7 +335,7 @@ my %APIs = ( ); -my @apiGroups = qw(prohibited deprecated emem); +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; @@ -1946,7 +1952,10 @@ while ($_ = $ARGV[0]) my @foundAPIs = (); my $line; - die "No such file: \"$filename\"" if (! -e $filename); + if (! -e $filename) { + warn "No such file: \"$filename\""; + next; + } # delete leading './' $filename =~ s{ ^ \. / } {}xo; -- cgit v1.2.3