[PATCH 4/4] libmm-glib: remove explicit GDestroyNotify cast on g_object_unref
Aleksander Morgado
aleksander at aleksander.es
Wed Mar 29 08:32:58 UTC 2017
On Wed, Mar 29, 2017 at 3:35 AM, Ben Chan <benchan at chromium.org> wrote:
> g_object_unref is in form of `void (*)(gpointer)`, which matches the
> GDestroyNotify signature. An explicit GDestroyNotify cast on
> g_object_unref is thus not needed.
> ---
Pushed to git master, thanks!
> libmm-glib/mm-modem-messaging.c | 4 ++--
> libmm-glib/mm-modem-simple.c | 2 +-
> libmm-glib/mm-modem-voice.c | 4 ++--
> libmm-glib/mm-modem.c | 6 +++---
> 4 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/libmm-glib/mm-modem-messaging.c b/libmm-glib/mm-modem-messaging.c
> index 682cae93..a6e281fc 100644
> --- a/libmm-glib/mm-modem-messaging.c
> +++ b/libmm-glib/mm-modem-messaging.c
> @@ -230,7 +230,7 @@ typedef struct {
> static void
> sms_object_list_free (GList *list)
> {
> - g_list_free_full (list, (GDestroyNotify) g_object_unref);
> + g_list_free_full (list, g_object_unref);
> }
>
> static void
> @@ -492,7 +492,7 @@ new_sms_object_ready (GDBusConnection *connection,
> else
> g_simple_async_result_set_op_res_gpointer (ctx->result,
> sms,
> - (GDestroyNotify)g_object_unref);
> + g_object_unref);
>
> create_sms_context_complete_and_free (ctx);
> }
> diff --git a/libmm-glib/mm-modem-simple.c b/libmm-glib/mm-modem-simple.c
> index 9338c453..14624995 100644
> --- a/libmm-glib/mm-modem-simple.c
> +++ b/libmm-glib/mm-modem-simple.c
> @@ -138,7 +138,7 @@ new_bearer_ready (GDBusConnection *connection,
> else
> g_simple_async_result_set_op_res_gpointer (ctx->result,
> bearer,
> - (GDestroyNotify)g_object_unref);
> + g_object_unref);
>
> connect_context_complete_and_free (ctx);
> }
> diff --git a/libmm-glib/mm-modem-voice.c b/libmm-glib/mm-modem-voice.c
> index f517b1b9..1d649454 100644
> --- a/libmm-glib/mm-modem-voice.c
> +++ b/libmm-glib/mm-modem-voice.c
> @@ -95,7 +95,7 @@ typedef struct {
> static void
> call_object_list_free (GList *list)
> {
> - g_list_free_full (list, (GDestroyNotify) g_object_unref);
> + g_list_free_full (list, g_object_unref);
> }
>
> static void
> @@ -357,7 +357,7 @@ new_call_object_ready (GDBusConnection *connection,
> else
> g_simple_async_result_set_op_res_gpointer (ctx->result,
> call,
> - (GDestroyNotify)g_object_unref);
> + g_object_unref);
>
> create_call_context_complete_and_free (ctx);
> }
> diff --git a/libmm-glib/mm-modem.c b/libmm-glib/mm-modem.c
> index 80181f68..25e042d0 100644
> --- a/libmm-glib/mm-modem.c
> +++ b/libmm-glib/mm-modem.c
> @@ -1763,7 +1763,7 @@ typedef struct {
> static void
> bearer_object_list_free (GList *list)
> {
> - g_list_free_full (list, (GDestroyNotify) g_object_unref);
> + g_list_free_full (list, g_object_unref);
> }
>
> static void
> @@ -2027,7 +2027,7 @@ modem_new_bearer_ready (GDBusConnection *connection,
> else
> g_simple_async_result_set_op_res_gpointer (ctx->result,
> bearer,
> - (GDestroyNotify)g_object_unref);
> + g_object_unref);
>
> create_bearer_context_complete_and_free (ctx);
> }
> @@ -2868,7 +2868,7 @@ modem_get_sim_ready (GDBusConnection *connection,
> else
> g_simple_async_result_set_op_res_gpointer (simple,
> sim,
> - (GDestroyNotify)g_object_unref);
> + g_object_unref);
>
> g_simple_async_result_complete (simple);
> g_object_unref (simple);
> --
> 2.12.2.564.g063fe858b8-goog
>
--
Aleksander
https://aleksander.es
More information about the ModemManager-devel
mailing list