[yelp] Fix return values in libyelp functions.
- From: Frédéric Crozat <fcrozat src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp] Fix return values in libyelp functions.
- Date: Tue, 8 Mar 2011 13:15:27 +0000 (UTC)
commit f00802aa346a0274191d17ea6fca46a74b819a72
Author: Frederic Crozat <fcrozat novell com>
Date: Tue Feb 22 18:45:08 2011 +0100
Fix return values in libyelp functions.
https://bugzilla.gnome.org/show_bug.cgi?id=642977
libyelp/yelp-bookmarks.c | 2 +-
libyelp/yelp-docbook-document.c | 3 ++-
libyelp/yelp-document.c | 10 +++++-----
libyelp/yelp-document.h | 2 +-
libyelp/yelp-man-document.c | 3 ++-
libyelp/yelp-storage.c | 4 ++--
libyelp/yelp-view.c | 1 +
7 files changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/libyelp/yelp-bookmarks.c b/libyelp/yelp-bookmarks.c
index 670650d..a8aeab1 100644
--- a/libyelp/yelp-bookmarks.c
+++ b/libyelp/yelp-bookmarks.c
@@ -83,7 +83,7 @@ yelp_bookmarks_is_bookmarked (YelpBookmarks *bookmarks,
{
YelpBookmarksInterface *iface;
- g_return_if_fail (YELP_IS_BOOKMARKS (bookmarks));
+ g_return_val_if_fail (YELP_IS_BOOKMARKS (bookmarks), FALSE);
iface = YELP_BOOKMARKS_GET_INTERFACE (bookmarks);
diff --git a/libyelp/yelp-docbook-document.c b/libyelp/yelp-docbook-document.c
index 0d9b182..2c6b9c1 100644
--- a/libyelp/yelp-docbook-document.c
+++ b/libyelp/yelp-docbook-document.c
@@ -259,7 +259,7 @@ docbook_request_page (YelpDocument *document,
callback,
user_data);
if (handled) {
- return;
+ return handled;
}
g_mutex_lock (priv->mutex);
@@ -289,6 +289,7 @@ docbook_request_page (YelpDocument *document,
}
g_mutex_unlock (priv->mutex);
+ return FALSE;
}
/******************************************************************************/
diff --git a/libyelp/yelp-document.c b/libyelp/yelp-document.c
index f0ba9f1..e51c1ed 100644
--- a/libyelp/yelp-document.c
+++ b/libyelp/yelp-document.c
@@ -750,7 +750,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)
@@ -786,8 +786,8 @@ 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");
@@ -1056,8 +1056,8 @@ 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 b79d47b..16fc8aa 100644
--- a/libyelp/yelp-document.h
+++ b/libyelp/yelp-document.h
@@ -148,7 +148,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);
diff --git a/libyelp/yelp-man-document.c b/libyelp/yelp-man-document.c
index a49dfba..8d8031b 100644
--- a/libyelp/yelp-man-document.c
+++ b/libyelp/yelp-man-document.c
@@ -255,7 +255,7 @@ man_request_page (YelpDocument *document,
callback,
user_data);
if (handled) {
- return;
+ return handled;
}
g_mutex_lock (priv->mutex);
@@ -290,6 +290,7 @@ man_request_page (YelpDocument *document,
}
g_mutex_unlock (priv->mutex);
+ return FALSE;
}
diff --git a/libyelp/yelp-storage.c b/libyelp/yelp-storage.c
index e901af1..97a1786 100644
--- a/libyelp/yelp-storage.c
+++ b/libyelp/yelp-storage.c
@@ -76,7 +76,7 @@ yelp_storage_search (YelpStorage *storage,
{
YelpStorageInterface *iface;
- g_return_if_fail (YELP_IS_STORAGE (storage));
+ g_return_val_if_fail (YELP_IS_STORAGE (storage), NULL);
iface = YELP_STORAGE_GET_INTERFACE (storage);
@@ -92,7 +92,7 @@ yelp_storage_get_root_title (YelpStorage *storage,
{
YelpStorageInterface *iface;
- g_return_if_fail (YELP_IS_STORAGE (storage));
+ g_return_val_if_fail (YELP_IS_STORAGE (storage), NULL);
iface = YELP_STORAGE_GET_INTERFACE (storage);
diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c
index af56af0..92843a3 100644
--- a/libyelp/yelp-view.c
+++ b/libyelp/yelp-view.c
@@ -181,6 +181,7 @@ struct _YelpActionEntry {
YelpViewActionValidFunc func;
gpointer data;
};
+static void
action_entry_free (YelpActionEntry *entry)
{
if (entry == NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]