aboutsummaryrefslogtreecommitdiffstats
path: root/tools/checkAPIs.pl
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2014-02-22 08:39:57 -0500
committerEvan Huus <eapache@gmail.com>2014-02-22 15:02:01 +0000
commit22149c5523a77e642ec13d12064b2ccef29e51fb (patch)
tree1edd6b588f9094ef03642a09130849b7d6fa92c4 /tools/checkAPIs.pl
parent00cc94bd5d0d6dad34f77006b1acc78e410d407c (diff)
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 <eapache@gmail.com>
Diffstat (limited to 'tools/checkAPIs.pl')
-rwxr-xr-xtools/checkAPIs.pl21
1 files changed, 15 insertions, 6 deletions
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;