[libdmapsharing/LIBDMAPSHARING_3_0] Fix GCC warnings with Avahi backend enabled
- From: W. Michael Petullo <wmpetullo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdmapsharing/LIBDMAPSHARING_3_0] Fix GCC warnings with Avahi backend enabled
- Date: Fri, 3 Jul 2020 14:19:28 +0000 (UTC)
commit 1ac3b82a1149f24305bbde2b7292d508b6527ce6
Author: W. Michael Petullo <mike flyn org>
Date: Fri Jul 3 09:19:20 2020 -0500
Fix GCC warnings with Avahi backend enabled
libdmapsharing/dmap-mdns-avahi.c | 4 +++-
libdmapsharing/dmap-mdns-browser-avahi.c | 31 ++++++++++++++++++------------
libdmapsharing/dmap-mdns-publisher-avahi.c | 11 +++++++----
3 files changed, 29 insertions(+), 17 deletions(-)
---
diff --git a/libdmapsharing/dmap-mdns-avahi.c b/libdmapsharing/dmap-mdns-avahi.c
index 2bde822..d7ddc45 100644
--- a/libdmapsharing/dmap-mdns-avahi.c
+++ b/libdmapsharing/dmap-mdns-avahi.c
@@ -32,7 +32,9 @@ static AvahiEntryGroup *entry_group = NULL;
static gsize client_init = 0;
static void
-client_cb (AvahiClient * client, AvahiClientState state, gpointer data)
+client_cb (AvahiClient * client,
+ AvahiClientState state,
+ G_GNUC_UNUSED gpointer data)
{
/* FIXME
* check to make sure we're in the _RUNNING state before we publish
diff --git a/libdmapsharing/dmap-mdns-browser-avahi.c b/libdmapsharing/dmap-mdns-browser-avahi.c
index 4cc8201..cd65ecd 100644
--- a/libdmapsharing/dmap-mdns-browser-avahi.c
+++ b/libdmapsharing/dmap-mdns-browser-avahi.c
@@ -153,6 +153,12 @@ dmap_mdns_browser_init (DMAPMdnsBrowser * browser)
avahi_client_init (browser);
}
+static void
+_wrapper(void *p)
+{
+ avahi_service_resolver_free(p);
+}
+
static void
dmap_mdns_browser_dispose (GObject * object)
{
@@ -167,9 +173,7 @@ dmap_mdns_browser_dispose (GObject * object)
g_slist_free (browser->priv->services);
if (browser->priv->resolvers) {
- g_slist_foreach (browser->priv->resolvers,
- (GFunc) avahi_service_resolver_free, NULL);
- g_slist_free (browser->priv->resolvers);
+ g_slist_free_full (browser->priv->resolvers, _wrapper);
}
if (browser->priv->service_browser) {
@@ -291,7 +295,8 @@ dmap_mdns_browser_get_service_type (DMAPMdnsBrowser * browser)
static void
client_cb (AvahiClient * client,
- AvahiClientState state, DMAPMdnsBrowser * browser)
+ AvahiClientState state,
+ G_GNUC_UNUSED DMAPMdnsBrowser * browser)
{
/* Called whenever the client or server state changes */
@@ -340,17 +345,17 @@ avahi_client_init (DMAPMdnsBrowser * browser)
static void
resolve_cb (AvahiServiceResolver * service_resolver,
- AvahiIfIndex interface,
- AvahiProtocol protocol,
+ G_GNUC_UNUSED AvahiIfIndex interface,
+ G_GNUC_UNUSED AvahiProtocol protocol,
AvahiResolverEvent event,
const gchar * service_name,
const gchar * type,
const gchar * domain,
- const gchar * host_name,
+ G_GNUC_UNUSED const gchar * host_name,
const AvahiAddress * address,
uint16_t port, AvahiStringList * text,
#ifdef HAVE_AVAHI_0_6
- AvahiLookupResultFlags flags,
+ G_GNUC_UNUSED AvahiLookupResultFlags flags,
#endif
DMAPMdnsBrowser * browser)
{
@@ -497,11 +502,13 @@ browser_remove_service (DMAPMdnsBrowser * browser, const gchar * service_name)
}
static void
-browse_cb (AvahiServiceBrowser * service_browser,
- AvahiIfIndex interface,
- AvahiProtocol protocol,
+browse_cb (G_GNUC_UNUSED AvahiServiceBrowser * service_browser,
+ G_GNUC_UNUSED AvahiIfIndex interface,
+ G_GNUC_UNUSED AvahiProtocol protocol,
AvahiBrowserEvent event,
- const gchar * name, const gchar * type, const gchar * domain,
+ const gchar * name,
+ G_GNUC_UNUSED const gchar * type,
+ const gchar * domain,
#ifdef HAVE_AVAHI_0_6
AvahiLookupResultFlags flags,
#endif
diff --git a/libdmapsharing/dmap-mdns-publisher-avahi.c b/libdmapsharing/dmap-mdns-publisher-avahi.c
index 1b8f6c5..973c64e 100644
--- a/libdmapsharing/dmap-mdns-publisher-avahi.c
+++ b/libdmapsharing/dmap-mdns-publisher-avahi.c
@@ -95,7 +95,7 @@ emit_published (char *name, DMAPMdnsPublisher * publisher)
}
static void
-entry_group_cb (AvahiEntryGroup * group,
+entry_group_cb (G_GNUC_UNUSED AvahiEntryGroup * group,
AvahiEntryGroupState state, DMAPMdnsPublisher * publisher)
{
if (state == AVAHI_ENTRY_GROUP_ESTABLISHED) {
@@ -297,7 +297,8 @@ dmap_mdns_publisher_publish (DMAPMdnsPublisher * publisher,
}
static void
-free_service (struct DMAPMdnsPublisherService *service, gpointer user_data)
+free_service (struct DMAPMdnsPublisherService *service,
+ G_GNUC_UNUSED gpointer user_data)
{
g_free (service->name);
g_free (service->type_of_service);
@@ -349,7 +350,8 @@ dmap_mdns_publisher_withdraw (DMAPMdnsPublisher * publisher,
static void
dmap_mdns_publisher_set_property (GObject * object,
guint prop_id,
- const GValue * value, GParamSpec * pspec)
+ G_GNUC_UNUSED const GValue * value,
+ GParamSpec * pspec)
{
switch (prop_id) {
default:
@@ -361,7 +363,8 @@ dmap_mdns_publisher_set_property (GObject * object,
static void
dmap_mdns_publisher_get_property (GObject * object,
guint prop_id,
- GValue * value, GParamSpec * pspec)
+ G_GNUC_UNUSED GValue * value,
+ GParamSpec * pspec)
{
switch (prop_id) {
default:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]