diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2018-05-02 18:35:29 +0200 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-05-02 19:33:30 +0000 |
commit | ac1c1c3e58532079daff6b807b7e12d5ba17199d (patch) | |
tree | aa7496ca321018490e28974e03efdab1b8f71000 /extcap.c | |
parent | acdda66ce8a2cb6974a63e34f41223b1d77ac785 (diff) |
extcap.c: fix compilation with gcc 8
extcap.c:228:37: error: cast between incompatible function types from ‘void (*)(iface_toolbar_value *)’ {aka ‘void (*)(struct _iface_toolbar_value *)’} to ‘void (*)(void *, void *)’ [-Werror=cast-function-type]
extcap.c:246:39: error: cast between incompatible function types from ‘void (*)(iface_toolbar_control *)’ {aka ‘void (*)(struct _iface_toolbar_control *)’} to ‘void (*)(void *, void *)’ [-Werror=cast-function-type]
extcap.c:521:32: error: cast between incompatible function types from ‘void (*)(void *)’ to ‘void (*)(void *, void *)’ [-Werror=cast-function-type]
extcap.c:1440:35: error: cast between incompatible function types from ‘void (*)(void *)’ to ‘void (*)(void *, void *)’ [-Werror=cast-function-type]
Change-Id: I2422e9b59c288907882c9ffd57cbae12011f7832
Reviewed-on: https://code.wireshark.org/review/27264
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'extcap.c')
-rw-r--r-- | extcap.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -225,8 +225,7 @@ extcap_free_toolbar_control(iface_toolbar_control *control) if (control->ctrl_type == INTERFACE_TYPE_STRING) { g_free(control->default_value.string); } - g_list_foreach(control->values, (GFunc)extcap_free_toolbar_value, NULL); - g_list_free(control->values); + g_list_free_full(control->values, (GDestroyNotify)extcap_free_toolbar_value); g_free(control); } @@ -243,8 +242,7 @@ extcap_free_toolbar(gpointer data) g_free(toolbar->menu_title); g_free(toolbar->help); g_list_free_full(toolbar->ifnames, g_free); - g_list_foreach(toolbar->controls, (GFunc)extcap_free_toolbar_control, NULL); - g_list_free(toolbar->controls); + g_list_free_full(toolbar->controls, (GDestroyNotify)extcap_free_toolbar_control); g_free(toolbar); } @@ -518,8 +516,7 @@ static void extcap_free_interfaces(GList *interfaces) return; } - g_list_foreach(interfaces, (GFunc)extcap_free_interface, NULL); - g_list_free(interfaces); + g_list_free_full(interfaces, extcap_free_interface); } static gint @@ -1383,6 +1380,11 @@ GPtrArray *extcap_prepare_arguments(interface_options *interface_opts) return result; } +static void ptr_array_free(gpointer data, gpointer user_data _U_) +{ + g_free(data); +} + /* call mkfifo for each extcap, * returns FALSE if there's an error creating a FIFO */ gboolean @@ -1437,7 +1439,7 @@ extcap_init_interfaces(capture_options *capture_opts) pid = ws_pipe_spawn_async(pipedata, args); - g_ptr_array_foreach(args, (GFunc)g_free, NULL); + g_ptr_array_foreach(args, ptr_array_free, NULL); g_ptr_array_free(args, TRUE); if (pid == WS_INVALID_PID) |