[libdmapsharing] Fix warnings from -Wextra
- From: W. Michael Petullo <wmpetullo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdmapsharing] Fix warnings from -Wextra
- Date: Fri, 17 May 2019 04:45:13 +0000 (UTC)
commit 59cac7e77ad6279bab5b09a156a561c50e1c3493
Author: W. Michael Petullo <mike flyn org>
Date: Fri May 17 00:44:59 2019 -0400
Fix warnings from -Wextra
Signed-off-by: W. Michael Petullo <mike flyn org>
libdmapsharing/Makefile.am | 2 +
libdmapsharing/dmap-av-connection.c | 6 +-
libdmapsharing/dmap-av-share.c | 86 +++----
libdmapsharing/dmap-connection-private.h | 6 +-
libdmapsharing/dmap-connection.c | 86 +++----
libdmapsharing/dmap-connection.h | 12 +-
libdmapsharing/dmap-container-db.c | 2 +-
libdmapsharing/dmap-container-db.h | 2 +-
libdmapsharing/dmap-control-connection.c | 14 +-
libdmapsharing/dmap-control-share.c | 31 ++-
libdmapsharing/dmap-db.c | 9 +-
libdmapsharing/dmap-db.h | 2 +-
libdmapsharing/dmap-gst-input-stream.c | 88 ++++---
libdmapsharing/dmap-gst-mp3-input-stream.c | 2 +-
libdmapsharing/dmap-gst-qt-input-stream.c | 2 +-
libdmapsharing/dmap-gst-wav-input-stream.c | 2 +-
libdmapsharing/dmap-image-connection.c | 6 +-
libdmapsharing/dmap-image-share.c | 80 ++----
libdmapsharing/dmap-md5.c | 4 +-
libdmapsharing/dmap-mdns-avahi.c | 4 +-
libdmapsharing/dmap-mdns-browser-avahi.c | 33 ++-
libdmapsharing/dmap-mdns-publisher-avahi.c | 28 +--
libdmapsharing/dmap-private-utils.c | 2 +-
libdmapsharing/dmap-record-factory.c | 2 +-
libdmapsharing/dmap-record.c | 2 +-
libdmapsharing/dmap-share-private.h | 32 +--
libdmapsharing/dmap-share.c | 315 ++++++++++++------------
libdmapsharing/dmap-share.h | 37 ++-
libdmapsharing/dmap-structure.c | 14 +-
libdmapsharing/test-dmap-av-record-factory.c | 12 +-
libdmapsharing/test-dmap-av-record.c | 4 +-
libdmapsharing/test-dmap-container-db.c | 15 +-
libdmapsharing/test-dmap-container-record.c | 20 +-
libdmapsharing/test-dmap-db.c | 4 +-
libdmapsharing/test-dmap-image-record-factory.c | 12 +-
libdmapsharing/test-dmap-image-record.c | 4 +-
tests/test-dmap-client.c | 30 +--
tests/test-dmap-server.c | 3 +-
38 files changed, 466 insertions(+), 549 deletions(-)
---
diff --git a/libdmapsharing/Makefile.am b/libdmapsharing/Makefile.am
index e5995f6..04a38aa 100644
--- a/libdmapsharing/Makefile.am
+++ b/libdmapsharing/Makefile.am
@@ -63,6 +63,8 @@ libdmapsharing_4_0_la_SOURCES += \
endif
libdmapsharing_4_0_la_CFLAGS = \
+ -Wall \
+ -Wextra \
-DG_LOG_DOMAIN=\"libdmapsharing\" \
-I$(top_srcdir) \
-I$(top_builddir) \
diff --git a/libdmapsharing/dmap-av-connection.c b/libdmapsharing/dmap-av-connection.c
index b483378..07a9d98 100644
--- a/libdmapsharing/dmap-av-connection.c
+++ b/libdmapsharing/dmap-av-connection.c
@@ -27,13 +27,13 @@
#define DMAP_AV_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DMAP_TYPE_AV_CONNECTION,
DmapAvConnectionPrivate))
static DmapContentCode
-_get_protocol_version_cc (DmapConnection * connection)
+_get_protocol_version_cc (G_GNUC_UNUSED DmapConnection * connection)
{
return DMAP_CC_APRO;
}
static gchar *
-_get_query_metadata (DmapConnection * connection)
+_get_query_metadata (G_GNUC_UNUSED DmapConnection * connection)
{
return g_strdup ("dmap.itemid,dmap.itemname,daap.songalbum,"
"daap.songartist,daap.songgenre,daap.songsize,"
@@ -192,7 +192,7 @@ dmap_av_connection_new (const char *name,
}
static void
-dmap_av_connection_init (DmapAvConnection * connection)
+dmap_av_connection_init (G_GNUC_UNUSED DmapAvConnection * connection)
{
}
diff --git a/libdmapsharing/dmap-av-share.c b/libdmapsharing/dmap-av-share.c
index 99534ca..e955a19 100644
--- a/libdmapsharing/dmap-av-share.c
+++ b/libdmapsharing/dmap-av-share.c
@@ -47,26 +47,20 @@
guint dmap_av_share_get_desired_port (DmapShare * share);
const char *dmap_av_share_get_type_of_service (DmapShare * share);
void dmap_av_share_server_info (DmapShare * share,
- SoupServer * server,
SoupMessage * message,
- const char *path,
- GHashTable * query, SoupClientContext * context);
+ const char *path);
void dmap_av_share_message_add_standard_headers (DmapShare * share,
SoupMessage * message);
static void _databases_browse_xxx (DmapShare * share,
- SoupServer * server,
SoupMessage * msg,
const char *path,
- GHashTable * query,
- SoupClientContext * context);
+ GHashTable * query);
static void _databases_items_xxx (DmapShare * share,
SoupServer * server,
SoupMessage * msg,
- const char *path,
- GHashTable * query,
- SoupClientContext * context);
+ const char *path);
static struct DmapMetaDataMap *_get_meta_data_map (DmapShare * share);
-static void _add_entry_to_mlcl (guint id, DmapRecord * record, gpointer mb);
+static void _add_entry_to_mlcl (gpointer id, DmapRecord * record, gpointer mb);
#define DAAP_TYPE_OF_SERVICE "_daap._tcp"
#define DAAP_PORT 3689
@@ -91,7 +85,7 @@ dmap_av_share_class_init (DmapAvShareClass * klass)
}
static void
-dmap_av_share_init (DmapAvShare * share)
+dmap_av_share_init (G_GNUC_UNUSED DmapAvShare * share)
{
}
@@ -112,7 +106,7 @@ dmap_av_share_new (const char *name,
}
void
-dmap_av_share_message_add_standard_headers (DmapShare * share,
+dmap_av_share_message_add_standard_headers (G_GNUC_UNUSED DmapShare * share,
SoupMessage * message)
{
soup_message_headers_append (message->response_headers, "DMAP-Server",
@@ -124,23 +118,21 @@ dmap_av_share_message_add_standard_headers (DmapShare * share,
#define DAAP_TIMEOUT 1800
guint
-dmap_av_share_get_desired_port (DmapShare * share)
+dmap_av_share_get_desired_port (G_GNUC_UNUSED DmapShare * share)
{
return DAAP_PORT;
}
const char *
-dmap_av_share_get_type_of_service (DmapShare * share)
+dmap_av_share_get_type_of_service (G_GNUC_UNUSED DmapShare * share)
{
return DAAP_TYPE_OF_SERVICE;
}
void
dmap_av_share_server_info (DmapShare * share,
- SoupServer * server,
- SoupMessage * message,
- const char *path,
- GHashTable * query, SoupClientContext * context)
+ SoupMessage * message,
+ const char *path)
{
/* MSRV server info response
* MSTT status
@@ -509,7 +501,7 @@ done:
}
static void
-_add_entry_to_mlcl (guint id, DmapRecord * record, gpointer _mb)
+_add_entry_to_mlcl (gpointer id, DmapRecord * record, gpointer _mb)
{
GNode *mlit;
gboolean has_video = 0;
@@ -524,7 +516,7 @@ _add_entry_to_mlcl (guint id, DmapRecord * record, gpointer _mb)
}
if (dmap_share_client_requested (mb->bits, ITEM_ID)) {
- dmap_structure_add (mlit, DMAP_CC_MIID, id);
+ dmap_structure_add (mlit, DMAP_CC_MIID, GPOINTER_TO_UINT(id));
}
if (dmap_share_client_requested (mb->bits, ITEM_NAME)) {
@@ -540,11 +532,11 @@ _add_entry_to_mlcl (guint id, DmapRecord * record, gpointer _mb)
}
if (dmap_share_client_requested (mb->bits, PERSISTENT_ID)) {
- dmap_structure_add (mlit, DMAP_CC_MPER, id);
+ dmap_structure_add (mlit, DMAP_CC_MPER, GPOINTER_TO_UINT(id));
}
if (dmap_share_client_requested (mb->bits, CONTAINER_ITEM_ID)) {
- dmap_structure_add (mlit, DMAP_CC_MCTI, id);
+ dmap_structure_add (mlit, DMAP_CC_MCTI, GPOINTER_TO_UINT(id));
}
if (dmap_share_client_requested (mb->bits, SONG_DATA_KIND)) {
@@ -772,7 +764,7 @@ _add_entry_to_mlcl (guint id, DmapRecord * record, gpointer _mb)
}
static void
-_genre_tabulator (gpointer id, DmapRecord *record, GHashTable *ht)
+_genre_tabulator (G_GNUC_UNUSED gpointer id, DmapRecord *record, GHashTable *ht)
{
const gchar *genre;
@@ -792,7 +784,7 @@ _genre_tabulator (gpointer id, DmapRecord *record, GHashTable *ht)
}
static void
-_artist_tabulator (gpointer id, DmapRecord * record, GHashTable * ht)
+_artist_tabulator (G_GNUC_UNUSED gpointer id, DmapRecord * record, GHashTable * ht)
{
const gchar *artist;
@@ -812,7 +804,7 @@ _artist_tabulator (gpointer id, DmapRecord * record, GHashTable * ht)
}
static void
-_album_tabulator (gpointer id, DmapRecord * record, GHashTable * ht)
+_album_tabulator (G_GNUC_UNUSED gpointer id, DmapRecord * record, GHashTable * ht)
{
const gchar *album;
@@ -843,10 +835,9 @@ _add_to_category_listing (gpointer key, gpointer user_data)
static void
_databases_browse_xxx (DmapShare * share,
- SoupServer * server,
SoupMessage * msg,
const char *path,
- GHashTable * query, SoupClientContext * context)
+ GHashTable * query)
{
/* ABRO database browse
* MSTT status
@@ -931,8 +922,7 @@ static void
_databases_items_xxx (DmapShare * share,
SoupServer * server,
SoupMessage * msg,
- const char *path,
- GHashTable * query, SoupClientContext * context)
+ const char *path)
{
DmapDb *db = NULL;
DmapAvRecord *record = NULL;
@@ -1011,7 +1001,7 @@ done:
}
static struct DmapMetaDataMap *
-_get_meta_data_map (DmapShare * share)
+_get_meta_data_map (G_GNUC_UNUSED DmapShare * share)
{
return _meta_data_map;
}
@@ -1285,7 +1275,7 @@ END_TEST
static int _status = DMAP_STATUS_OK;
static void
-_error_cb(DmapShare *share, GError *error, gpointer user_data)
+_error_cb(G_GNUC_UNUSED DmapShare *share, GError *error, G_GNUC_UNUSED gpointer user_data)
{
_status = error->code;
}
@@ -1380,7 +1370,6 @@ START_TEST(dmap_av_share_server_info_test)
{
char *nameprop = "dmap_av_share_server_info_test";
DmapShare *share;
- SoupServer *server;
SoupMessage *message;
SoupMessageBody *body;
SoupBuffer *buffer;
@@ -1390,13 +1379,12 @@ START_TEST(dmap_av_share_server_info_test)
DmapStructureItem *item;
share = _build_share_test(nameprop);
- server = soup_server_new(NULL, NULL);
message = soup_message_new(SOUP_METHOD_GET, "http://test/");
/* Causes auth. method to be set to DMAP_SHARE_AUTH_METHOD_PASSWORD. */
g_object_set(share, "password", "password", NULL);
- dmap_av_share_server_info(share, server, message, "/", NULL, NULL);
+ dmap_av_share_server_info(share, message, "/");
g_object_get(message, "response-body", &body, NULL);
buffer = soup_message_body_flatten(body);
@@ -1484,7 +1472,6 @@ START_TEST(_databases_browse_xxx_test)
{
char *nameprop = "databases_browse_xxx_test";
DmapShare *share;
- SoupServer *server;
SoupMessage *message;
GHashTable *query;
SoupMessageBody *body;
@@ -1495,13 +1482,12 @@ START_TEST(_databases_browse_xxx_test)
DmapStructureItem *item;
share = _build_share_test(nameprop);
- server = soup_server_new(NULL, NULL);
message = soup_message_new(SOUP_METHOD_GET, "http://test");
query = g_hash_table_new(g_str_hash, g_str_equal);
g_hash_table_insert(query, "filter", "");
- _databases_browse_xxx(share, server, message, "/db/1/browse/genres", query, NULL);
+ _databases_browse_xxx(share, message, "/db/1/browse/genres", query);
g_object_get(message, "response-body", &body, NULL);
buffer = soup_message_body_flatten(body);
@@ -1541,7 +1527,6 @@ START_TEST(_databases_browse_xxx_artists_test)
{
char *nameprop = "databases_browse_xxx_artists_test";
DmapShare *share;
- SoupServer *server;
SoupMessage *message;
GHashTable *query;
SoupMessageBody *body;
@@ -1551,13 +1536,12 @@ START_TEST(_databases_browse_xxx_artists_test)
GNode *root;
share = _build_share_test(nameprop);
- server = soup_server_new(NULL, NULL);
message = soup_message_new(SOUP_METHOD_GET, "http://test");
query = g_hash_table_new(g_str_hash, g_str_equal);
g_hash_table_insert(query, "filter", "");
- _databases_browse_xxx(share, server, message, "/db/1/browse/artists", query, NULL);
+ _databases_browse_xxx(share, message, "/db/1/browse/artists", query);
g_object_get(message, "response-body", &body, NULL);
buffer = soup_message_body_flatten(body);
@@ -1568,9 +1552,9 @@ START_TEST(_databases_browse_xxx_artists_test)
root = dmap_structure_find_node(root, DMAP_CC_MLIT);
ck_assert(NULL != root);
- ck_assert_str_eq("artist2",
- ((DmapStructureItem *) root->children->data)->content.data->v_pointer);
ck_assert_str_eq("artist1",
+ ((DmapStructureItem *) root->children->data)->content.data->v_pointer);
+ ck_assert_str_eq("artist2",
((DmapStructureItem *) root->next->children->data)->content.data->v_pointer);
g_object_unref(share);
@@ -1582,7 +1566,6 @@ START_TEST(_databases_browse_xxx_albums_test)
{
char *nameprop = "databases_browse_xxx_albums_test";
DmapShare *share;
- SoupServer *server;
SoupMessage *message;
GHashTable *query;
SoupMessageBody *body;
@@ -1592,13 +1575,12 @@ START_TEST(_databases_browse_xxx_albums_test)
GNode *root;
share = _build_share_test(nameprop);
- server = soup_server_new(NULL, NULL);
message = soup_message_new(SOUP_METHOD_GET, "http://test");
query = g_hash_table_new(g_str_hash, g_str_equal);
g_hash_table_insert(query, "filter", "");
- _databases_browse_xxx(share, server, message, "/db/1/browse/albums", query, NULL);
+ _databases_browse_xxx(share, message, "/db/1/browse/albums", query);
g_object_get(message, "response-body", &body, NULL);
buffer = soup_message_body_flatten(body);
@@ -1609,9 +1591,9 @@ START_TEST(_databases_browse_xxx_albums_test)
root = dmap_structure_find_node(root, DMAP_CC_MLIT);
ck_assert(NULL != root);
- ck_assert_str_eq("album2",
- ((DmapStructureItem *) root->children->data)->content.data->v_pointer);
ck_assert_str_eq("album1",
+ ((DmapStructureItem *) root->children->data)->content.data->v_pointer);
+ ck_assert_str_eq("album2",
((DmapStructureItem *) root->next->children->data)->content.data->v_pointer);
g_object_unref(share);
@@ -1623,7 +1605,6 @@ START_TEST(_databases_browse_xxx_bad_category_test)
{
char *nameprop = "databases_browse_xxx_bad_category_test";
DmapShare *share;
- SoupServer *server;
SoupMessage *message;
GHashTable *query;
SoupMessageBody *body;
@@ -1633,13 +1614,12 @@ START_TEST(_databases_browse_xxx_bad_category_test)
GNode *root;
share = _build_share_test(nameprop);
- server = soup_server_new(NULL, NULL);
message = soup_message_new(SOUP_METHOD_GET, "http://test");
query = g_hash_table_new(g_str_hash, g_str_equal);
g_hash_table_insert(query, "filter", "");
- _databases_browse_xxx(share, server, message, "/db/1/browse/bad_category", query, NULL);
+ _databases_browse_xxx(share, message, "/db/1/browse/bad_category", query);
g_object_get(message, "response-body", &body, NULL);
buffer = soup_message_body_flatten(body);
@@ -1677,7 +1657,7 @@ START_TEST(_databases_items_xxx_test)
g_snprintf(path, sizeof path, "/db/1/items/%d", G_MAXINT);
- _databases_items_xxx(share, server, message, path, NULL, NULL);
+ _databases_items_xxx(share, server, message, path);
g_object_get(share, "db", &db, NULL);
ck_assert(NULL != db);
@@ -1691,7 +1671,7 @@ START_TEST(_databases_items_xxx_test)
g_signal_emit_by_name(message, "wrote_headers", NULL);
- for (int i = 0; i < size1 / DMAP_SHARE_CHUNK_SIZE + 1; i++) {
+ for (guint64 i = 0; i < size1 / DMAP_SHARE_CHUNK_SIZE + 1; i++) {
g_signal_emit_by_name(message, "wrote_chunk", NULL);
}
@@ -1736,7 +1716,7 @@ START_TEST(_databases_items_xxx_test_bad_id)
_status = DMAP_STATUS_OK;
g_signal_connect(share, "error", G_CALLBACK(_error_cb), NULL);
- _databases_items_xxx(share, server, message, path, NULL, NULL);
+ _databases_items_xxx(share, server, message, path);
ck_assert_int_eq(DMAP_STATUS_DB_BAD_ID, _status);
g_object_unref(share);
diff --git a/libdmapsharing/dmap-connection-private.h b/libdmapsharing/dmap-connection-private.h
index ea30bce..f7d000b 100644
--- a/libdmapsharing/dmap-connection-private.h
+++ b/libdmapsharing/dmap-connection-private.h
@@ -25,9 +25,13 @@
#ifndef _DMAP_CONNECTION_PRIVATE_H
#define _DMAP_CONNECTION_PRIVATE_H
+typedef void (*DmapResponseHandler) (DmapConnection * connection,
+ guint status,
+ GNode * structure,
+ gpointer user_data);
+
gboolean dmap_connection_get (DmapConnection * self,
const gchar * path,
- gboolean need_hash,
DmapResponseHandler handler,
gpointer user_data);
diff --git a/libdmapsharing/dmap-connection.c b/libdmapsharing/dmap-connection.c
index 9661d3f..8eb5c25 100644
--- a/libdmapsharing/dmap-connection.c
+++ b/libdmapsharing/dmap-connection.c
@@ -32,6 +32,7 @@
#include "dmap-md5.h"
#include "dmap-connection.h"
+#include "dmap-connection-private.h"
#include "dmap-error.h"
#include "dmap-record-factory.h"
#include "dmap-marshal.h"
@@ -144,8 +145,7 @@ _dispose (GObject * object)
DmapPlaylist *playlist = l->data;
/* FIXME: refstring: */
- g_list_foreach (playlist->uris, (GFunc) g_free, NULL);
- g_list_free (playlist->uris);
+ g_list_free_full (playlist->uris, g_free);
g_free (playlist->name);
g_free (playlist);
l->data = NULL;
@@ -523,10 +523,7 @@ _connection_operation_done (DmapConnection * connection)
static SoupMessage *
_build_message (DmapConnection * connection,
- const char *path,
- gboolean need_hash,
- gdouble version,
- gint req_id, gboolean send_close)
+ const char *path)
{
SoupMessage *message = NULL;
SoupURI *base_uri = NULL;
@@ -566,7 +563,7 @@ done:
#ifdef HAVE_LIBZ
static void *
-_zalloc_wrapper (voidpf opaque, uInt items, uInt size)
+_zalloc_wrapper (G_GNUC_UNUSED voidpf opaque, uInt items, uInt size)
{
void *fnval = Z_NULL;
@@ -584,7 +581,7 @@ done:
}
static void
-_zfree_wrapper (voidpf opaque, voidpf address)
+_zfree_wrapper (G_GNUC_UNUSED voidpf opaque, voidpf address)
{
g_free (address);
}
@@ -625,7 +622,7 @@ _emit_progress_idle (DmapConnection * connection)
return FALSE;
}
-static void
+static gpointer
_actual_http_response_handler (DmapResponseData * data)
{
DmapConnectionPrivate *priv;
@@ -819,13 +816,15 @@ _actual_http_response_handler (DmapResponseData * data)
g_object_unref (G_OBJECT (data->connection));
g_object_unref (G_OBJECT (data->message));
g_free (data);
+
+ return NULL;
}
static void
-_http_response_handler (SoupSession * session,
+_http_response_handler (G_GNUC_UNUSED SoupSession * session,
SoupMessage * message, DmapResponseData * data)
{
- int response_length;
+ goffset response_length;
if (message->status_code == SOUP_STATUS_CANCELLED) {
g_debug ("Message cancelled");
@@ -862,10 +861,6 @@ _http_response_handler (SoupSession * session,
static gboolean
_http_get (DmapConnection * connection,
const char *path,
- gboolean need_hash,
- gdouble version,
- gint req_id,
- gboolean send_close,
DmapResponseHandler handler,
gpointer user_data, gboolean use_thread)
{
@@ -874,8 +869,7 @@ _http_get (DmapConnection * connection,
DmapResponseData *data;
SoupMessage *message;
- message = _build_message (connection, path, need_hash,
- version, req_id, send_close);
+ message = _build_message (connection, path);
if (message == NULL) {
g_debug ("Error building message for http://%s:%d/%s",
priv->base_uri->host, priv->base_uri->port, path);
@@ -906,12 +900,10 @@ done:
gboolean
dmap_connection_get (DmapConnection * self,
const gchar * path,
- gboolean need_hash,
DmapResponseHandler handler, gpointer user_data)
{
- return _http_get (self, path, need_hash,
- self->priv->dmap_version, 0, FALSE,
- (DmapResponseHandler) handler, user_data, FALSE);
+ return _http_get (self, path, (DmapResponseHandler) handler, user_data,
+ FALSE);
}
static void
@@ -977,8 +969,8 @@ _state_done (DmapConnection * connection, gboolean result)
}
static void
-_handle_server_info (DmapConnection * connection,
- guint status, GNode * structure, gpointer user_data)
+_handle_server_info (DmapConnection * connection, guint status,
+ GNode * structure, G_GNUC_UNUSED gpointer user_data)
{
gboolean ok = FALSE;
DmapConnectionPrivate *priv = connection->priv;
@@ -1006,8 +998,8 @@ done:
}
static void
-_handle_login (DmapConnection * connection,
- guint status, GNode * structure, gpointer user_data)
+_handle_login (DmapConnection * connection, guint status, GNode * structure,
+ G_GNUC_UNUSED gpointer user_data)
{
gboolean ok = FALSE;
DmapConnectionPrivate *priv = connection->priv;
@@ -1047,8 +1039,8 @@ done:
}
static void
-_handle_update (DmapConnection * connection,
- guint status, GNode * structure, gpointer user_data)
+_handle_update (DmapConnection * connection, guint status, GNode * structure,
+ G_GNUC_UNUSED gpointer user_data)
{
gboolean ok = FALSE;
DmapConnectionPrivate *priv = connection->priv;
@@ -1075,8 +1067,8 @@ done:
}
static void
-_handle_database_info (DmapConnection * connection,
- guint status, GNode * structure, gpointer user_data)
+_handle_database_info (DmapConnection * connection, guint status,
+ GNode * structure, G_GNUC_UNUSED gpointer user_data)
{
gboolean ok = FALSE;
DmapConnectionPrivate *priv = connection->priv;
@@ -1124,8 +1116,8 @@ done:
}
static void
-_handle_song_listing (DmapConnection * connection,
- guint status, GNode * structure, gpointer user_data)
+_handle_song_listing (DmapConnection * connection, guint status,
+ GNode * structure, G_GNUC_UNUSED gpointer user_data)
{
gboolean ok = FALSE;
DmapConnectionPrivate *priv = connection->priv;
@@ -1269,8 +1261,8 @@ _compare_playlists_by_name (gconstpointer a, gconstpointer b)
*/
static void
-_handle_playlists (DmapConnection * connection,
- guint status, GNode * structure, gpointer user_data)
+_handle_playlists (DmapConnection * connection, guint status,
+ GNode * structure, G_GNUC_UNUSED gpointer user_data)
{
gboolean ok = FALSE;
DmapConnectionPrivate *priv = connection->priv;
@@ -1335,8 +1327,8 @@ done:
}
static void
-_handle_playlist_entries (DmapConnection * connection,
- guint status, GNode * structure, gpointer user_data)
+_handle_playlist_entries (DmapConnection * connection, guint status,
+ GNode * structure, G_GNUC_UNUSED gpointer user_data)
{
gboolean ok = FALSE;
DmapConnectionPrivate *priv = connection->priv;
@@ -1399,8 +1391,8 @@ done:
}
static void
-_handle_logout (DmapConnection * connection,
- guint status, GNode * structure, gpointer user_data)
+_handle_logout (DmapConnection * connection, G_GNUC_UNUSED guint status,
+ G_GNUC_UNUSED GNode * structure, G_GNUC_UNUSED gpointer user_data)
{
_connection_disconnected (connection);
@@ -1437,7 +1429,7 @@ _do_something (DmapConnection * connection)
case DMAP_GET_INFO:
g_debug ("Getting DMAP server info");
if (!_http_get
- (connection, "/server-info", FALSE, 0.0, 0, FALSE,
+ (connection, "/server-info",
(DmapResponseHandler) _handle_server_info, NULL, FALSE)) {
g_debug ("Could not get DMAP connection info");
_state_done (connection, FALSE);
@@ -1447,7 +1439,7 @@ _do_something (DmapConnection * connection)
case DMAP_LOGIN:
// NOTE: libsoup will signal if password required and not present.
g_debug ("Logging into DMAP server");
- if (!_http_get (connection, "/login", FALSE, 0.0, 0, FALSE,
+ if (!_http_get (connection, "/login",
(DmapResponseHandler) _handle_login, NULL,
FALSE)) {
g_debug ("Could not login to DMAP server");
@@ -1462,7 +1454,7 @@ _do_something (DmapConnection * connection)
("/update?session-id=%u&revision-number=1",
priv->session_id);
if (!_http_get
- (connection, path, TRUE, priv->dmap_version, 0, FALSE,
+ (connection, path,
(DmapResponseHandler) _handle_update, NULL, FALSE)) {
g_debug ("Could not get server database revision number");
_state_done (connection, FALSE);
@@ -1476,7 +1468,7 @@ _do_something (DmapConnection * connection)
("/databases?session-id=%u&revision-number=%d",
priv->session_id, priv->revision_number);
if (!_http_get
- (connection, path, TRUE, priv->dmap_version, 0, FALSE,
+ (connection, path,
(DmapResponseHandler) _handle_database_info, NULL,
FALSE)) {
g_debug ("Could not get DMAP database info");
@@ -1494,7 +1486,7 @@ _do_something (DmapConnection * connection)
"&meta=%s", priv->database_id, priv->session_id,
priv->revision_number, meta);
if (!_http_get
- (connection, path, TRUE, priv->dmap_version, 0, FALSE,
+ (connection, path,
(DmapResponseHandler) _handle_song_listing, NULL, TRUE)) {
g_debug ("Could not get DMAP song listing");
_state_done (connection, FALSE);
@@ -1510,7 +1502,7 @@ _do_something (DmapConnection * connection)
priv->database_id, priv->session_id,
priv->revision_number);
if (!_http_get
- (connection, path, TRUE, priv->dmap_version, 0, FALSE,
+ (connection, path,
(DmapResponseHandler) _handle_playlists, NULL, TRUE)) {
g_debug ("Could not get DMAP playlists");
_state_done (connection, FALSE);
@@ -1533,8 +1525,7 @@ _do_something (DmapConnection * connection)
priv->database_id, playlist->id,
priv->session_id, priv->revision_number);
if (!_http_get
- (connection, path, TRUE, priv->dmap_version, 0,
- FALSE,
+ (connection, path,
(DmapResponseHandler) _handle_playlist_entries,
NULL, TRUE)) {
g_debug ("Could not get entries for DMAP playlist %d",
priv->reading_playlist);
@@ -1550,7 +1541,7 @@ _do_something (DmapConnection * connection)
path = g_strdup_printf ("/logout?session-id=%u",
priv->session_id);
if (!_http_get
- (connection, path, TRUE, priv->dmap_version, 0, FALSE,
+ (connection, path,
(DmapResponseHandler) _handle_logout, NULL, FALSE)) {
g_debug ("Could not log out of DMAP server");
_state_done (connection, FALSE);
@@ -1856,7 +1847,8 @@ dmap_connection_emit_error(DmapConnection *connection, gint code,
static int _status = DMAP_STATUS_OK;
static void
-_error_cb(DmapConnection *share, GError *error, gpointer user_data)
+_error_cb(G_GNUC_UNUSED DmapConnection *connection, GError *error,
+ G_GNUC_UNUSED gpointer user_data)
{
_status = error->code;
}
diff --git a/libdmapsharing/dmap-connection.h b/libdmapsharing/dmap-connection.h
index dd712b6..e9f2cab 100644
--- a/libdmapsharing/dmap-connection.h
+++ b/libdmapsharing/dmap-connection.h
@@ -147,14 +147,10 @@ typedef struct {
} DmapConnectionClass;
/* hmm, maybe should give more error information? */
-typedef gboolean (*DmapConnectionFunc) (DmapConnection * connection,
- gboolean result,
- const char *reason,
- gpointer user_data);
-
-typedef void (*DmapResponseHandler) (DmapConnection * connection,
- guint status,
- GNode * structure, gpointer user_data);
+typedef void (*DmapConnectionFunc) (DmapConnection * connection,
+ gboolean result,
+ const char *reason,
+ gpointer user_data);
GType dmap_connection_get_type (void);
diff --git a/libdmapsharing/dmap-container-db.c b/libdmapsharing/dmap-container-db.c
index c547fe0..f50c49f 100644
--- a/libdmapsharing/dmap-container-db.c
+++ b/libdmapsharing/dmap-container-db.c
@@ -21,7 +21,7 @@
#include <libdmapsharing/dmap-container-db.h>
static void
-dmap_container_db_default_init (DmapContainerDbInterface * iface)
+dmap_container_db_default_init (G_GNUC_UNUSED DmapContainerDbInterface * iface)
{
}
diff --git a/libdmapsharing/dmap-container-db.h b/libdmapsharing/dmap-container-db.h
index 37ad40a..a89ec58 100644
--- a/libdmapsharing/dmap-container-db.h
+++ b/libdmapsharing/dmap-container-db.h
@@ -72,7 +72,7 @@ typedef struct _DmapContainerDbInterface DmapContainerDbInterface;
*
* The type of function passed to dmap_container_db_foreach().
*/
-typedef void (*DmapIdContainerRecordFunc) (guint id, DmapContainerRecord *record, gpointer user_data);
+typedef void (*DmapIdContainerRecordFunc) (gpointer id, DmapContainerRecord *record, gpointer user_data);
struct _DmapContainerDbInterface
{
diff --git a/libdmapsharing/dmap-control-connection.c b/libdmapsharing/dmap-control-connection.c
index d290299..f01ae24 100644
--- a/libdmapsharing/dmap-control-connection.c
+++ b/libdmapsharing/dmap-control-connection.c
@@ -26,7 +26,7 @@
#define DMAP_CONTROL_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DACP_TYPE_CONNECTION,
DmapControlConnectionPrivate))
static DmapContentCode
-_get_protocol_version_cc (DmapConnection * connection)
+_get_protocol_version_cc (G_GNUC_UNUSED DmapConnection * connection)
{
/* FIXME: */
g_error ("Not implemented");
@@ -34,7 +34,7 @@ _get_protocol_version_cc (DmapConnection * connection)
}
static gchar *
-_get_query_metadata (DmapConnection * connection)
+_get_query_metadata (G_GNUC_UNUSED DmapConnection * connection)
{
/* FIXME: */
g_error ("Not implemented");
@@ -42,8 +42,10 @@ _get_query_metadata (DmapConnection * connection)
}
static DmapRecord *
-_handle_mlcl (DmapConnection * connection, DmapRecordFactory * factory,
- GNode * n, int *item_id)
+_handle_mlcl (G_GNUC_UNUSED DmapConnection * connection,
+ G_GNUC_UNUSED DmapRecordFactory * factory,
+ G_GNUC_UNUSED GNode * n,
+ G_GNUC_UNUSED int *item_id)
{
/* FIXME: */
g_error ("Not implemented");
@@ -82,9 +84,7 @@ dmap_control_connection_new (const char *name,
static void
dmap_control_connection_init (DmapControlConnection * connection)
{
- /* FIXME:
- * connection->priv = DMAP_CONTROL_CONNECTION_GET_PRIVATE (connection);
- */
+ connection->priv = DMAP_CONTROL_CONNECTION_GET_PRIVATE (connection);
}
G_DEFINE_TYPE (DmapControlConnection, dmap_control_connection, DMAP_TYPE_CONNECTION);
diff --git a/libdmapsharing/dmap-control-share.c b/libdmapsharing/dmap-control-share.c
index 5668f90..931c98e 100644
--- a/libdmapsharing/dmap-control-share.c
+++ b/libdmapsharing/dmap-control-share.c
@@ -54,7 +54,6 @@ void dmap_control_share_ctrl_int (DmapShare * share,
const char *path,
GHashTable * query, SoupClientContext * context);
void dmap_control_share_login (DmapShare * share,
- SoupServer * server,
SoupMessage * message,
const char *path,
GHashTable * query, SoupClientContext * context);
@@ -236,7 +235,7 @@ _finalize (GObject * object)
}
const char *
-dmap_control_share_get_type_of_service (DmapShare * share)
+dmap_control_share_get_type_of_service (G_GNUC_UNUSED DmapShare * share)
{
return DACP_TYPE_OF_SERVICE;
}
@@ -386,7 +385,7 @@ dmap_control_share_init (DmapControlShare * share)
}
static void
-_mdns_remote_added (DmapMdnsBrowser * browser,
+_mdns_remote_added (G_GNUC_UNUSED DmapMdnsBrowser * browser,
DmapMdnsService * service, DmapControlShare * share)
{
gboolean new;
@@ -423,7 +422,7 @@ _mdns_remote_added (DmapMdnsBrowser * browser,
}
static void
-_mdns_remote_removed (DmapMdnsBrowser * browser,
+_mdns_remote_removed (G_GNUC_UNUSED DmapMdnsBrowser * browser,
const char *service_name, DmapControlShare * share)
{
gboolean found;
@@ -471,7 +470,7 @@ dmap_control_share_start_lookup (DmapControlShare * share, GError **error)
}
static gboolean
-_remove_remotes_cb (gpointer service_name, gpointer remote_info,
+_remove_remotes_cb (gpointer service_name, G_GNUC_UNUSED gpointer remote_info,
gpointer share)
{
g_signal_emit ((DmapControlShare *) share,
@@ -612,14 +611,13 @@ _status_update_message_finished (SoupMessage * message, DmapControlShare * share
}
static void
-_debug_param (gpointer key, gpointer val, gpointer user_data)
+_debug_param (gpointer key, gpointer val, G_GNUC_UNUSED gpointer user_data)
{
g_debug ("%s %s", (char *) key, (char *) val);
}
void
dmap_control_share_login (DmapShare * share,
- SoupServer * server,
SoupMessage * message,
const char *path,
GHashTable * query, SoupClientContext * context)
@@ -647,15 +645,16 @@ dmap_control_share_login (DmapShare * share,
}
}
- dmap_share_login (share, server, message, path, query, context);
+ dmap_share_login (share, message, path, query, context);
}
void
dmap_control_share_ctrl_int (DmapShare * share,
- SoupServer * server,
- SoupMessage * message,
- const char *path,
- GHashTable * query, SoupClientContext * context)
+ SoupServer * server,
+ SoupMessage * message,
+ const char *path,
+ GHashTable * query,
+ SoupClientContext * context)
{
const char *rest_of_path;
@@ -673,7 +672,7 @@ dmap_control_share_ctrl_int (DmapShare * share,
if ((rest_of_path != NULL)
&&
(!dmap_share_session_id_validate
- (share, context, message, query, NULL))) {
+ (share, context, query, NULL))) {
soup_message_set_status (message, SOUP_STATUS_FORBIDDEN);
goto done;
}
@@ -973,7 +972,7 @@ done:
#define PASSCODE_LENGTH 4
static gchar *
-_pairing_code (DmapControlShare * share, gchar * pair_txt, gchar passcode[4])
+_pairing_code (gchar * pair_txt, gchar passcode[4])
{
int i;
gsize ssize, dsize;
@@ -1092,7 +1091,7 @@ dmap_control_share_pair (DmapControlShare * share, gchar * service_name, gchar p
dmap_connection_setup (remote_info->connection);
/* Get the remote path for pairing */
- pairing_code = _pairing_code (share, remote_info->pair_txt, passcode);
+ pairing_code = _pairing_code (remote_info->pair_txt, passcode);
path = g_strdup_printf ("/pair?pairingcode=%s&servicename=%s",
pairing_code, name);
g_free (pairing_code);
@@ -1101,7 +1100,7 @@ dmap_control_share_pair (DmapControlShare * share, gchar * service_name, gchar p
remote_info->port, path);
/* Let DmapConnection do the heavy lifting. */
- ok = dmap_connection_get (remote_info->connection, path, FALSE,
+ ok = dmap_connection_get (remote_info->connection, path,
_connection_handler_cb, share);
if (!ok) {
g_debug("Error pairing remote");
diff --git a/libdmapsharing/dmap-db.c b/libdmapsharing/dmap-db.c
index 433af05..621f705 100644
--- a/libdmapsharing/dmap-db.c
+++ b/libdmapsharing/dmap-db.c
@@ -30,7 +30,7 @@ typedef struct FilterData
} FilterData;
static void
-dmap_db_default_init (DmapDbInterface * iface)
+dmap_db_default_init (G_GNUC_UNUSED DmapDbInterface * iface)
{
}
@@ -170,7 +170,7 @@ done:
}
static void
-_apply_filter (guint id, DmapRecord * record, gpointer data)
+_apply_filter (gpointer id, DmapRecord * record, gpointer data)
{
g_assert(IS_DMAP_RECORD (record));
@@ -182,8 +182,7 @@ _apply_filter (guint id, DmapRecord * record, gpointer data)
fd = data;
if (fd->filter_def == NULL) {
- g_hash_table_insert (fd->ht, GUINT_TO_POINTER (id),
- g_object_ref (record));
+ g_hash_table_insert (fd->ht, id, g_object_ref (record));
goto done;
}
@@ -237,7 +236,7 @@ _apply_filter (guint id, DmapRecord * record, gpointer data)
}
}
if (accept) {
- g_hash_table_insert (fd->ht, GUINT_TO_POINTER (id),
+ g_hash_table_insert (fd->ht, id,
g_object_ref (record));
}
diff --git a/libdmapsharing/dmap-db.h b/libdmapsharing/dmap-db.h
index 25b64df..ac6b292 100644
--- a/libdmapsharing/dmap-db.h
+++ b/libdmapsharing/dmap-db.h
@@ -83,7 +83,7 @@ typedef struct _DmapDbInterface DmapDbInterface;
*
* The type of function passed to dmap_db_foreach().
*/
-typedef void (*DmapIdRecordFunc) (guint id, DmapRecord *record, gpointer user_data);
+typedef void (*DmapIdRecordFunc) (gpointer id, DmapRecord *record, gpointer user_data);
struct _DmapDbInterface
{
diff --git a/libdmapsharing/dmap-gst-input-stream.c b/libdmapsharing/dmap-gst-input-stream.c
index 3cc74f2..df4e34d 100644
--- a/libdmapsharing/dmap-gst-input-stream.c
+++ b/libdmapsharing/dmap-gst-input-stream.c
@@ -52,7 +52,7 @@ struct DmapGstInputStreamPrivate
DmapGstInputStreamPrivate))
static goffset
-_tell (GSeekable * seekable)
+_tell (G_GNUC_UNUSED GSeekable * seekable)
{
/* FIXME: implement return current position in stream. */
g_error ("Not implemented");
@@ -60,16 +60,17 @@ _tell (GSeekable * seekable)
}
static gboolean
-_can_seek (GSeekable * seekable)
+_can_seek (G_GNUC_UNUSED GSeekable * seekable)
{
return TRUE;
}
static gboolean
-_seek (GSeekable * seekable,
- goffset offset,
+_seek (G_GNUC_UNUSED GSeekable * seekable,
+ G_GNUC_UNUSED goffset offset,
GSeekType type,
- GCancellable * cacellable, GError ** error)
+ G_GNUC_UNUSED GCancellable * cacellable,
+ GError ** error)
{
gboolean ok = FALSE;
// FIXME: implement: DmapGstInputStream *stream;
@@ -130,15 +131,16 @@ done:
}
static gboolean
-_can_truncate (GSeekable * seekable)
+_can_truncate (G_GNUC_UNUSED GSeekable * seekable)
{
return FALSE;
}
static gboolean
-_truncate (GSeekable * seekable,
- goffset offset,
- GCancellable * cancellable, GError ** error)
+_truncate (G_GNUC_UNUSED GSeekable * seekable,
+ G_GNUC_UNUSED goffset offset,
+ G_GNUC_UNUSED GCancellable * cancellable,
+ GError ** error)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
"Cannot truncate DmapGstInputStream");
@@ -282,9 +284,10 @@ static gssize
_read (GInputStream * stream,
void *buffer,
gsize count,
- GCancellable * cancellable, GError ** error)
+ G_GNUC_UNUSED GCancellable * cancellable,
+ G_GNUC_UNUSED GError ** error)
{
- int i;
+ gsize i;
DmapGstInputStream *gst_stream = DMAP_GST_INPUT_STREAM (stream);
gint64 end_time;
@@ -328,8 +331,10 @@ _read (GInputStream * stream,
}
static gssize
-_skip (GInputStream * stream, gsize count, GCancellable * cancellable,
- GError ** error)
+_skip (G_GNUC_UNUSED GInputStream * stream,
+ G_GNUC_UNUSED gsize count,
+ G_GNUC_UNUSED GCancellable * cancellable,
+ G_GNUC_UNUSED GError ** error)
{
g_error ("Not implemented");
return 0;
@@ -343,7 +348,8 @@ _kill_pipeline (DmapGstInputStream * stream)
static gboolean
_close (GInputStream * stream,
- GCancellable * cancellable, GError ** error)
+ G_GNUC_UNUSED GCancellable * cancellable,
+ G_GNUC_UNUSED GError ** error)
{
DmapGstInputStream *gst_stream = DMAP_GST_INPUT_STREAM (stream);
@@ -360,54 +366,60 @@ _close (GInputStream * stream,
}
static gssize
-_read_finish (GInputStream * stream,
- GAsyncResult * result, GError ** error)
+_read_finish (G_GNUC_UNUSED GInputStream * stream,
+ G_GNUC_UNUSED GAsyncResult * result,
+ G_GNUC_UNUSED GError ** error)
{
g_error ("Not implemented");
return 0;
}
static gssize
-_skip_finish (GInputStream * stream,
- GAsyncResult * result, GError ** error)
+_skip_finish (G_GNUC_UNUSED GInputStream * stream,
+ G_GNUC_UNUSED GAsyncResult * result,
+ G_GNUC_UNUSED GError ** error)
{
g_error ("Not implemented");
return 0;
}
static void
-_close_async (GInputStream * stream,
- int io_priority,
- GCancellable * cancellabl,
- GAsyncReadyCallback callback,
- gpointer data)
+_close_async (G_GNUC_UNUSED GInputStream * stream,
+ G_GNUC_UNUSED int io_priority,
+ G_GNUC_UNUSED GCancellable * cancellable,
+ G_GNUC_UNUSED GAsyncReadyCallback callback,
+ G_GNUC_UNUSED gpointer data)
{
+ g_error ("Not implemented");
}
static void
-_read_async (GInputStream * stream,
- void *buffer,
- gsize count,
- int io_priority,
- GCancellable * cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+_read_async (G_GNUC_UNUSED GInputStream * stream,
+ G_GNUC_UNUSED void *buffer,
+ G_GNUC_UNUSED gsize count,
+ G_GNUC_UNUSED int io_priority,
+ G_GNUC_UNUSED GCancellable * cancellable,
+ G_GNUC_UNUSED GAsyncReadyCallback callback,
+ G_GNUC_UNUSED gpointer user_data)
{
+ g_error ("Not implemented");
}
static void
-_skip_async (GInputStream * stream,
- gsize count,
- int io_priority,
- GCancellable * cancellabl,
- GAsyncReadyCallback callback,
- gpointer datae)
+_skip_async (G_GNUC_UNUSED GInputStream * stream,
+ G_GNUC_UNUSED gsize count,
+ G_GNUC_UNUSED int io_priority,
+ G_GNUC_UNUSED GCancellable * cancellabl,
+ G_GNUC_UNUSED GAsyncReadyCallback callback,
+ G_GNUC_UNUSED gpointer datae)
{
+ g_error ("Not implemented");
}
static gboolean
-_close_finish (GInputStream * stream,
- GAsyncResult * result, GError ** error)
+_close_finish (G_GNUC_UNUSED GInputStream * stream,
+ G_GNUC_UNUSED GAsyncResult * result,
+ G_GNUC_UNUSED GError ** error)
{
g_error ("Not implemented");
return FALSE;
diff --git a/libdmapsharing/dmap-gst-mp3-input-stream.c b/libdmapsharing/dmap-gst-mp3-input-stream.c
index cc58bfa..000028f 100644
--- a/libdmapsharing/dmap-gst-mp3-input-stream.c
+++ b/libdmapsharing/dmap-gst-mp3-input-stream.c
@@ -39,7 +39,7 @@ struct DmapGstMP3InputStreamPrivate
};
static void
-_pad_added_cb (GstElement * element,
+_pad_added_cb (G_GNUC_UNUSED GstElement * element,
GstPad * pad,
GstElement *convert)
{
diff --git a/libdmapsharing/dmap-gst-qt-input-stream.c b/libdmapsharing/dmap-gst-qt-input-stream.c
index b2e605e..c714593 100644
--- a/libdmapsharing/dmap-gst-qt-input-stream.c
+++ b/libdmapsharing/dmap-gst-qt-input-stream.c
@@ -40,7 +40,7 @@ struct DmapGstQtInputStreamPrivate
};
static void
-_pad_added_cb (GstElement * element,
+_pad_added_cb (G_GNUC_UNUSED GstElement * element,
GstPad * pad,
GstElement *convert)
{
diff --git a/libdmapsharing/dmap-gst-wav-input-stream.c b/libdmapsharing/dmap-gst-wav-input-stream.c
index 5a6a321..82f72f9 100644
--- a/libdmapsharing/dmap-gst-wav-input-stream.c
+++ b/libdmapsharing/dmap-gst-wav-input-stream.c
@@ -40,7 +40,7 @@ struct DmapGstWavInputStreamPrivate
};
static void
-_pad_added_cb (GstElement * element,
+_pad_added_cb (G_GNUC_UNUSED GstElement * element,
GstPad * pad,
GstElement *convert)
{
diff --git a/libdmapsharing/dmap-image-connection.c b/libdmapsharing/dmap-image-connection.c
index 048dc4e..f938dfc 100644
--- a/libdmapsharing/dmap-image-connection.c
+++ b/libdmapsharing/dmap-image-connection.c
@@ -26,13 +26,13 @@
#define DMAP_IMAGE_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DMAP_TYPE_IMAGE_CONNECTION,
DmapImageConnectionPrivate))
static DmapContentCode
-_get_protocol_version_cc (DmapConnection * connection)
+_get_protocol_version_cc (G_GNUC_UNUSED DmapConnection * connection)
{
return DMAP_CC_PPRO;
}
static gchar *
-_get_query_metadata (DmapConnection * connection)
+_get_query_metadata (G_GNUC_UNUSED DmapConnection * connection)
{
return g_strdup ("all");
}
@@ -179,7 +179,7 @@ dmap_image_connection_new (const char *name,
}
static void
-dmap_image_connection_init (DmapImageConnection * connection)
+dmap_image_connection_init (G_GNUC_UNUSED DmapImageConnection * connection)
{
}
diff --git a/libdmapsharing/dmap-image-share.c b/libdmapsharing/dmap-image-share.c
index df3d440..55062c1 100644
--- a/libdmapsharing/dmap-image-share.c
+++ b/libdmapsharing/dmap-image-share.c
@@ -48,10 +48,8 @@
guint dmap_image_share_get_desired_port (DmapShare * share);
const char *dmap_image_share_get_type_of_service (DmapShare * share);
void dmap_image_share_server_info (DmapShare * share,
- SoupServer * server,
- SoupMessage * message,
- const char *path,
- GHashTable * query, SoupClientContext * context);
+ SoupMessage * message,
+ const char *path);
void dmap_image_share_message_add_standard_headers (DmapShare * share,
SoupMessage * message);
@@ -120,42 +118,8 @@ G_DEFINE_TYPE_WITH_CODE (DmapImageShare,
DMAP_TYPE_SHARE,
G_ADD_PRIVATE (DmapImageShare));
-static void
-_set_property (GObject * object,
- guint prop_id,
- const GValue * value, GParamSpec * pspec)
-{
- // DmapImageShare *share = DMAP_IMAGE_SHARE (object);
-
- switch (prop_id) {
- /* FIXME: */
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-_get_property (GObject * object,
- guint prop_id, GValue * value, GParamSpec * pspec)
-{
- // DmapImageShare *share = DMAP_IMAGE_SHARE (object);
-
- switch (prop_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-_dispose (GObject * object)
-{
- /* FIXME: implement in parent */
-}
-
static struct DmapMetaDataMap *
-_get_meta_data_map (DmapShare * share)
+_get_meta_data_map (G_GNUC_UNUSED DmapShare * share)
{
return _meta_data_map;
}
@@ -193,7 +157,7 @@ done:
}
static void
-_add_entry_to_mlcl (guint id, DmapRecord * record, gpointer _mb)
+_add_entry_to_mlcl (gpointer id, DmapRecord * record, gpointer _mb)
{
GNode *mlit;
struct DmapMlclBits *mb = (struct DmapMlclBits *) _mb;
@@ -206,7 +170,7 @@ _add_entry_to_mlcl (guint id, DmapRecord * record, gpointer _mb)
}
if (dmap_share_client_requested (mb->bits, ITEM_ID)) {
- dmap_structure_add (mlit, DMAP_CC_MIID, id);
+ dmap_structure_add (mlit, DMAP_CC_MIID, GPOINTER_TO_UINT(id));
}
if (dmap_share_client_requested (mb->bits, ITEM_NAME)) {
@@ -222,7 +186,7 @@ _add_entry_to_mlcl (guint id, DmapRecord * record, gpointer _mb)
}
if (dmap_share_client_requested (mb->bits, PERSISTENT_ID)) {
- dmap_structure_add (mlit, DMAP_CC_MPER, id);
+ dmap_structure_add (mlit, DMAP_CC_MPER, GPOINTER_TO_UINT(id));
}
if (TRUE) {
@@ -366,11 +330,10 @@ _add_entry_to_mlcl (guint id, DmapRecord * record, gpointer _mb)
}
static void
-_databases_browse_xxx (DmapShare * share,
- SoupServer * server,
- SoupMessage * msg,
- const char *path,
- GHashTable * query, SoupClientContext * context)
+_databases_browse_xxx (G_GNUC_UNUSED DmapShare * share,
+ G_GNUC_UNUSED SoupMessage * msg,
+ const char *path,
+ G_GNUC_UNUSED GHashTable *query)
{
g_warning ("Unhandled: %s", path);
}
@@ -434,8 +397,7 @@ static void
_databases_items_xxx (DmapShare * share,
SoupServer * server,
SoupMessage * msg,
- const char *path,
- GHashTable * query, SoupClientContext * context)
+ const char *path)
{
DmapDb *db;
const gchar *rest_of_path;
@@ -467,10 +429,6 @@ dmap_image_share_class_init (DmapImageShareClass * klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
DmapShareClass *parent_class = DMAP_SHARE_CLASS (object_class);
- object_class->get_property = _get_property;
- object_class->set_property = _set_property;
- object_class->dispose = _dispose;
-
parent_class->get_desired_port = dmap_image_share_get_desired_port;
parent_class->get_type_of_service = dmap_image_share_get_type_of_service;
parent_class->message_add_standard_headers =
@@ -497,7 +455,7 @@ dmap_image_share_new (const char *name,
const char *password,
gpointer db,
gpointer container_db,
- gchar * transcode_mimetype)
+ G_GNUC_UNUSED gchar * transcode_mimetype)
{
g_object_ref (db);
g_object_ref (container_db);
@@ -511,8 +469,8 @@ dmap_image_share_new (const char *name,
}
void
-dmap_image_share_message_add_standard_headers (DmapShare * share,
- SoupMessage * message)
+dmap_image_share_message_add_standard_headers (G_GNUC_UNUSED DmapShare * share,
+ SoupMessage * message)
{
soup_message_headers_append (message->response_headers, "DPAP-Server",
"libdmapsharing" VERSION);
@@ -523,23 +481,21 @@ dmap_image_share_message_add_standard_headers (DmapShare * share,
#define DPAP_TIMEOUT 1800
guint
-dmap_image_share_get_desired_port (DmapShare * share)
+dmap_image_share_get_desired_port (G_GNUC_UNUSED DmapShare * share)
{
return DPAP_PORT;
}
const char *
-dmap_image_share_get_type_of_service (DmapShare * share)
+dmap_image_share_get_type_of_service (G_GNUC_UNUSED DmapShare * share)
{
return DPAP_TYPE_OF_SERVICE;
}
void
dmap_image_share_server_info (DmapShare * share,
- SoupServer * server,
- SoupMessage * message,
- const char *path,
- GHashTable * query, SoupClientContext * context)
+ SoupMessage * message,
+ const char *path)
{
/* MSRV server info response
* MSTT status
diff --git a/libdmapsharing/dmap-md5.c b/libdmapsharing/dmap-md5.c
index e5cd2da..7e0e04f 100644
--- a/libdmapsharing/dmap-md5.c
+++ b/libdmapsharing/dmap-md5.c
@@ -460,7 +460,7 @@ dmap_md5_generate (short version_major,
{
unsigned char buf[16];
DmapHashContext ctx;
- gint i;
+ gsize i;
unsigned char *hashTable = (version_major == 3) ?
_45 : _42;
@@ -527,7 +527,7 @@ dmap_md5_progressive_final (DmapHashContext *context,
/* FIXME: This is only equivalent to dmap_md5_generate()
* when it is called with (3, x, 2, y, 0).
*/
- int i;
+ gsize i;
/* FIXME: Share this stuff with dmap_md5_generate() */
if (_ac_unfudged == FALSE) {
diff --git a/libdmapsharing/dmap-mdns-avahi.c b/libdmapsharing/dmap-mdns-avahi.c
index b39035d..84e0e0b 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 (G_GNUC_UNUSED 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 f124262..9a4bec8 100644
--- a/libdmapsharing/dmap-mdns-browser-avahi.c
+++ b/libdmapsharing/dmap-mdns-browser-avahi.c
@@ -95,7 +95,8 @@ static void _browse_cb (AvahiServiceBrowser * service_browser,
AvahiProtocol protocol,
AvahiBrowserEvent event,
const gchar * name,
- const gchar * type, const gchar * domain,
+ const gchar * type,
+ const gchar * domain,
#ifdef HAVE_AVAHI_0_6
AvahiLookupResultFlags flags,
#endif
@@ -157,6 +158,12 @@ dmap_mdns_browser_init (DmapMdnsBrowser * browser)
_client_init (browser);
}
+static void
+_avahi_service_resolver_free_adapter(gpointer data, G_GNUC_UNUSED gpointer user_data)
+{
+ avahi_service_resolver_free(data);
+}
+
static void
_dispose (GObject * object)
{
@@ -172,7 +179,8 @@ _dispose (GObject * object)
if (browser->priv->resolvers) {
g_slist_foreach (browser->priv->resolvers,
- (GFunc) avahi_service_resolver_free, NULL);
+ (GFunc) _avahi_service_resolver_free_adapter,
+ NULL);
g_slist_free (browser->priv->resolvers);
}
@@ -294,7 +302,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 */
@@ -343,17 +352,17 @@ _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)
{
@@ -510,11 +519,13 @@ _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 80f82f8..5e71551 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) {
@@ -327,7 +327,7 @@ 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);
@@ -376,28 +376,6 @@ dmap_mdns_publisher_withdraw (DmapMdnsPublisher * publisher,
return TRUE;
}
-static void
-_set_property (GObject * object, guint prop_id, const GValue * value,
- GParamSpec * pspec)
-{
- switch (prop_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-_get_property (GObject * object, guint prop_id, GValue * value,
- GParamSpec * pspec)
-{
- switch (prop_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
static GObject *
_constructor (GType type,
guint n_construct_params,
@@ -428,8 +406,6 @@ dmap_mdns_publisher_class_init (DmapMdnsPublisherClass * klass)
object_class->constructor = _constructor;
object_class->finalize = _finalize;
- object_class->get_property = _get_property;
- object_class->set_property = _set_property;
_signals[PUBLISHED] =
g_signal_new ("published",
diff --git a/libdmapsharing/dmap-private-utils.c b/libdmapsharing/dmap-private-utils.c
index 5a45436..66403bb 100644
--- a/libdmapsharing/dmap-private-utils.c
+++ b/libdmapsharing/dmap-private-utils.c
@@ -51,7 +51,7 @@ dmap_private_utils_write_next_chunk (SoupMessage * message, ChunkData * cd)
}
void
-dmap_private_utils_chunked_message_finished (SoupMessage * message, ChunkData * cd)
+dmap_private_utils_chunked_message_finished (G_GNUC_UNUSED SoupMessage * message, ChunkData * cd)
{
g_debug ("Finished sending chunked file.");
g_input_stream_close (cd->stream, NULL, NULL);
diff --git a/libdmapsharing/dmap-record-factory.c b/libdmapsharing/dmap-record-factory.c
index bfaabd2..6e87bcb 100644
--- a/libdmapsharing/dmap-record-factory.c
+++ b/libdmapsharing/dmap-record-factory.c
@@ -21,7 +21,7 @@
#include <libdmapsharing/dmap-record-factory.h>
static void
-dmap_record_factory_default_init (DmapRecordFactoryInterface * iface)
+dmap_record_factory_default_init (G_GNUC_UNUSED DmapRecordFactoryInterface * iface)
{
}
diff --git a/libdmapsharing/dmap-record.c b/libdmapsharing/dmap-record.c
index fe2b96d..3ce273a 100644
--- a/libdmapsharing/dmap-record.c
+++ b/libdmapsharing/dmap-record.c
@@ -21,7 +21,7 @@
#include <libdmapsharing/dmap-record.h>
static void
-dmap_record_default_init (DmapRecordInterface * iface)
+dmap_record_default_init (G_GNUC_UNUSED DmapRecordInterface * iface)
{
}
diff --git a/libdmapsharing/dmap-share-private.h b/libdmapsharing/dmap-share-private.h
index 5efa034..1ab955a 100644
--- a/libdmapsharing/dmap-share-private.h
+++ b/libdmapsharing/dmap-share-private.h
@@ -46,16 +46,13 @@ gboolean dmap_share_get_revision_number_from_query (GHashTable * query,
guint * number);
gboolean dmap_share_session_id_validate (DmapShare * share,
- SoupClientContext * context,
- SoupMessage * msg,
- GHashTable * query, guint32 * id);
+ SoupClientContext * context,
+ GHashTable * query,
+ guint32 * id);
guint32 dmap_share_session_id_create (DmapShare * share,
SoupClientContext * ctx);
-void dmap_share_session_id_remove (DmapShare * share,
- SoupClientContext * ctx, guint32 id);
-
gboolean dmap_share_client_requested (DmapBits bits, gint field);
gboolean dmap_share_uri_is_local (const char *text_uri);
@@ -81,29 +78,27 @@ GSList *dmap_share_build_filter (gchar * filterstr);
/* Virtual methods (libsoup callbacks with default implementation): */
void dmap_share_content_codes (DmapShare * share,
- SoupServer * server,
SoupMessage * message,
const char *path,
- GHashTable * query,
SoupClientContext * context);
void dmap_share_login (DmapShare * share,
- SoupServer * server,
- SoupMessage * message,
- const char *path,
- GHashTable * query, SoupClientContext * context);
+ SoupMessage * message,
+ const char *path,
+ GHashTable * query,
+ SoupClientContext * context);
void dmap_share_logout (DmapShare * share,
- SoupServer * server,
- SoupMessage * message,
- const char *path,
- GHashTable * query, SoupClientContext * context);
+ SoupMessage * message,
+ const char *path,
+ GHashTable * query,
+ SoupClientContext * context);
void dmap_share_update (DmapShare * share,
SoupServer * server,
SoupMessage * message,
const char *path,
- GHashTable * query, SoupClientContext * context);
+ GHashTable * query);
void dmap_share_databases (DmapShare * share,
SoupServer * server,
@@ -118,9 +113,6 @@ void dmap_share_ctrl_int (DmapShare * share,
GHashTable * query, SoupClientContext * context);
/* Virtual methods: MDNS callbacks */
-void dmap_share_published (DmapShare * share,
- DmapMdnsPublisher * publisher, const char *name);
-
void dmap_share_name_collision (DmapShare * share,
DmapMdnsPublisher * publisher,
const char *name);
diff --git a/libdmapsharing/dmap-share.c b/libdmapsharing/dmap-share.c
index 769e107..8c4fe27 100644
--- a/libdmapsharing/dmap-share.c
+++ b/libdmapsharing/dmap-share.c
@@ -124,7 +124,7 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (DmapShare,
DMAP_TYPE_SHARE, DmapSharePrivate));
static gboolean
-_soup_auth_callback (SoupAuthDomain * auth_domain,
+_soup_auth_callback (G_GNUC_UNUSED SoupAuthDomain * auth_domain,
SoupMessage * msg,
const char *username,
gpointer password,
@@ -143,73 +143,72 @@ _soup_auth_callback (SoupAuthDomain * auth_domain,
}
static void
-_server_info_adapter (SoupServer * server,
- SoupMessage * message,
- const char *path,
- GHashTable * query,
- SoupClientContext * context, DmapShare * share)
+_server_info_adapter (G_GNUC_UNUSED SoupServer * server,
+ SoupMessage * message,
+ const char *path,
+ G_GNUC_UNUSED GHashTable * query,
+ G_GNUC_UNUSED SoupClientContext * context,
+ DmapShare * share)
{
- DMAP_SHARE_GET_CLASS (share)->server_info (share,
- server,
- message,
- path, query, context);
+ DMAP_SHARE_GET_CLASS (share)->server_info (share, message, path);
}
static void
-_content_codes_adapter (SoupServer * server,
- SoupMessage * message,
- const char *path,
- GHashTable * query,
- SoupClientContext * context, DmapShare * share)
+_content_codes_adapter (G_GNUC_UNUSED SoupServer * server,
+ SoupMessage * message,
+ const char *path,
+ G_GNUC_UNUSED GHashTable * query,
+ G_GNUC_UNUSED SoupClientContext * context,
+ DmapShare * share)
{
DMAP_SHARE_GET_CLASS (share)->content_codes (share,
- server,
message,
- path, query, context);
+ path,
+ context);
}
static void
-_login_adapter (SoupServer * server,
+_login_adapter (G_GNUC_UNUSED SoupServer * server,
SoupMessage * message,
const char *path,
GHashTable * query,
- SoupClientContext * context, DmapShare * share)
+ SoupClientContext * context,
+ DmapShare * share)
{
- DMAP_SHARE_GET_CLASS (share)->login (share,
- server,
- message, path, query, context);
+ DMAP_SHARE_GET_CLASS (share)->login (share, message, path, query, context);
}
static void
-_logout_adapter (SoupServer * server,
- SoupMessage * message,
- const char *path,
- GHashTable * query,
- SoupClientContext * context, DmapShare * share)
+_logout_adapter (G_GNUC_UNUSED SoupServer * server,
+ SoupMessage * message,
+ const char *path,
+ GHashTable * query,
+ SoupClientContext * context,
+ DmapShare * share)
{
- DMAP_SHARE_GET_CLASS (share)->logout (share,
- server,
- message, path, query, context);
+ DMAP_SHARE_GET_CLASS (share)->logout (share, message, path, query, context);
}
static void
_update_adapter (SoupServer * server,
- SoupMessage * message,
- const char *path,
- GHashTable * query,
- SoupClientContext * context, DmapShare * share)
+ SoupMessage * message,
+ const char *path,
+ GHashTable * query,
+ G_GNUC_UNUSED SoupClientContext * context,
+ DmapShare * share)
{
DMAP_SHARE_GET_CLASS (share)->update (share,
server,
- message, path, query, context);
+ message, path, query);
}
static void
_databases_adapter (SoupServer * server,
- SoupMessage * message,
- const char *path,
- GHashTable * query,
- SoupClientContext * context, DmapShare * share)
+ SoupMessage * message,
+ const char *path,
+ GHashTable * query,
+ SoupClientContext * context,
+ DmapShare * share)
{
DMAP_SHARE_GET_CLASS (share)->databases (share,
server,
@@ -219,10 +218,11 @@ _databases_adapter (SoupServer * server,
static void
_ctrl_int_adapter (SoupServer * server,
- SoupMessage * message,
- const char *path,
- GHashTable * query,
- SoupClientContext * context, DmapShare * share)
+ SoupMessage * message,
+ const char *path,
+ GHashTable * query,
+ SoupClientContext * context,
+ DmapShare * share)
{
DMAP_SHARE_GET_CLASS (share)->ctrl_int (share,
server,
@@ -230,6 +230,76 @@ _ctrl_int_adapter (SoupServer * server,
path, query, context);
}
+static void
+_set_name (DmapShare * share, const char *name)
+{
+ GError *error;
+
+ g_return_if_fail (share != NULL);
+
+ g_free (share->priv->name);
+ share->priv->name = g_strdup (name);
+
+ if (share->priv->published) {
+ error = NULL;
+ dmap_mdns_publisher_rename_at_port (share->priv->
+ publisher,
+ share->priv->port,
+ name,
+ &error);
+ if (error != NULL) {
+ g_warning ("Unable to change MDNS service name: %s",
+ error->message);
+ g_error_free (error);
+ }
+ }
+}
+
+static void
+_published (DmapShare * share,
+ G_GNUC_UNUSED DmapMdnsPublisher * publisher,
+ const char *name)
+{
+ if (share->priv->name == NULL || name == NULL) {
+ return;
+ }
+
+ if (strcmp (share->priv->name, name) == 0) {
+ g_debug ("mDNS publish successful");
+ share->priv->published = TRUE;
+ }
+}
+
+static void
+_published_adapter (DmapMdnsPublisher * publisher,
+ const char *name,
+ DmapShare * share)
+{
+ DMAP_SHARE_GET_CLASS (share)->published (share, publisher, name);
+}
+
+static void
+_name_collision (DmapShare * share,
+ G_GNUC_UNUSED DmapMdnsPublisher * publisher,
+ const char *name)
+{
+ g_assert(NULL != name);
+ g_assert(NULL != share->priv->name);
+
+ g_warning ("Duplicate share name on mDNS; renaming share to %s", name);
+
+ _set_name (DMAP_SHARE (share), name);
+
+ return;
+}
+
+static void
+_name_collision_adapter (DmapMdnsPublisher * publisher,
+ const char *name, DmapShare * share)
+{
+ DMAP_SHARE_GET_CLASS (share)->name_collision (share, publisher, name);
+}
+
gboolean
dmap_share_serve (DmapShare *share, GError **error)
{
@@ -423,31 +493,6 @@ _maybe_restart (DmapShare * share)
}
}
-static void
-_set_name (DmapShare * share, const char *name)
-{
- GError *error;
-
- g_return_if_fail (share != NULL);
-
- g_free (share->priv->name);
- share->priv->name = g_strdup (name);
-
- if (share->priv->published) {
- error = NULL;
- dmap_mdns_publisher_rename_at_port (share->priv->
- publisher,
- share->priv->port,
- name,
- &error);
- if (error != NULL) {
- g_warning ("Unable to change MDNS service name: %s",
- error->message);
- g_error_free (error);
- }
- }
-}
-
static void
_set_password (DmapShare * share, const char *password)
{
@@ -617,8 +662,8 @@ dmap_share_class_init (DmapShareClass * klass)
klass->login = dmap_share_login;
klass->logout = dmap_share_logout;
klass->update = dmap_share_update;
- klass->published = dmap_share_published;
- klass->name_collision = dmap_share_name_collision;
+ klass->published = _published;
+ klass->name_collision = _name_collision;
klass->databases = dmap_share_databases;
klass->ctrl_int = dmap_share_ctrl_int;
@@ -709,20 +754,6 @@ dmap_share_class_init (DmapShareClass * klass)
G_TYPE_POINTER);
}
-static void
-_published_adapter (DmapMdnsPublisher * publisher,
- const char *name, DmapShare * share)
-{
- DMAP_SHARE_GET_CLASS (share)->published (share, publisher, name);
-}
-
-static void
-_name_collision_adapter (DmapMdnsPublisher * publisher,
- const char *name, DmapShare * share)
-{
- DMAP_SHARE_GET_CLASS (share)->name_collision (share, publisher, name);
-}
-
static void
dmap_share_init (DmapShare * share)
{
@@ -811,9 +842,8 @@ done:
gboolean
dmap_share_session_id_validate (DmapShare * share,
- SoupClientContext * context,
- SoupMessage * message,
- GHashTable * query, guint32 * id)
+ SoupClientContext * context,
+ GHashTable * query, guint32 * id)
{
gboolean ok = FALSE;
guint32 session_id;
@@ -861,7 +891,7 @@ done:
}
static guint32
-_session_id_generate (DmapShare * share, SoupClientContext * context)
+_session_id_generate (void)
{
guint32 id;
@@ -879,7 +909,7 @@ dmap_share_session_id_create (DmapShare * share, SoupClientContext * context)
do {
/* create a unique session id */
- id = _session_id_generate (share, context);
+ id = _session_id_generate ();
g_debug ("Generated session id %u", id);
/* if already used, try again */
@@ -901,7 +931,7 @@ dmap_share_session_id_create (DmapShare * share, SoupClientContext * context)
void
dmap_share_session_id_remove (DmapShare * share,
- SoupClientContext * context, guint32 id)
+ guint32 id)
{
g_hash_table_remove (share->priv->session_ids, GUINT_TO_POINTER (id));
}
@@ -943,8 +973,8 @@ dmap_share_uri_is_local (const char *text_uri)
}
gboolean
-dmap_share_soup_auth_filter (SoupAuthDomain * auth_domain,
- SoupMessage * msg, gpointer user_data)
+dmap_share_soup_auth_filter (G_GNUC_UNUSED SoupAuthDomain * auth_domain,
+ SoupMessage * msg, G_GNUC_UNUSED gpointer user_data)
{
gboolean ok = FALSE;
const char *path;
@@ -966,40 +996,11 @@ done:
return ok;
}
-void
-dmap_share_published (DmapShare * share,
- DmapMdnsPublisher * publisher, const char *name)
-{
- if (share->priv->name == NULL || name == NULL) {
- return;
- }
-
- if (strcmp (share->priv->name, name) == 0) {
- g_debug ("mDNS publish successful");
- share->priv->published = TRUE;
- }
-}
-
-void
-dmap_share_name_collision (DmapShare * share,
- DmapMdnsPublisher * publisher, const char *name)
-{
- g_assert(NULL != name);
- g_assert(NULL != share->priv->name);
-
- g_warning ("Duplicate share name on mDNS; renaming share to %s", name);
-
- _set_name (DMAP_SHARE (share), name);
-
- return;
-}
-
void
dmap_share_content_codes (DmapShare * share,
- SoupServer * server,
- SoupMessage * message,
- const char *path,
- GHashTable * query, SoupClientContext * context)
+ SoupMessage * message,
+ const char *path,
+ G_GNUC_UNUSED SoupClientContext * context)
{
/* MCCR content codes response
* MSTT status
@@ -1039,10 +1040,10 @@ dmap_share_content_codes (DmapShare * share,
void
dmap_share_login (DmapShare * share,
- SoupServer * server,
- SoupMessage * message,
- const char *path,
- GHashTable * query, SoupClientContext * context)
+ SoupMessage * message,
+ const char *path,
+ G_GNUC_UNUSED GHashTable * query,
+ SoupClientContext * context)
{
/* MLOG login response
* MSTT status
@@ -1065,10 +1066,9 @@ dmap_share_login (DmapShare * share,
void
dmap_share_logout (DmapShare * share,
- SoupServer * server,
- SoupMessage * message,
- const char *path,
- GHashTable * query, SoupClientContext * context)
+ SoupMessage * message,
+ const char *path,
+ GHashTable * query, SoupClientContext * context)
{
int status;
guint32 id;
@@ -1076,8 +1076,8 @@ dmap_share_logout (DmapShare * share,
g_debug ("Path is %s.", path);
if (dmap_share_session_id_validate
- (share, context, message, query, &id)) {
- dmap_share_session_id_remove (share, context, id);
+ (share, context, query, &id)) {
+ dmap_share_session_id_remove (share, id);
status = SOUP_STATUS_NO_CONTENT;
} else {
@@ -1092,7 +1092,7 @@ dmap_share_update (DmapShare * share,
SoupServer * server,
SoupMessage * message,
const char *path,
- GHashTable * query, SoupClientContext * context)
+ GHashTable * query)
{
guint revision_number;
gboolean res;
@@ -1182,8 +1182,9 @@ done:
}
void
-dmap_share_add_playlist_to_mlcl (gpointer id, DmapContainerRecord * record,
- gpointer _mb)
+dmap_share_add_playlist_to_mlcl (G_GNUC_UNUSED gpointer id,
+ DmapContainerRecord * record,
+ gpointer _mb)
{
/* MLIT listing item
* MIID item id
@@ -1477,7 +1478,7 @@ typedef struct {
} GroupInfo;
static void
-_group_items (gpointer key, DmapRecord * record, GHashTable * groups)
+_group_items (G_GNUC_UNUSED gpointer key, DmapRecord * record, GHashTable * groups)
{
gchar *album, *artist;
GroupInfo *group_info;
@@ -1512,17 +1513,18 @@ _group_info_cmp (gconstpointer group1, gconstpointer group2)
}
static void
-_debug_param (gpointer key, gpointer val, gpointer user_data)
+_debug_param (gpointer key, gpointer val, G_GNUC_UNUSED gpointer user_data)
{
g_debug ("%s %s", (char *) key, (char *) val);
}
void
-dmap_share_ctrl_int (DmapShare * share,
- SoupServer * server,
- SoupMessage * message,
- const char *path,
- GHashTable * query, SoupClientContext * context)
+dmap_share_ctrl_int (G_GNUC_UNUSED DmapShare * share,
+ G_GNUC_UNUSED SoupServer * server,
+ G_GNUC_UNUSED SoupMessage * message,
+ const char *path,
+ GHashTable * query,
+ G_GNUC_UNUSED SoupClientContext * context)
{
g_debug ("Path is %s.", path);
if (query) {
@@ -1533,11 +1535,11 @@ dmap_share_ctrl_int (DmapShare * share,
}
static void
-_accumulate_mlcl_size_and_ids (guint id,
+_accumulate_mlcl_size_and_ids (gpointer id,
DmapRecord * record,
struct share_bitwise_t *share_bitwise)
{
- share_bitwise->id_list = g_slist_append (share_bitwise->id_list, GUINT_TO_POINTER (id));
+ share_bitwise->id_list = g_slist_append (share_bitwise->id_list, id);
/* Make copy and set mlcl to NULL so real MLCL does not get changed */
struct DmapMlclBits mb_copy = share_bitwise->mb;
@@ -1545,8 +1547,8 @@ _accumulate_mlcl_size_and_ids (guint id,
mb_copy.mlcl = dmap_structure_add (NULL, DMAP_CC_MLCL);;
DMAP_SHARE_GET_CLASS (share_bitwise->mb.share)->add_entry_to_mlcl (id,
- record,
- &mb_copy);
+ record,
+ &mb_copy);
share_bitwise->size += dmap_structure_get_size (mb_copy.mlcl);
/* Minus eight because we do not want to add size of MLCL CC field + size field n times,
@@ -1591,8 +1593,7 @@ _write_next_mlit (SoupMessage * message, struct share_bitwise_t *share_bitwise)
mb.share = share_bitwise->mb.share;
DMAP_SHARE_GET_CLASS (share_bitwise->mb.share)->
- add_entry_to_mlcl (GPOINTER_TO_UINT (share_bitwise->id_list->data),
- record, &mb);
+ add_entry_to_mlcl (share_bitwise->id_list->data, record, &mb);
data = dmap_structure_serialize (g_node_first_child (mb.mlcl),
&length);
@@ -1613,7 +1614,7 @@ _write_next_mlit (SoupMessage * message, struct share_bitwise_t *share_bitwise)
}
static void
-_chunked_message_finished (SoupMessage * message,
+_chunked_message_finished (G_GNUC_UNUSED SoupMessage * message,
struct share_bitwise_t *share_bitwise)
{
g_debug ("Finished sending chunked data.");
@@ -1646,7 +1647,7 @@ dmap_share_databases (DmapShare * share,
g_hash_table_foreach (query, _debug_param, NULL);
if (!dmap_share_session_id_validate
- (share, context, message, query, NULL)) {
+ (share, context, query, NULL)) {
soup_message_set_status (message, SOUP_STATUS_FORBIDDEN);
goto done;
}
@@ -2039,7 +2040,7 @@ dmap_share_databases (DmapShare * share,
for (id = keys; id; id = id->next) {
(*
(DMAP_SHARE_GET_CLASS (share)->
- add_entry_to_mlcl)) (GPOINTER_TO_UINT (id->data),
+ add_entry_to_mlcl)) (id->data,
g_hash_table_lookup
(records, id->data),
&mb);
@@ -2100,19 +2101,15 @@ dmap_share_databases (DmapShare * share,
dmap_structure_destroy (apso);
} else if (g_ascii_strncasecmp ("/1/browse/", rest_of_path, 9) == 0) {
DMAP_SHARE_GET_CLASS (share)->databases_browse_xxx (share,
- server,
message,
path,
- query,
- context);
+ query);
} else if (g_ascii_strncasecmp ("/1/items/", rest_of_path, 9) == 0) {
/* just the file :) */
DMAP_SHARE_GET_CLASS (share)->databases_items_xxx (share,
server,
message,
- path,
- query,
- context);
+ path);
} else if (g_str_has_prefix (rest_of_path, "/1/groups/") &&
g_str_has_suffix (rest_of_path, "/extra_data/artwork")) {
/* We don't yet implement cover requests here, say no cover */
diff --git a/libdmapsharing/dmap-share.h b/libdmapsharing/dmap-share.h
index 33b65c4..0c534fc 100644
--- a/libdmapsharing/dmap-share.h
+++ b/libdmapsharing/dmap-share.h
@@ -111,40 +111,36 @@ typedef struct {
void (*message_add_standard_headers) (DmapShare * share,
SoupMessage * msg);
struct DmapMetaDataMap *(*get_meta_data_map) (DmapShare * share);
- void (*add_entry_to_mlcl) (guint id, DmapRecord * record, gpointer mb);
+ void (*add_entry_to_mlcl) (gpointer id, DmapRecord * record, gpointer mb);
void (*databases_browse_xxx) (DmapShare * share,
- SoupServer * server,
SoupMessage * msg,
const char *path,
- GHashTable * query,
- SoupClientContext * context);
+ GHashTable * query);
void (*databases_items_xxx) (DmapShare * share,
SoupServer * server,
SoupMessage * msg,
- const char *path,
- GHashTable * query,
- SoupClientContext * context);
+ const char *path);
/* Pure virtual methods: libsoup callbacks */
- void (*server_info) (DmapShare * share, SoupServer * server,
- SoupMessage * message, const char *path,
- GHashTable * query, SoupClientContext * ctx);
+ void (*server_info) (DmapShare * share,
+ SoupMessage * message,
+ const char *path);
- void (*content_codes) (DmapShare * share, SoupServer * server,
- SoupMessage * message, const char *path,
- GHashTable * query, SoupClientContext * ctx);
+ void (*content_codes) (DmapShare * share, SoupMessage * message,
+ const char *path, SoupClientContext * ctx);
- void (*login) (DmapShare * share, SoupServer * server,
+ void (*login) (DmapShare * share,
SoupMessage * message, const char *path,
- GHashTable * query, SoupClientContext * ctx);
+ GHashTable * query,
+ SoupClientContext * ctx);
- void (*logout) (DmapShare * share, SoupServer * server,
- SoupMessage * message, const char *path,
- GHashTable * query, SoupClientContext * ctx);
+ void (*logout) (DmapShare * share, SoupMessage * message,
+ const char *path, GHashTable * query,
+ SoupClientContext * ctx);
void (*update) (DmapShare * share, SoupServer * server,
SoupMessage * message, const char *path,
- GHashTable * query, SoupClientContext * ctx);
+ GHashTable * query);
void (*ctrl_int) (DmapShare * share, SoupServer * server,
SoupMessage * message, const char *path,
@@ -152,7 +148,8 @@ typedef struct {
/* Virtual methods: MDNS callbacks */
void (*published) (DmapShare * share,
- DmapMdnsPublisher * publisher, const char *name);
+ DmapMdnsPublisher * publisher,
+ const char *name);
void (*name_collision) (DmapShare * share,
DmapMdnsPublisher * publisher,
diff --git a/libdmapsharing/dmap-structure.c b/libdmapsharing/dmap-structure.c
index 04cddd4..126f5a4 100644
--- a/libdmapsharing/dmap-structure.c
+++ b/libdmapsharing/dmap-structure.c
@@ -573,11 +573,11 @@ static void
_parse_container_buffer (GNode * parent, const guint8 * buf,
gsize buf_length, GError **error)
{
- gint l = 0;
+ gsize l = 0;
while (l < buf_length) {
DmapContentCode cc;
- gint codesize = 0;
+ gsize codesize = 0;
DmapStructureItem *item = NULL;
GNode *node = NULL;
GType gtype;
@@ -624,9 +624,9 @@ _parse_container_buffer (GNode * parent, const guint8 * buf,
* a codesize that is larger than the remaining data)
* then get out before we start processing it
*/
- if (codesize > buf_length - l - 4 || codesize < 0) {
+ if (codesize > buf_length - l - 4) {
g_set_error(error, DMAP_ERROR, DMAP_STATUS_INVALID_CONTENT_CODE_SIZE,
- "Invalid codesize %d received in buffer of length %zd",
+ "Invalid codesize %zd received in buffer of length %zd",
codesize, buf_length);
goto done;
}
@@ -937,7 +937,7 @@ _dmap_item_free (DmapStructureItem * item)
}
static gboolean
-_gnode_free_dmap_item (GNode * node, gpointer data)
+_gnode_free_dmap_item (GNode * node, G_GNUC_UNUSED gpointer data)
{
_dmap_item_free ((DmapStructureItem *) node->data);
@@ -981,12 +981,12 @@ dmap_structure_cc_string_as_int32 (const gchar * str)
}
static gboolean
-_print_dmap_item (GNode * node, gpointer data)
+_print_dmap_item (GNode * node, G_GNUC_UNUSED gpointer data)
{
DmapStructureItem *item;
const gchar *name;
gchar *value;
- gint i;
+ guint i;
for (i = 1; i < g_node_depth (node); i++) {
g_print ("\t");
diff --git a/libdmapsharing/test-dmap-av-record-factory.c b/libdmapsharing/test-dmap-av-record-factory.c
index d58edff..10fa27b 100644
--- a/libdmapsharing/test-dmap-av-record-factory.c
+++ b/libdmapsharing/test-dmap-av-record-factory.c
@@ -22,25 +22,25 @@
#include "test-dmap-av-record.h"
DmapRecord *
-test_dmap_av_record_factory_create(DmapRecordFactory *factory,
- gpointer user_data,
- GError **error)
+test_dmap_av_record_factory_create(G_GNUC_UNUSED DmapRecordFactory *factory,
+ G_GNUC_UNUSED gpointer user_data,
+ G_GNUC_UNUSED GError **error)
{
return DMAP_RECORD (test_dmap_av_record_new ());
}
static void
-test_dmap_av_record_factory_init (TestDmapAvRecordFactory *factory)
+test_dmap_av_record_factory_init (G_GNUC_UNUSED TestDmapAvRecordFactory *factory)
{
}
static void
-test_dmap_av_record_factory_class_init (TestDmapAvRecordFactoryClass *klass)
+test_dmap_av_record_factory_class_init (G_GNUC_UNUSED TestDmapAvRecordFactoryClass *klass)
{
}
static void
-_dmap_record_factory_iface_init (gpointer iface, gpointer data)
+_dmap_record_factory_iface_init (gpointer iface)
{
DmapRecordFactoryInterface *factory = iface;
diff --git a/libdmapsharing/test-dmap-av-record.c b/libdmapsharing/test-dmap-av-record.c
index 5ca72fa..51a75a6 100644
--- a/libdmapsharing/test-dmap-av-record.c
+++ b/libdmapsharing/test-dmap-av-record.c
@@ -318,7 +318,7 @@ test_dmap_av_record_class_init (TestDmapAvRecordClass *klass)
}
static void
-_dmap_av_record_iface_init (gpointer iface, gpointer data)
+_dmap_av_record_iface_init (gpointer iface)
{
DmapAvRecordInterface *dmap_av_record = iface;
@@ -329,7 +329,7 @@ _dmap_av_record_iface_init (gpointer iface, gpointer data)
}
static void
-_dmap_record_iface_init (gpointer iface, gpointer data)
+_dmap_record_iface_init (gpointer iface)
{
DmapRecordInterface *dmap_record = iface;
diff --git a/libdmapsharing/test-dmap-container-db.c b/libdmapsharing/test-dmap-container-db.c
index 0833fc4..d88f542 100644
--- a/libdmapsharing/test-dmap-container-db.c
+++ b/libdmapsharing/test-dmap-container-db.c
@@ -27,40 +27,41 @@
static DmapContainerRecord *_record = NULL;
static DmapContainerRecord *
-test_dmap_container_db_lookup_by_id (DmapContainerDb *db, guint id)
+test_dmap_container_db_lookup_by_id (G_GNUC_UNUSED DmapContainerDb *db,
+ G_GNUC_UNUSED guint id)
{
/* In reality, lookup the proper record and return it. */
return g_object_ref (_record);
}
static void
-test_dmap_container_db_foreach (DmapContainerDb *db,
+test_dmap_container_db_foreach (G_GNUC_UNUSED DmapContainerDb *db,
DmapIdContainerRecordFunc func,
gpointer data)
{
/* In reality, pull each record from the db and execute func on it. */
- func (1, _record, data);
+ func (GUINT_TO_POINTER(1), _record, data);
}
static gint64
-test_dmap_container_db_count (DmapContainerDb *db)
+test_dmap_container_db_count (G_GNUC_UNUSED DmapContainerDb *db)
{
/* In reality, return the record count. */
return 1;
}
static void
-test_dmap_container_db_init (TestDmapContainerDb *db)
+test_dmap_container_db_init (G_GNUC_UNUSED TestDmapContainerDb *db)
{
}
static void
-test_dmap_container_db_class_init (TestDmapContainerDbClass *klass)
+test_dmap_container_db_class_init (G_GNUC_UNUSED TestDmapContainerDbClass *klass)
{
}
static void
-_dmap_container_db_iface_init (gpointer iface, gpointer data)
+_dmap_container_db_iface_init (gpointer iface)
{
DmapContainerDbInterface *dmap_container_db = iface;
diff --git a/libdmapsharing/test-dmap-container-record.c b/libdmapsharing/test-dmap-container-record.c
index 74d3833..46f4211 100644
--- a/libdmapsharing/test-dmap-container-record.c
+++ b/libdmapsharing/test-dmap-container-record.c
@@ -30,7 +30,7 @@ static DmapDb *_entries = NULL;
static void
test_dmap_container_record_set_property (GObject *object,
guint prop_id,
- const GValue *value,
+ G_GNUC_UNUSED const GValue *value,
GParamSpec *pspec)
{
switch (prop_id) {
@@ -61,33 +61,33 @@ test_dmap_container_record_get_property (GObject *object,
guint
-test_dmap_container_record_get_id (DmapContainerRecord *record)
+test_dmap_container_record_get_id (G_GNUC_UNUSED DmapContainerRecord *record)
{
return 2;
}
void
-test_dmap_container_record_add_entry (DmapContainerRecord *container_record,
- DmapRecord *record,
- gint id,
- GError **error)
+test_dmap_container_record_add_entry (G_GNUC_UNUSED DmapContainerRecord *container_record,
+ G_GNUC_UNUSED DmapRecord *record,
+ G_GNUC_UNUSED gint id,
+ G_GNUC_UNUSED GError **error)
{
}
guint64
-test_dmap_container_record_get_entry_count (DmapContainerRecord *record)
+test_dmap_container_record_get_entry_count (G_GNUC_UNUSED DmapContainerRecord *record)
{
return 1;
}
DmapDb *
-test_dmap_container_record_get_entries (DmapContainerRecord *record)
+test_dmap_container_record_get_entries (G_GNUC_UNUSED DmapContainerRecord *record)
{
return g_object_ref (_entries);
}
static void
-test_dmap_container_record_init (TestDmapContainerRecord *record)
+test_dmap_container_record_init (G_GNUC_UNUSED TestDmapContainerRecord *record)
{
_entries = DMAP_DB (test_dmap_db_new ());
}
@@ -104,7 +104,7 @@ test_dmap_container_record_class_init (TestDmapContainerRecordClass *klass)
}
static void
-_dmap_container_record_iface_init (gpointer iface, gpointer data)
+_dmap_container_record_iface_init (gpointer iface)
{
DmapContainerRecordInterface *dmap_container_record = iface;
diff --git a/libdmapsharing/test-dmap-db.c b/libdmapsharing/test-dmap-db.c
index 2586c4b..b396676 100644
--- a/libdmapsharing/test-dmap-db.c
+++ b/libdmapsharing/test-dmap-db.c
@@ -50,7 +50,7 @@ test_dmap_db_count (const DmapDb *db)
}
guint
-test_dmap_db_add (DmapDb *db, DmapRecord *record, GError **error)
+test_dmap_db_add (DmapDb *db, DmapRecord *record, G_GNUC_UNUSED GError **error)
{
guint id;
id = TEST_DMAP_DB (db)->priv->nextid--;
@@ -72,7 +72,7 @@ test_dmap_db_init (TestDmapDb *db)
}
static void
-_dmap_db_iface_init (gpointer iface, gpointer data)
+_dmap_db_iface_init (gpointer iface)
{
DmapDbInterface *dmap_db = iface;
diff --git a/libdmapsharing/test-dmap-image-record-factory.c b/libdmapsharing/test-dmap-image-record-factory.c
index 065a219..6c89f83 100644
--- a/libdmapsharing/test-dmap-image-record-factory.c
+++ b/libdmapsharing/test-dmap-image-record-factory.c
@@ -22,25 +22,25 @@
#include "test-dmap-image-record.h"
DmapRecord *
-test_dmap_image_record_factory_create(DmapRecordFactory *factory,
- gpointer user_data,
- GError **error)
+test_dmap_image_record_factory_create(G_GNUC_UNUSED DmapRecordFactory *factory,
+ G_GNUC_UNUSED gpointer user_data,
+ G_GNUC_UNUSED GError **error)
{
return DMAP_RECORD (test_dmap_image_record_new ());
}
static void
-test_dmap_image_record_factory_init (TestDmapImageRecordFactory *factory)
+test_dmap_image_record_factory_init (G_GNUC_UNUSED TestDmapImageRecordFactory *factory)
{
}
static void
-test_dmap_image_record_factory_class_init (TestDmapImageRecordFactoryClass *klass)
+test_dmap_image_record_factory_class_init (G_GNUC_UNUSED TestDmapImageRecordFactoryClass *klass)
{
}
static void
-_dmap_record_factory_iface_init (gpointer iface, gpointer data)
+_dmap_record_factory_iface_init (gpointer iface)
{
DmapRecordFactoryInterface *factory = iface;
diff --git a/libdmapsharing/test-dmap-image-record.c b/libdmapsharing/test-dmap-image-record.c
index 86d1d26..d022626 100644
--- a/libdmapsharing/test-dmap-image-record.c
+++ b/libdmapsharing/test-dmap-image-record.c
@@ -216,7 +216,7 @@ test_dmap_image_record_class_init (TestDmapImageRecordClass *klass)
}
static void
-_dmap_image_record_iface_init (gpointer iface, gpointer data)
+_dmap_image_record_iface_init (gpointer iface)
{
DmapImageRecordInterface *dmap_image_record = iface;
@@ -226,7 +226,7 @@ _dmap_image_record_iface_init (gpointer iface, gpointer data)
}
static void
-_dmap_record_iface_init (gpointer iface, gpointer data)
+_dmap_record_iface_init (gpointer iface)
{
DmapRecordInterface *dmap_record = iface;
diff --git a/tests/test-dmap-client.c b/tests/test-dmap-client.c
index 02d2e01..dab4a01 100644
--- a/tests/test-dmap-client.c
+++ b/tests/test-dmap-client.c
@@ -36,7 +36,7 @@ static GMainLoop *loop;
static guint conn_type = DAAP;
static void
-print_record (guint id, DmapRecord *record, gpointer user_data)
+print_record (gpointer id, DmapRecord *record, G_GNUC_UNUSED gpointer user_data)
{
if (IS_DMAP_AV_RECORD(record)) {
gboolean has_video;
@@ -48,7 +48,7 @@ print_record (guint id, DmapRecord *record, gpointer user_data)
"title", &title,
NULL);
- g_print ("%d: %s %s (has video: %s)\n", id, artist, title, has_video ? "Y" : "N");
+ g_print ("%d: %s %s (has video: %s)\n", GPOINTER_TO_UINT(id), artist, title, has_video ? "Y"
: "N");
g_free (artist);
g_free (title);
@@ -60,7 +60,7 @@ print_record (guint id, DmapRecord *record, gpointer user_data)
"location", &location,
NULL);
- g_print ("%d: %s %s\n", id, format, location);
+ g_print ("%d: %s %s\n", GPOINTER_TO_UINT(id), format, location);
g_free (format);
g_free (location);
@@ -69,17 +69,17 @@ print_record (guint id, DmapRecord *record, gpointer user_data)
}
}
-static void error_cb(DmapConnection *connection,
+static void error_cb(G_GNUC_UNUSED DmapConnection *connection,
GError *error,
- gpointer user_data)
+ G_GNUC_UNUSED gpointer user_data)
{
g_error("%s", error->message);
}
static void
-connected_cb (DmapConnection *connection,
- gboolean result,
- const char *reason,
+connected_cb (G_GNUC_UNUSED DmapConnection *connection,
+ G_GNUC_UNUSED gboolean result,
+ G_GNUC_UNUSED const char *reason,
DmapDb *db)
{
g_print ("Connection cb., DB has %lu entries\n", dmap_db_count (db));
@@ -89,12 +89,12 @@ connected_cb (DmapConnection *connection,
static void
authenticate_cb (DmapConnection *connection,
- const char *name,
+ G_GNUC_UNUSED const char *name,
SoupSession *session,
SoupMessage *msg,
SoupAuth *auth,
- gboolean retrying,
- gpointer user_data)
+ G_GNUC_UNUSED gboolean retrying,
+ G_GNUC_UNUSED gpointer user_data)
{
char *username, password[BUFSIZ + 1];
g_object_get (connection, "username", &username, NULL);
@@ -108,9 +108,9 @@ authenticate_cb (DmapConnection *connection,
}
static void
-service_added_cb (DmapMdnsBrowser *browser,
+service_added_cb (G_GNUC_UNUSED DmapMdnsBrowser *browser,
DmapMdnsService *service,
- gpointer user_data)
+ G_GNUC_UNUSED gpointer user_data)
{
DmapRecordFactory *factory;
DmapConnection *conn;
@@ -159,9 +159,9 @@ service_added_cb (DmapMdnsBrowser *browser,
static void
_log_printf(const char *log_domain,
- GLogLevelFlags level,
+ G_GNUC_UNUSED GLogLevelFlags level,
const gchar *message,
- gpointer user_data)
+ G_GNUC_UNUSED gpointer user_data)
{
g_printerr("%s: %s\n", log_domain, message);
}
diff --git a/tests/test-dmap-server.c b/tests/test-dmap-server.c
index 54636fb..e256415 100644
--- a/tests/test-dmap-server.c
+++ b/tests/test-dmap-server.c
@@ -52,7 +52,7 @@ dmap_sharing_default_share_name ()
}
static void
-error_cb(DmapShare *share, GError *error, gpointer user_data)
+error_cb(G_GNUC_UNUSED DmapShare *share, GError *error, G_GNUC_UNUSED gpointer user_data)
{
g_error("%s", error->message);
}
@@ -83,6 +83,7 @@ create_share (guint conn_type, GMainLoop *loop)
switch (conn_type) {
default:
g_idle_add(_quit, loop);
+ G_GNUC_FALLTHROUGH;
case DAAP:
factory = DMAP_RECORD_FACTORY (test_dmap_av_record_factory_new ());
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]