[PATCH 05/14] Add typecasts and a header we use.
- From: Rupert Swarbrick <rswarbrick gmail com>
- To: gnome-doc-devel-list gnome org
- Subject: [PATCH 05/14] Add typecasts and a header we use.
- Date: Wed, 22 Dec 2010 11:32:25 +0000
---
libyelp/yelp-help-list.c | 26 +++++++++++++++++---------
1 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/libyelp/yelp-help-list.c b/libyelp/yelp-help-list.c
index 7b17798..f5b76ab 100644
--- a/libyelp/yelp-help-list.c
+++ b/libyelp/yelp-help-list.c
@@ -31,6 +31,7 @@
#include <libxml/parser.h>
#include <libxml/xinclude.h>
#include <libxml/xpath.h>
+#include <libxml/xpathInternals.h>
#include "yelp-help-list.h"
#include "yelp-settings.h"
@@ -131,15 +132,22 @@ yelp_help_list_init (YelpHelpList *list)
g_free,
(GDestroyNotify) help_list_entry_free);
- priv->get_docbook_title = xmlXPathCompile ("normalize-space("
+ priv->get_docbook_title = xmlXPathCompile (BAD_CAST
+ "normalize-space("
"( /*/title | /*/db:title"
"| /*/articleinfo/title"
"| /*/bookinfo/title"
"| /*/db:info/db:title"
")[1])");
- priv->get_mallard_title = xmlXPathCompile ("normalize-space((/mal:page/mal:info/mal:title[ type='text'] |"
- " /mal:page/mal:title)[1])");
- priv->get_mallard_desc = xmlXPathCompile ("normalize-space(/mal:page/mal:info/mal:desc[1])");
+
+ priv->get_mallard_title = xmlXPathCompile (
+ BAD_CAST
+ "normalize-space((/mal:page/mal:info/mal:title[ type='text'] |"
+ " /mal:page/mal:title)[1])");
+
+ priv->get_mallard_desc = xmlXPathCompile (
+ BAD_CAST
+ "normalize-space(/mal:page/mal:info/mal:desc[1])");
yelp_document_set_page_id ((YelpDocument *) list, NULL, "index");
yelp_document_set_page_id ((YelpDocument *) list, "index", "index");
@@ -225,7 +233,7 @@ help_list_think (YelpHelpList *list)
YelpHelpListPrivate *priv = GET_PRIV (list);
/* The strings are still owned by GLib; we just own the array. */
gchar **datadirs;
- gint datadir_i, subdir_i, lang_i;
+ gint datadir_i, lang_i;
GList *cur;
GtkIconTheme *theme;
@@ -248,7 +256,7 @@ help_list_think (YelpHelpList *list)
g_free (helpdirname);
continue;
}
- while (child = g_file_enumerator_next_file (children, NULL, NULL)) {
+ while ((child = g_file_enumerator_next_file (children, NULL, NULL))) {
gchar *docid;
HelpListEntry *entry = NULL;
@@ -561,7 +569,7 @@ help_list_process_docbook (YelpHelpList *list,
obj = xmlXPathCompiledEval (priv->get_docbook_title, xpath);
if (obj) {
if (obj->stringval)
- entry->title = g_strdup (obj->stringval);
+ entry->title = g_strdup ((const gchar*) obj->stringval);
xmlXPathFreeObject (obj);
}
@@ -601,14 +609,14 @@ help_list_process_mallard (YelpHelpList *list,
obj = xmlXPathCompiledEval (priv->get_mallard_title, xpath);
if (obj) {
if (obj->stringval)
- entry->title = g_strdup (obj->stringval);
+ entry->title = g_strdup ((const gchar*) obj->stringval);
xmlXPathFreeObject (obj);
}
obj = xmlXPathCompiledEval (priv->get_mallard_desc, xpath);
if (obj) {
if (obj->stringval)
- entry->desc = g_strdup (obj->stringval);
+ entry->desc = g_strdup ((const gchar*) obj->stringval);
xmlXPathFreeObject (obj);
}
--
1.7.2.3
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]