ad2f2b
From b8fdfcae060bdffb15d81e68cdff011105013eb0 Mon Sep 17 00:00:00 2001
ad2f2b
From: Michael Catanzaro <mcatanzaro@igalia.com>
ad2f2b
Date: Fri, 18 May 2018 09:56:16 -0500
ad2f2b
Subject: [PATCH] Fix build with GCC 8
ad2f2b
ad2f2b
Yelp enables -Werror by default, so it's responsible for predicting and
ad2f2b
fixing future compiler warnings that only an oracle could know about. In
ad2f2b
this case, that turned out to be -Werror=cast-function-type.
ad2f2b
---
ad2f2b
 libyelp/yelp-docbook-document.c | 6 +++---
ad2f2b
 libyelp/yelp-document.c         | 4 ++--
ad2f2b
 libyelp/yelp-help-list.c        | 2 +-
ad2f2b
 libyelp/yelp-info-document.c    | 2 +-
ad2f2b
 libyelp/yelp-mallard-document.c | 6 +++---
ad2f2b
 libyelp/yelp-man-document.c     | 2 +-
ad2f2b
 libyelp/yelp-simple-document.c  | 2 +-
ad2f2b
 libyelp/yelp-transform.c        | 2 +-
ad2f2b
 libyelp/yelp-uri.c              | 2 +-
ad2f2b
 9 files changed, 14 insertions(+), 14 deletions(-)
ad2f2b
ad2f2b
diff --git a/libyelp/yelp-docbook-document.c b/libyelp/yelp-docbook-document.c
ad2f2b
index 9b430b09..6ecaf316 100644
ad2f2b
--- a/libyelp/yelp-docbook-document.c
ad2f2b
+++ b/libyelp/yelp-docbook-document.c
ad2f2b
@@ -273,7 +273,7 @@ docbook_request_page (YelpDocument         *document,
ad2f2b
         priv->process_running = TRUE;
ad2f2b
         g_object_ref (document);
ad2f2b
         priv->thread = g_thread_new ("docbook-page",
ad2f2b
-                                     (GThreadFunc) docbook_process,
ad2f2b
+                                     (GThreadFunc)(GCallback) docbook_process,
ad2f2b
                                      document);
ad2f2b
         break;
ad2f2b
     case DOCBOOK_STATE_PARSING:
ad2f2b
@@ -495,7 +495,7 @@ docbook_reload (YelpDocbookDocument *docbook)
ad2f2b
     priv->process_running = TRUE;
ad2f2b
     g_object_ref (docbook);
ad2f2b
     priv->thread = g_thread_new ("docbook-reload",
ad2f2b
-                                 (GThreadFunc) docbook_process,
ad2f2b
+                                 (GThreadFunc)(GCallback) docbook_process,
ad2f2b
                                  docbook);
ad2f2b
 
ad2f2b
     g_mutex_unlock (&priv->mutex);
ad2f2b
@@ -1077,7 +1077,7 @@ docbook_index (YelpDocument *document)
ad2f2b
     priv = GET_PRIV (document);
ad2f2b
     g_object_ref (document);
ad2f2b
     priv->index = g_thread_new ("docbook-index",
ad2f2b
-                                (GThreadFunc) docbook_index_threaded,
ad2f2b
+                                (GThreadFunc)(GCallback) docbook_index_threaded,
ad2f2b
                                 document);
ad2f2b
     priv->index_running = TRUE;
ad2f2b
 }
ad2f2b
diff --git a/libyelp/yelp-document.c b/libyelp/yelp-document.c
ad2f2b
index 6adbbb1d..c1eec9cc 100644
ad2f2b
--- a/libyelp/yelp-document.c
ad2f2b
+++ b/libyelp/yelp-document.c
ad2f2b
@@ -330,7 +330,7 @@ yelp_document_dispose (GObject *object)
ad2f2b
 
