Commit 71ee668
committed
Wireshark: style tweaks akin to Wireshark practices
Some minor tweaks to the coding style of the Wireshark dissector to
bring it closer to the standard practices used in the Wireshark project
itself. All changes are compatible with Wireshark 4.6 and should be with
4.4 as well.
Define `WS_LOG_DOMAIN`. Allows for more targeted showing/hiding of
[log messages](https://www.wireshark.org/docs/wsdg_html/#ChSrcLogging).
Use `ws_warning()` instead of `g_warning()` to leverage.
Correct spelling of `MAX_SSL_VERSION()` macro.
Run script through Wireshark's `tools/convert-glib-types.py` to replace
GLib-specific types with C99 standard types (ref Wireshark
[#19116](https://gitlab.com/wireshark/wireshark/-/issues/19116)).
Make every global variable and every function (except the register and
handoff functions) static, since none of them are used outside of this
plugin.
Remove constant `HFIDS` and instead define `interesting_hfids[]` as
having an indefinite number of elements. Use the `array_length()` macro
instead for determining the size of the array. It's still calculated at
compile time, and removes a potential source of bugs if elements are
added to or removed from `interesting_hfids[]` in future changes.
Add `g_strfreev()` calls to correspond with each call to `g_strsplit()`,
which specifies in its
[documentation](https://docs.gtk.org/glib/func.strsplit.html) that its
return value must be freed.1 parent 86eedff commit 71ee668
1 file changed
+18
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
0 commit comments