n-acd: don't use a return value in deallocator

...so that its prototype is compatible with GDestroyNotify:

src/devices/nm-acd-manager.c: In function ‘destroy_address_info’:
/usr/include/glib-2.0/glib/gmem.h:120:31: error: cast between incompatible function types from ‘NAcd * (*)(NAcd *)’ {aka ‘struct NAcd * (*)(struct NAcd *)’} to ‘void (*)(void *)’ [-Werror=cast-function-type]
     GDestroyNotify _destroy = (GDestroyNotify) (destroy);                      \
                               ^
src/devices/nm-acd-manager.c:430:2: note: in expansion of macro ‘g_clear_pointer’
  g_clear_pointer (&info->acd, n_acd_free);
  ^~~~~~~~~~~~~~~

The same change was done upstream, so the subsequent subtree pull of n-acd
won't mess this up.
This commit is contained in:
Lubomir Rintel 2018-04-23 09:34:55 +02:00
parent c898969110
commit de8bf7421d
2 changed files with 3 additions and 5 deletions

View file

@ -302,11 +302,11 @@ error:
*
* Return: NULL.
*/
_public_ NAcd *n_acd_free(NAcd *acd) {
_public_ void n_acd_free(NAcd *acd) {
NAcdEventNode *node;
if (!acd)
return NULL;
return;
n_acd_reset(acd);
@ -330,8 +330,6 @@ _public_ NAcd *n_acd_free(NAcd *acd) {
}
free(acd);
return NULL;
}
/**

View file

@ -73,7 +73,7 @@ enum {
};
int n_acd_new(NAcd **acdp);
NAcd *n_acd_free(NAcd *acd);
void n_acd_free(NAcd *acd);
void n_acd_get_fd(NAcd *acd, int *fdp);