[PATCH 04/14] Missing return values.



Note this changes the return type of yelp_document_set_page_icon:
no-one was using a return and it wasn't returning anything helpful...
---
 libyelp/yelp-document.c |   13 ++++++++-----
 libyelp/yelp-document.h |    2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/libyelp/yelp-document.c b/libyelp/yelp-document.c
index 215586e..0ca6b24 100644
--- a/libyelp/yelp-document.c
+++ b/libyelp/yelp-document.c
@@ -205,6 +205,7 @@ yelp_document_get_for_uri (YelpUri *uri)
     case YELP_URI_DOCUMENT_TYPE_NOT_FOUND:
     case YELP_URI_DOCUMENT_TYPE_EXTERNAL:
     case YELP_URI_DOCUMENT_TYPE_ERROR:
+    case YELP_URI_DOCUMENT_TYPE_UNRESOLVED:
         break;
     }
 
@@ -625,7 +626,7 @@ yelp_document_get_page_icon (YelpDocument *document,
     return ret;
 }
 
-gchar *
+void
 yelp_document_set_page_icon (YelpDocument *document,
                              const gchar  *page_id,
                              const gchar  *icon)
@@ -646,8 +647,9 @@ yelp_document_request_page (YelpDocument         *document,
 			    YelpDocumentCallback  callback,
 			    gpointer              user_data)
 {
-    g_return_if_fail (YELP_IS_DOCUMENT (document));
-    g_return_if_fail (YELP_DOCUMENT_GET_CLASS (document)->request_page != NULL);
+    g_return_val_if_fail (YELP_IS_DOCUMENT (document), FALSE);
+    g_return_val_if_fail (YELP_DOCUMENT_GET_CLASS (document)->request_page != NULL,
+                          FALSE);
 
     debug_print (DB_FUNCTION, "entering\n");
 
@@ -786,8 +788,9 @@ gchar *
 yelp_document_get_mime_type (YelpDocument *document,
 			     const gchar  *page_id)
 {
-    g_return_if_fail (YELP_IS_DOCUMENT (document));
-    g_return_if_fail (YELP_DOCUMENT_GET_CLASS (document)->get_mime_type != NULL);
+    g_return_val_if_fail (YELP_IS_DOCUMENT (document), NULL);
+    g_return_val_if_fail (YELP_DOCUMENT_GET_CLASS (document)->get_mime_type != NULL,
+                          NULL);
 
     return YELP_DOCUMENT_GET_CLASS (document)->get_mime_type (document, page_id);
 }
diff --git a/libyelp/yelp-document.h b/libyelp/yelp-document.h
index d9f30af..15ae8dc 100644
--- a/libyelp/yelp-document.h
+++ b/libyelp/yelp-document.h
@@ -145,7 +145,7 @@ void              yelp_document_set_page_desc  (YelpDocument         *document,
 
 gchar *           yelp_document_get_page_icon  (YelpDocument         *document,
                                                 const gchar          *page_id);
-gchar *           yelp_document_set_page_icon  (YelpDocument         *document,
+void              yelp_document_set_page_icon  (YelpDocument         *document,
                                                 const gchar          *page_id,
                                                 const gchar          *icon);
 
-- 
1.7.2.3




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