[libdmapsharing: 1/2] Address compiler warnings in dns_sd code



commit abe7ff4ac4d1f5ca81c50c1845a84ff4db4d1e3c
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   | 38 +++++++++++++++++-------------
 libdmapsharing/dmap-mdns-publisher-dnssd.c | 20 ++++++++--------
 2 files changed, 32 insertions(+), 26 deletions(-)
---
diff --git a/libdmapsharing/dmap-mdns-browser-dnssd.c b/libdmapsharing/dmap-mdns-browser-dnssd.c
index 114204c..8ee1ccd 100644
--- a/libdmapsharing/dmap-mdns-browser-dnssd.c
+++ b/libdmapsharing/dmap-mdns-browser-dnssd.c
@@ -169,12 +169,12 @@ done:
 }
 
 static void
-_dns_service_browse_reply (DNSServiceRef sd_ref,
+_dns_service_browse_reply (G_GNUC_UNUSED DNSServiceRef sd_ref,
                            DNSServiceFlags flags,
                            uint32_t interface_index,
                            DNSServiceErrorType error_code,
                            const char *service_name,
-                           const char *regtype,
+                           G_GNUC_UNUSED const char *regtype,
                            const char *domain, void *udata)
 {
        if (error_code != kDNSServiceErr_NoError) {
@@ -202,14 +202,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;
@@ -239,9 +240,11 @@ _dns_host_resolve_reply (DNSServiceRef sd_ref,
                break;
        }
 }
+*/
 
 static gboolean
-_lookup_result_available_cb (GIOChannel * gio, GIOCondition condition,
+_lookup_result_available_cb (G_GNUC_UNUSED GIOChannel * gio,
+                             GIOCondition condition,
                              ServiceContext *context)
 {
        gboolean fnval = FALSE;
@@ -289,15 +292,15 @@ _add_host_lookup_to_event_loop (ServiceContext *context)
 }
 
 static void
-_dns_service_resolve_reply (DNSServiceRef sd_ref,
+_dns_service_resolve_reply (G_GNUC_UNUSED DNSServiceRef sd_ref,
                             DNSServiceFlags flags,
                             uint32_t interface_index,
                             DNSServiceErrorType error_code,
                             const char *name,
-                            const char *host,
+                            G_GNUC_UNUSED const char *host,
                             uint16_t port,
-                            uint16_t txt_len,
-                            const char *txt_record,
+                            G_GNUC_UNUSED uint16_t txt_len,
+                            G_GNUC_UNUSED const char *txt_record,
                             void *udata)
 {
        DNSServiceRef ref;
@@ -338,7 +341,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;
@@ -380,8 +384,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;
 
@@ -556,7 +561,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 9ac631c..c2d7a6b 100644
--- a/libdmapsharing/dmap-mdns-publisher-dnssd.c
+++ b/libdmapsharing/dmap-mdns-publisher-dnssd.c
@@ -56,10 +56,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");
 
@@ -91,7 +91,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;
 
@@ -160,9 +160,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");
 
@@ -172,7 +172,7 @@ dmap_mdns_publisher_withdraw (DmapMdnsPublisher *publisher,
 static void
 _set_property (GObject      *object,
                guint         prop_id,
-               const GValue *value,
+               G_GNUC_UNUSED const GValue *value,
                GParamSpec   *pspec)
 {
         switch (prop_id) {
@@ -185,7 +185,7 @@ _set_property (GObject      *object,
 static void
 _get_property (GObject    *object,
                guint       prop_id,
-               GValue     *value,
+               G_GNUC_UNUSED GValue *value,
                GParamSpec *pspec)
 {
         switch (prop_id) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]