Update checkAPIs.pl to look for newlines in value_strings and
enum_val_t's. We now have to perform the check before we strip quoted
strings. Hopefully that won't cause a problem. Rename the check since
we do more than check for NULL termination.
Add modelines.
Fixes bug 9878.
Change-Id: I39dd910db60c7028ea4bdb58e8cfdb239c094748
Reviewed-on: https://code.wireshark.org/review/628
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Do with tvb_get_stringz() what was done with tvb_get_string().
Redo the comments for the string get routines to try to give more detail
in a fashion that's a bit less hard to read.
Warn, in comments, of the problems with using
tvb_get_string()/tvb_get_stringz() (i.e., if your strings are non-ASCII,
all bytes with the 8th bit set are going be replaced by the Unicode
REPLACEMENT CHARACTER, and displayed as such).
Warn, in a comment, of the problems with tvb_get_const_stringz() (i.e.,
it gives you raw bytes, rather than guaranteed-to-be-valid UTF-8).
Update documentation and release notes appropriately.
Change-Id: Ibd3efb92a203861f507ce71bc8d04d19d9d38a93
Reviewed-on: https://code.wireshark.org/review/327
Reviewed-by: Guy Harris <guy@alum.mit.edu>
- 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>
$Id$ is pretty useless in git so don't enforce it in our source code.
Change-Id: Ie8b1b9627aabbca72c9c1dd93a9a76901e6967eb
Reviewed-on: https://code.wireshark.org/review/203
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
(like a #define) at the beginning of a line before a value_string no longer
matches so a #define that includes the beginning of a value_string doesn't
confuse the script.
svn path=/trunk/; revision=52089
Add --check-addtext/--nocheck-addtext, --check-hf/--nocheck-hf and --debug to the usage output and format the usage output a little better.
svn path=/trunk/; revision=52006
I'm flexible on the definition of "small" (20 "fields"), but I think checkAPIs should flag the "all proto_tree_add_text" dissectors.
svn path=/trunk/; revision=50385
- Remove comments from the input string before checking hf[] entries;
- Remove code under '#if 0' before doing API checks.
svn path=/trunk/; revision=47447
Add checks for calls to proto_tree_add_XXX (where XXX != item and a few other
functions) with an encoding (ENC_*) argument.
Also add a comment to checkAddTextCalls() about why 3 loops are used.
svn path=/trunk/; revision=43563
Also: identify problematic fields by hf_variable_name instead of name or
abbreviation (the variable name is sure to be unique).
svn path=/trunk/; revision=42826
from makefiles (and thus from the buildbot).
The intention is to be able to tell when a human is running the tool so we
can provide more code-review guidance.
As a starter, enable the "too many proto_tree_add_text() calls" check when
a human is running the tool.
svn path=/trunk/; revision=41943
proto_tree_add_text() calls and compare that to the number of
proto_tree_add_<something else>() calls and complain if more than 50%
of the calls are add_text()'s.
proto_tree_add_text() calls whose returned proto_item is used are not counted
as hanging a subtree off a text item is an appropriate use for text items.
I chose 50% because even at that level there are many dissectors with "too many"
proto_tree_add_text()'s.
The function to do all of this is commented out for now for the same reason
plus the fact that it's pretty slow.
svn path=/trunk/; revision=40930
- Mark GDK functions which aren't used as 'E'
- Add GTK functions deprecated after GTK 2.20
- Add some comments about use of GTK_DISABLE_DEPRECATED
- reformat
...
svn path=/trunk/; revision=40569
GTK_WIDGET_NO_WINDOW() in pre-2.18 versions of GTK+. Treat calls to
GTK_WIDGET_NO_WINDOW() as an error in checkAPIs.pl.
svn path=/trunk/; revision=38197
in another list: convert the 2nd list to a hash. This speeds checking for ett_
variables up considerably.
Store the pattern to match ett_ variable names in a variable (since it's used 3
times).
Only match ett_ variable declarations that start on their own line (hopefully to
speed things up a bit).
svn path=/trunk/; revision=35929
stored in an array which will hopefully be registered).
This is a work-in-progress, so the function is not called.
It is also EXTREMELY slow on big files. (Or maybe it's looping...
I haven't yet had the patience to let it finish processing packet-rrc.c .)
svn path=/trunk/; revision=35923
should be used (instead of the non-tvb functions with a call to tvb_get_ptr()).
Use those functions in a bunch of places.
svn path=/trunk/; revision=35911
Add the option to check hf entries for various problems. This is disabled by
default for the moment as it's quite noisy.
The regexps may need some additional fine tuning (or maybe simplification),
but they seem to work pretty well.
Arguably this might make more sense in checkhf.pl but it was easier to integrate
into this script.
svn path=/trunk/; revision=34240
Warn instead of Error for several deprecated GTK functions used recently
in Wireshark source (1 GtkCombo function and 2 GtkItemFactory functions).
(ToDo: replace remaining use of GtkCombo and all use of GtkItemFactory).
svn path=/trunk/; revision=33598
Warning
gtk_window_set_policy is deprecated and should not be used in newly-written code. Use gtk_window_set_resizable() instead.
Changes how a toplevel window deals with its size request and user resize attempts. There are really only two reasonable ways to call this function:
1.gtk_window_set_policy (GTK_WINDOW (window), FALSE, TRUE, FALSE) means that the window is user-resizable.
2.gtk_window_set_policy (GTK_WINDOW (window), FALSE, FALSE, TRUE) means that the window's size is program-controlled, and should simply match the current size request of the window's children.
gtk_window_set_resizable () :
Sets whether the user can resize a window. Windows are user resizable by default.
svn path=/trunk/; revision=30311
(In each case the arg values used [4,0] were the same as the defaults).
checkAPIs.pl: gtk_button_box_set_child_ipadding: 'W' --> 'E'
svn path=/trunk/; revision=28030
Group 'deprecated-gtk' lists all deprecated GTK APIs which
are not currently used in Wireshark.
-g deprecated-gtk will 'Error';
Group 'deprecated-gtk-todo' lists the deprecated GTK APIs
which are still used in Wireshark (ie: not yet fixed).
-g deprecated-gtk-todo will 'Warn'.
Also: two new options added:
-M: -g output is one line per function per file;
-s summary-group: gives a count of the usage of each function in that group
[currently: any group used in -s must also be specified with -g option].
svn path=/trunk/; revision=27729
#'gtk_clist_new', should we depriceate?
# GtkCList has been deprecated since GTK+ 2.0 and should not be used
# in newly written code. Use GtkTreeView instead.
'gtk_file_selection_new',
svn path=/trunk/; revision=27508
Apparently the "regex which matches double-quoted strings"
doesn't work with some versions of Perl (eg: 5.8.8) if the
string contains a 'line-continuation' (\ folowed by a new-line).
(This works for Perl 5.10.0).
So: disable value_string check until I look into this further.
svn path=/trunk/; revision=25802
and "deprecated" groups the default. Add an "abort" group for code that
shouldn't exit the program. Update the makefiles to call "checkAPIs.pl
-g abort" for dissectors. Remove a dependency on "cat" in checkAPIs.pl.
svn path=/trunk/; revision=25614
libwireshark (and the plugins using those functions) do not depend on
wiretap on Windows.
While doing that, rename the eth_* functions to ws_*.
svn path=/trunk/; revision=25354