ad2f2b
     if (document->priv->reqs_all) {
ad2f2b
 	g_slist_foreach (document->priv->reqs_all,
ad2f2b
-			 (GFunc) request_try_free,
ad2f2b
+			 (GFunc)(GCallback) request_try_free,
ad2f2b
 			 NULL);
ad2f2b
 	g_slist_free (document->priv->reqs_all);
ad2f2b
 	document->priv->reqs_all = NULL;
ad2f2b
@@ -338,7 +338,7 @@ yelp_document_dispose (GObject *object)
ad2f2b
 
ad2f2b
     if (document->priv->reqs_search) {
ad2f2b
 	g_slist_foreach (document->priv->reqs_search,
ad2f2b
-			 (GFunc) request_try_free,
ad2f2b
+			 (GFunc)(GCallback) request_try_free,
ad2f2b
 			 NULL);
ad2f2b
 	g_slist_free (document->priv->reqs_search);
ad2f2b
 	document->priv->reqs_search = NULL;
ad2f2b
diff --git a/libyelp/yelp-help-list.c b/libyelp/yelp-help-list.c
ad2f2b
index 9005e48f..cbac98bf 100644
ad2f2b
--- a/libyelp/yelp-help-list.c
ad2f2b
+++ b/libyelp/yelp-help-list.c
ad2f2b
@@ -210,7 +210,7 @@ help_list_request_page (YelpDocument          *document,
ad2f2b
         priv->process_running = TRUE;
ad2f2b
         g_object_ref (document);
ad2f2b
         priv->thread = g_thread_new ("helplist-page",
ad2f2b
-                                     (GThreadFunc) help_list_think,
ad2f2b
+                                     (GThreadFunc)(GCallback) help_list_think,
ad2f2b
                                      document);
ad2f2b
     }
ad2f2b
     priv->pending = g_slist_prepend (priv->pending, g_strdup (page_id));
ad2f2b
diff --git a/libyelp/yelp-info-document.c b/libyelp/yelp-info-document.c
ad2f2b
index 7b532744..d55be325 100644
ad2f2b
--- a/libyelp/yelp-info-document.c
ad2f2b
+++ b/libyelp/yelp-info-document.c
ad2f2b
@@ -209,7 +209,7 @@ info_request_page (YelpDocument         *document,
ad2f2b
 	priv->process_running = TRUE;
ad2f2b
         g_object_ref (document);
ad2f2b
 	priv->thread = g_thread_new ("info-page",
ad2f2b
-                                     (GThreadFunc) info_document_process,
ad2f2b
+                                     (GThreadFunc)(GCallback) info_document_process,
ad2f2b
                                      document);
ad2f2b
 	break;
ad2f2b
     case INFO_STATE_PARSING:
ad2f2b
diff --git a/libyelp/yelp-mallard-document.c b/libyelp/yelp-mallard-document.c
ad2f2b
index fc7c4d7c..74fc80ee 100644
ad2f2b
--- a/libyelp/yelp-mallard-document.c
ad2f2b
+++ b/libyelp/yelp-mallard-document.c
ad2f2b
@@ -287,7 +287,7 @@ mallard_request_page (YelpDocument         *document,
ad2f2b
         priv->thread_running = TRUE;
ad2f2b
         g_object_ref (document);
ad2f2b
         priv->thread = g_thread_new ("mallard-page",
ad2f2b
-                                     (GThreadFunc) mallard_think,
ad2f2b
+                                     (GThreadFunc)(GCallback) mallard_think,
ad2f2b
                                      document);
ad2f2b
     }
ad2f2b
 
ad2f2b
@@ -1100,7 +1100,7 @@ mallard_index (YelpDocument *document)
ad2f2b
     priv = GET_PRIV (document);
ad2f2b
     g_object_ref (document);
ad2f2b
     priv->index = g_thread_new ("mallard-index",
ad2f2b
-                                (GThreadFunc) mallard_index_threaded,
ad2f2b
+                                (GThreadFunc)(GCallback) mallard_index_threaded,
ad2f2b
                                 document);
ad2f2b
     priv->index_running = TRUE;
ad2f2b
 }
ad2f2b
@@ -1148,7 +1148,7 @@ mallard_monitor_changed (GFileMonitor         *monitor,
ad2f2b
     priv->thread_running = TRUE;
ad2f2b
     g_object_ref (mallard);
ad2f2b
     priv->thread = g_thread_new ("mallard-reload",
ad2f2b
-                                 (GThreadFunc) mallard_think,
ad2f2b
+                                 (GThreadFunc)(GCallback) mallard_think,
ad2f2b
                                  mallard);
ad2f2b
 
ad2f2b
     g_mutex_unlock (&priv->mutex);
ad2f2b
diff --git a/libyelp/yelp-man-document.c b/libyelp/yelp-man-document.c
ad2f2b
index 4e165d57..ad7fab4f 100644
ad2f2b
--- a/libyelp/yelp-man-document.c
ad2f2b
+++ b/libyelp/yelp-man-document.c
ad2f2b
@@ -243,7 +243,7 @@ man_request_page (YelpDocument         *document,
ad2f2b
         yelp_document_set_page_id (document, priv->page_id, priv->page_id);
ad2f2b
         yelp_document_set_root_id (document, priv->page_id, priv->page_id);
ad2f2b
 	priv->thread = g_thread_new ("man-page",
ad2f2b
-                                     (GThreadFunc) man_document_process,
ad2f2b
+                                     (GThreadFunc)(GCallback) man_document_process,
ad2f2b
                                      document);
ad2f2b
 	break;
ad2f2b
     case MAN_STATE_PARSING:
ad2f2b
diff --git a/libyelp/yelp-simple-document.c b/libyelp/yelp-simple-document.c
ad2f2b
index 501d7881..595efa83 100644
ad2f2b
--- a/libyelp/yelp-simple-document.c
ad2f2b
+++ b/libyelp/yelp-simple-document.c
ad2f2b
@@ -131,7 +131,7 @@ yelp_simple_document_dispose (GObject *object)
ad2f2b
     YelpSimpleDocument *document = YELP_SIMPLE_DOCUMENT (object);
ad2f2b
 
ad2f2b
     if (document->priv->reqs) {
ad2f2b
-	g_slist_foreach (document->priv->reqs, (GFunc) request_try_free, NULL);
ad2f2b
+	g_slist_foreach (document->priv->reqs, (GFunc)(GCallback) request_try_free, NULL);
ad2f2b
 	g_slist_free (document->priv->reqs);
ad2f2b
 	document->priv->reqs = NULL;
ad2f2b
     }
ad2f2b
diff --git a/libyelp/yelp-transform.c b/libyelp/yelp-transform.c
ad2f2b
index 334438af..7a5dc86e 100644
ad2f2b
--- a/libyelp/yelp-transform.c
ad2f2b
+++ b/libyelp/yelp-transform.c
ad2f2b
@@ -298,7 +298,7 @@ yelp_transform_start (YelpTransform       *transform,
ad2f2b
     priv->running = TRUE;
ad2f2b
     g_object_ref (transform);
ad2f2b
     priv->thread = g_thread_new ("transform-run",
ad2f2b
-                                 (GThreadFunc) transform_run,
ad2f2b
+                                 (GThreadFunc)(GCallback) transform_run,
ad2f2b
                                  transform);
ad2f2b
     g_mutex_unlock (&priv->mutex);
ad2f2b
 
ad2f2b
diff --git a/libyelp/yelp-uri.c b/libyelp/yelp-uri.c
ad2f2b
index 317beead..f20b167e 100644
ad2f2b
--- a/libyelp/yelp-uri.c
ad2f2b
+++ b/libyelp/yelp-uri.c
ad2f2b
@@ -298,7 +298,7 @@ resolve_start (YelpUri *uri)
ad2f2b
     if (priv->resolver == NULL) {
ad2f2b
         g_object_ref (uri);
ad2f2b
         priv->resolver = g_thread_new ("uri-resolve",
ad2f2b
-                                       (GThreadFunc) resolve_async,
ad2f2b
+                                       (GThreadFunc)(GCallback) resolve_async,
ad2f2b
                                        uri);
ad2f2b
     }
ad2f2b
 }
ad2f2b
-- 
ad2f2b
2.17.1
ad2f2b