[rhythmbox] rhythmdb: add typedef for entry-foreach callbacks
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] rhythmdb: add typedef for entry-foreach callbacks
- Date: Sun, 2 Nov 2014 07:26:08 +0000 (UTC)
commit 3af37dd5f92806a6ec7fc3be22bcf2ee6cdc9c37
Author: Jonathan Matthew <jonathan d14n org>
Date: Sun Nov 2 16:06:06 2014 +1000
rhythmdb: add typedef for entry-foreach callbacks
plugins/daap/rb-rhythmdb-dmap-db-adapter.c | 2 +-
rhythmdb/rhythmdb-tree.c | 10 +++++-----
rhythmdb/rhythmdb.c | 4 ++--
rhythmdb/rhythmdb.h | 10 ++++++----
tests/test-rhythmdb.c | 2 +-
5 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/plugins/daap/rb-rhythmdb-dmap-db-adapter.c b/plugins/daap/rb-rhythmdb-dmap-db-adapter.c
index 415f9f4..c1777e6 100644
--- a/plugins/daap/rb-rhythmdb-dmap-db-adapter.c
+++ b/plugins/daap/rb-rhythmdb-dmap-db-adapter.c
@@ -95,7 +95,7 @@ rb_rhythmdb_dmap_db_adapter_foreach (const DMAPDb *db,
rhythmdb_entry_foreach_by_type (RB_RHYTHMDB_DMAP_DB_ADAPTER (db)->priv->db,
RB_RHYTHMDB_DMAP_DB_ADAPTER (db)->priv->entry_type,
- (GFunc) foreach_adapter,
+ foreach_adapter,
foreach_adapter_data);
g_free (foreach_adapter_data);
diff --git a/rhythmdb/rhythmdb-tree.c b/rhythmdb/rhythmdb-tree.c
index d92a8ba..d265aae 100644
--- a/rhythmdb/rhythmdb-tree.c
+++ b/rhythmdb/rhythmdb-tree.c
@@ -83,9 +83,9 @@ static void rhythmdb_tree_entry_delete_by_type (RhythmDB *adb, RhythmDBEntryType
static RhythmDBEntry * rhythmdb_tree_entry_lookup_by_location (RhythmDB *db, RBRefString *uri);
static RhythmDBEntry * rhythmdb_tree_entry_lookup_by_id (RhythmDB *db, gint id);
-static void rhythmdb_tree_entry_foreach (RhythmDB *adb, GFunc func, gpointer user_data);
+static void rhythmdb_tree_entry_foreach (RhythmDB *adb, RhythmDBEntryForeachFunc func, gpointer user_data);
static gint64 rhythmdb_tree_entry_count (RhythmDB *adb);
-static void rhythmdb_tree_entry_foreach_by_type (RhythmDB *adb, RhythmDBEntryType *type, GFunc func,
gpointer user_data);
+static void rhythmdb_tree_entry_foreach_by_type (RhythmDB *adb, RhythmDBEntryType *type,
RhythmDBEntryForeachFunc func, gpointer user_data);
static gint64 rhythmdb_tree_entry_count_by_type (RhythmDB *adb, RhythmDBEntryType *type);
static gboolean rhythmdb_tree_entry_keyword_add (RhythmDB *adb, RhythmDBEntry *entry, RBRefString *keyword);
static gboolean rhythmdb_tree_entry_keyword_remove (RhythmDB *adb, RhythmDBEntry *entry, RBRefString
*keyword);
@@ -2439,7 +2439,7 @@ rhythmdb_tree_entry_foreach_func (gpointer key, RhythmDBEntry *val, GPtrArray *l
}
static void
-rhythmdb_tree_entry_foreach (RhythmDB *rdb, GFunc foreach_func, gpointer user_data)
+rhythmdb_tree_entry_foreach (RhythmDB *rdb, RhythmDBEntryForeachFunc foreach_func, gpointer user_data)
{
RhythmDBTree *db = RHYTHMDB_TREE (rdb);
GPtrArray *list;
@@ -2468,7 +2468,7 @@ rhythmdb_tree_entry_count (RhythmDB *rdb)
}
typedef struct {
- GFunc foreach_func;
+ RhythmDBEntryForeachFunc foreach_func;
gpointer data;
} ForeachTypeData;
@@ -2481,7 +2481,7 @@ _foreach_by_type_cb (RhythmDB *db, RhythmDBEntry *entry, ForeachTypeData *data)
static void
rhythmdb_tree_entry_foreach_by_type (RhythmDB *db,
RhythmDBEntryType *type,
- GFunc foreach_func,
+ RhythmDBEntryForeachFunc foreach_func,
gpointer data)
{
ForeachTypeData ftdata = {foreach_func, data};
diff --git a/rhythmdb/rhythmdb.c b/rhythmdb/rhythmdb.c
index 4cd6dfc..a4fab03 100644
--- a/rhythmdb/rhythmdb.c
+++ b/rhythmdb/rhythmdb.c
@@ -3978,7 +3978,7 @@ rhythmdb_entry_lookup_from_string (RhythmDB *db,
*/
void
rhythmdb_entry_foreach (RhythmDB *db,
- GFunc func,
+ RhythmDBEntryForeachFunc func,
gpointer data)
{
RhythmDBClass *klass = RHYTHMDB_GET_CLASS (db);
@@ -4015,7 +4015,7 @@ rhythmdb_entry_count (RhythmDB *db)
void
rhythmdb_entry_foreach_by_type (RhythmDB *db,
RhythmDBEntryType *entry_type,
- GFunc func,
+ RhythmDBEntryForeachFunc func,
gpointer data)
{
RhythmDBClass *klass = RHYTHMDB_GET_CLASS (db);
diff --git a/rhythmdb/rhythmdb.h b/rhythmdb/rhythmdb.h
index 08cc82b..85d7748 100644
--- a/rhythmdb/rhythmdb.h
+++ b/rhythmdb/rhythmdb.h
@@ -197,6 +197,8 @@ enum {
#define RHYTHMDB_PROP_COVER_ART "rb:coverArt"
#define RHYTHMDB_PROP_COVER_ART_URI "rb:coverArt-uri"
+typedef void (*RhythmDBEntryForeachFunc) (RhythmDBEntry *entry, gpointer data);
+
GType rhythmdb_query_type_get_type (void);
GType rhythmdb_prop_type_get_type (void);
@@ -290,11 +292,11 @@ struct _RhythmDBClass
gboolean (*impl_evaluate_query) (RhythmDB *db, RhythmDBQuery *query, RhythmDBEntry *entry);
- void (*impl_entry_foreach) (RhythmDB *db, GFunc func, gpointer data);
+ void (*impl_entry_foreach) (RhythmDB *db, RhythmDBEntryForeachFunc func, gpointer data);
gint64 (*impl_entry_count) (RhythmDB *db);
- void (*impl_entry_foreach_by_type) (RhythmDB *db, RhythmDBEntryType *type, GFunc func,
gpointer data);
+ void (*impl_entry_foreach_by_type) (RhythmDB *db, RhythmDBEntryType *type,
RhythmDBEntryForeachFunc func, gpointer data);
gint64 (*impl_entry_count_by_type) (RhythmDB *db, RhythmDBEntryType *type);
@@ -366,13 +368,13 @@ gboolean rhythmdb_evaluate_query (RhythmDB *db, RhythmDBQuery *query,
RhythmDBEntry *entry);
void rhythmdb_entry_foreach (RhythmDB *db,
- GFunc func,
+ RhythmDBEntryForeachFunc func,
gpointer data);
gint64 rhythmdb_entry_count (RhythmDB *db);
void rhythmdb_entry_foreach_by_type (RhythmDB *db,
RhythmDBEntryType *entry_type,
- GFunc func,
+ RhythmDBEntryForeachFunc func,
gpointer data);
gint64 rhythmdb_entry_count_by_type (RhythmDB *db,
RhythmDBEntryType *entry_type);
diff --git a/tests/test-rhythmdb.c b/tests/test-rhythmdb.c
index ef0a57c..036ac70 100644
--- a/tests/test-rhythmdb.c
+++ b/tests/test-rhythmdb.c
@@ -136,7 +136,7 @@ START_TEST (test_rhythmdb_indexing)
entry = NULL;
b = FALSE;
- rhythmdb_entry_foreach (db, (GFunc)set_true, &b);
+ rhythmdb_entry_foreach (db, (RhythmDBEntryForeachFunc) set_true, &b);
fail_unless (b == FALSE, "entry not deleted");
}
END_TEST
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]