[libdmapsharing/LIBDMAPSHARING_3_0] Address compiler warnings in dns_sd code
- From: W. Michael Petullo <wmpetullo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdmapsharing/LIBDMAPSHARING_3_0] Address compiler warnings in dns_sd code
- Date: Thu, 2 Jul 2020 21:33:16 +0000 (UTC)
commit 0ffbb3447bd6ba9eff30379083f1a028337dfafb
Author: W. Michael Petullo <mike flyn org>
Date: Thu Jul 2 16:19:10 2020 -0500
Address compiler warnings in dns_sd code
Closes #28.
libdmapsharing/dmap-mdns-browser-dnssd.c | 63 +++++++++++++++++-------------
libdmapsharing/dmap-mdns-publisher-dnssd.c | 32 +++++++--------
2 files changed, 52 insertions(+), 43 deletions(-)
---
diff --git a/libdmapsharing/dmap-mdns-browser-dnssd.c b/libdmapsharing/dmap-mdns-browser-dnssd.c
index 0a45ece..403a0f5 100644
--- a/libdmapsharing/dmap-mdns-browser-dnssd.c
+++ b/libdmapsharing/dmap-mdns-browser-dnssd.c
@@ -160,13 +160,13 @@ done:
}
static void
-dns_service_browse_reply (DNSServiceRef sd_ref,
- DNSServiceFlags flags,
- uint32_t interface_index,
- DNSServiceErrorType error_code,
- const char *service_name,
- const char *regtype,
- const char *domain, void *udata)
+dns_service_browse_reply (G_GNUC_UNUSED DNSServiceRef sd_ref,
+ DNSServiceFlags flags,
+ uint32_t interface_index,
+ DNSServiceErrorType error_code,
+ const char *service_name,
+ G_GNUC_UNUSED const char *regtype,
+ const char *domain, void *udata)
{
if (error_code != kDNSServiceErr_NoError) {
g_warning ("dnsServiceBrowserReply (): fail");
@@ -192,14 +192,15 @@ done:
return;
}
+/*
static void
-dns_host_resolve_reply (DNSServiceRef sd_ref,
- DNSServiceFlags flags,
- uint32_t interface_index,
+dns_host_resolve_reply (G_GNUC_UNUSED DNSServiceRef sd_ref,
+ G_GNUC_UNUSED DNSServiceFlags flags,
+ G_GNUC_UNUSED uint32_t interface_index,
DNSServiceErrorType error_code,
- const char *hostname,
+ G_GNUC_UNUSED const char *hostname,
const struct sockaddr *address,
- uint32_t ttl,
+ G_GNUC_UNUSED uint32_t ttl,
void *udata)
{
ServiceContext *ctx = (ServiceContext *) udata;
@@ -227,10 +228,12 @@ dns_host_resolve_reply (DNSServiceRef sd_ref,
break;
}
}
+*/
static gboolean
-lookup_result_available_cb (GIOChannel * gio, GIOCondition condition,
- ServiceContext *context)
+lookup_result_available_cb (G_GNUC_UNUSED GIOChannel * gio,
+ GIOCondition condition,
+ ServiceContext *context)
{
gboolean fnval = FALSE;
@@ -277,15 +280,15 @@ add_host_lookup_to_event_loop (ServiceContext *context)
}
static void
-dns_service_resolve_reply (DNSServiceRef sd_ref,
- DNSServiceFlags flags,
- uint32_t interface_index,
- DNSServiceErrorType error_code,
- const char *name,
- const char *host,
- uint16_t port,
- uint16_t txt_len,
- const char *txt_record,
+dns_service_resolve_reply (G_GNUC_UNUSED DNSServiceRef sd_ref,
+ DNSServiceFlags flags,
+ uint32_t interface_index,
+ DNSServiceErrorType error_code,
+ const char *name,
+ G_GNUC_UNUSED const char *host,
+ uint16_t port,
+ G_GNUC_UNUSED uint16_t txt_len,
+ G_GNUC_UNUSED const char *txt_record,
void *udata)
{
DNSServiceRef ref;
@@ -303,6 +306,8 @@ dns_service_resolve_reply (DNSServiceRef sd_ref,
ctx->service.pair = NULL;
ctx->service.password_protected = FALSE;
+ g_error("FIXME: Not implemented");
+/*
DNSServiceErrorType err = DNSServiceGetAddrInfo (&ref,
0,
ctx->interface_index,
@@ -314,6 +319,7 @@ dns_service_resolve_reply (DNSServiceRef sd_ref,
g_warning ("Error setting up DNS-SD address info handler");
service_context_free (ctx);
}
+*/
ctx->host_lookup_ref = ref;
@@ -321,7 +327,8 @@ dns_service_resolve_reply (DNSServiceRef sd_ref,
}
static gboolean
-service_result_available_cb (GIOChannel * gio, GIOCondition condition,
+service_result_available_cb (G_GNUC_UNUSED GIOChannel * gio,
+ GIOCondition condition,
ServiceContext *context)
{
gboolean fnval = FALSE;
@@ -363,8 +370,9 @@ add_service_discovery_to_event_loop (ServiceContext *context)
}
static gboolean
-browse_result_available_cb (GIOChannel * gio,
- GIOCondition condition, DMAPMdnsBrowser * browser)
+browse_result_available_cb (G_GNUC_UNUSED GIOChannel * gio,
+ GIOCondition condition,
+ DMAPMdnsBrowser * browser)
{
gboolean fnval = FALSE;
@@ -538,7 +546,8 @@ dmap_mdns_browser_start (DMAPMdnsBrowser * browser, GError ** error)
}
gboolean
-dmap_mdns_browser_stop (DMAPMdnsBrowser * browser, GError ** error)
+dmap_mdns_browser_stop (DMAPMdnsBrowser * browser,
+ G_GNUC_UNUSED GError ** error)
{
if (NULL != browser->priv->sd_browse_ref) {
DNSServiceRefDeallocate (browser->priv->sd_browse_ref);
diff --git a/libdmapsharing/dmap-mdns-publisher-dnssd.c b/libdmapsharing/dmap-mdns-publisher-dnssd.c
index 93ac0b2..15f5117 100644
--- a/libdmapsharing/dmap-mdns-publisher-dnssd.c
+++ b/libdmapsharing/dmap-mdns-publisher-dnssd.c
@@ -54,10 +54,10 @@ dmap_mdns_publisher_error_quark (void)
}
gboolean
-dmap_mdns_publisher_rename_at_port (DMAPMdnsPublisher *publisher,
- guint port,
- const char *name,
- GError **error)
+dmap_mdns_publisher_rename_at_port (G_GNUC_UNUSED DMAPMdnsPublisher *publisher,
+ G_GNUC_UNUSED guint port,
+ G_GNUC_UNUSED const char *name,
+ G_GNUC_UNUSED GError **error)
{
g_error ("Not implemented");
@@ -89,7 +89,7 @@ _build_txt_record(gboolean password_required, gchar **txt_records, uint16_t *txt
for (; txt_records && *txt_records; txt_records++) {
size_t len = strlen(*txt_records);
- g_assert(len <= ~(char)0);
+ g_assert(len <= 255);
txt_record[i++] = (char)len;
@@ -158,9 +158,9 @@ done:
}
gboolean
-dmap_mdns_publisher_withdraw (DMAPMdnsPublisher *publisher,
- guint port,
- GError **error)
+dmap_mdns_publisher_withdraw (G_GNUC_UNUSED DMAPMdnsPublisher *publisher,
+ G_GNUC_UNUSED guint port,
+ G_GNUC_UNUSED GError **error)
{
g_error ("Not implemented");
@@ -168,10 +168,10 @@ dmap_mdns_publisher_withdraw (DMAPMdnsPublisher *publisher,
}
static void
-dmap_mdns_publisher_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+dmap_mdns_publisher_set_property (GObject *object,
+ guint prop_id,
+ G_GNUC_UNUSED const GValue *value,
+ GParamSpec *pspec)
{
switch (prop_id) {
default:
@@ -181,10 +181,10 @@ dmap_mdns_publisher_set_property (GObject *object,
}
static void
-dmap_mdns_publisher_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+dmap_mdns_publisher_get_property (GObject *object,
+ guint prop_id,
+ 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]