From: Marcel Holtmann Date: Wed, 23 May 2018 14:32:22 +0000 (+0200) Subject: gobex: Fix compiler warning from casting functions X-Git-Tag: accepted/tizen/unified/20190522.085452~1^2~88 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F94%2F204994%2F1;p=platform%2Fupstream%2Fbluez.git gobex: Fix compiler warning from casting functions Change-Id: Ia92479c68ee53ffdab6b1e5031311e0a8fee6cab Signed-off-by: Amit Purwar --- diff --git a/gobex/gobex-packet.c b/gobex/gobex-packet.c index cd5c131..a89f5b6 100755 --- a/gobex/gobex-packet.c +++ b/gobex/gobex-packet.c @@ -260,6 +260,11 @@ GObexPacket *g_obex_packet_new(guint8 opcode, gboolean final, return pkt; } +static void header_free(void *data, void *user_data) +{ + g_obex_header_free(data); +} + void g_obex_packet_free(GObexPacket *pkt) { g_obex_debug(G_OBEX_DEBUG_PACKET, "opcode 0x%02x", pkt->opcode); @@ -273,7 +278,7 @@ void g_obex_packet_free(GObexPacket *pkt) break; } - g_slist_foreach(pkt->headers, (GFunc) g_obex_header_free, NULL); + g_slist_foreach(pkt->headers, header_free, NULL); g_slist_free(pkt->headers); g_free(pkt); } diff --git a/gobex/gobex.c b/gobex/gobex.c index 84e6100..6229128 100644 --- a/gobex/gobex.c +++ b/gobex/gobex.c @@ -1513,6 +1513,11 @@ GObex *g_obex_ref(GObex *obex) return obex; } +static void tx_queue_free(void *data, void *user_data) +{ + pending_pkt_free(data); +} + void g_obex_unref(GObex *obex) { int refs; @@ -1526,7 +1531,7 @@ void g_obex_unref(GObex *obex) g_slist_free_full(obex->req_handlers, g_free); - g_queue_foreach(obex->tx_queue, (GFunc) pending_pkt_free, NULL); + g_queue_foreach(obex->tx_queue, tx_queue_free, NULL); g_queue_free(obex->tx_queue); if (obex->io != NULL)