Wireshark: style tweaks akin to Wireshark practices #262
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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. Usews_warning()instead ofg_warning()to leverage.Correct spelling of
MAX_SSL_VERSION()macro.Run script through Wireshark's
tools/convert-glib-types.pyto replace GLib-specific types with C99 standard types (ref Wireshark #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
HFIDSand instead defineinteresting_hfids[]as having an indefinite number of elements. Use thearray_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 frominteresting_hfids[]in future changes.Add
g_strfreev()calls to correspond with each call tog_strsplit(), which specifies in itsdocumentation that its return value must be freed.