[PATCH 1/2] libqmi-lib: remove explicit GDestroyNotify cast on g_free / g_object_unref

Aleksander Morgado aleksander at aleksander.es
Wed Mar 29 08:44:08 UTC 2017


On 29/03/17 03:48, Ben Chan wrote:
> g_free and g_object_unref are in form of  `void (*)(gpointer)`, which
> matches the GDestroyNotify signature. An explicit GDestroyNotify cast on
> g_free and g_object_unref is thus not needed.
> ---

Thanks, pushed to git master.

>  src/libqmi-glib/qmi-device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c
> index ff6a1d7..a3dee23 100644
> --- a/src/libqmi-glib/qmi-device.c
> +++ b/src/libqmi-glib/qmi-device.c
> @@ -950,7 +950,7 @@ build_client_object (AllocateClientContext *ctx)
>      /* Client created and registered, complete successfully */
>      g_simple_async_result_set_op_res_gpointer (ctx->result,
>                                                 client,
> -                                               (GDestroyNotify)g_object_unref);
> +                                               g_object_unref);
>      allocate_client_context_complete_and_free (ctx);
>  }
>  
> 


-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list