[devhelp] BookListSimple: fix compil warning (-Wcast-function-type)
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp] BookListSimple: fix compil warning (-Wcast-function-type)
- Date: Thu, 10 May 2018 16:43:16 +0000 (UTC)
commit 9c4807116bf8ba938b1f272b6144ca7c402bf9ee
Author: Sébastien Wilmet <swilmet gnome org>
Date: Thu May 10 18:40:58 2018 +0200
BookListSimple: fix compil warning (-Wcast-function-type)
devhelp/dh-book-list-simple.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/devhelp/dh-book-list-simple.c b/devhelp/dh-book-list-simple.c
index fc15f36..de476ff 100644
--- a/devhelp/dh-book-list-simple.c
+++ b/devhelp/dh-book-list-simple.c
@@ -30,6 +30,13 @@ struct _DhBookListSimplePrivate {
G_DEFINE_TYPE_WITH_PRIVATE (DhBookListSimple, _dh_book_list_simple, DH_TYPE_BOOK_LIST)
+static gpointer
+book_copy_func (gconstpointer src,
+ gpointer data)
+{
+ return g_object_ref ((gpointer) src);
+}
+
static void
dh_book_list_simple_dispose (GObject *object)
{
@@ -98,7 +105,7 @@ generate_list (DhBookListSimple *list_simple)
/* First DhBookList, take all DhBook's. */
if (book_list_node == list_simple->priv->sub_book_lists) {
g_assert (ret == NULL);
- ret = g_list_copy_deep (books, (GCopyFunc) g_object_ref, NULL);
+ ret = g_list_copy_deep (books, book_copy_func, NULL);
continue;
}
@@ -124,7 +131,7 @@ repopulate (DhBookListSimple *list_simple)
GList *new_node;
old_list = dh_book_list_get_books (DH_BOOK_LIST (list_simple));
- old_list_copy = g_list_copy_deep (old_list, (GCopyFunc) g_object_ref, NULL);
+ old_list_copy = g_list_copy_deep (old_list, book_copy_func, NULL);
new_list = generate_list (list_simple);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]