logo

badwolf

Minimalist and privacy-oriented WebKitGTK+ browser
commit: 6fa3ab417f9339a7dcfbbdf4e0909e58298c3d39
parent 2938c5cf138bef4f65644d9213233fa0e5a5ee6f
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat, 17 Oct 2020 07:26:16 +0200

bookmarks: Fix compiler warnings

Diffstat:

Mbookmarks.c12+++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/bookmarks.c b/bookmarks.c @@ -5,6 +5,7 @@ #include <glib/gprintf.h> /* g_fprintf() */ #include <gtk/gtk.h> +#include <libxml/xinclude.h> #include <libxml/xpath.h> #include <unistd.h> /* access() */ @@ -46,7 +47,7 @@ location_completion_cleanup(xmlXPathObjectPtr xpathObj, xmlXPathContextPtr xpath if(doc != NULL) xmlFreeDoc(doc); } -static GtkTreeIter +static void load_xpath_results(GtkListStore *list_store, xmlNodeSetPtr nodes) { GtkTreeIter iter; @@ -62,20 +63,17 @@ load_xpath_results(GtkListStore *list_store, xmlNodeSetPtr nodes) gtk_list_store_set( list_store, &iter, 0, (char *)xmlXPathCastNodeToString(nodes->nodeTab[i]), -1); } - - return iter; } GtkTreeModel * bookmarks_completion_init() { - const xmlChar *xpathExpr = "//bookmark/@href"; + const xmlChar *xpathExpr = (const xmlChar *)"//bookmark/@href"; char *filename = g_build_filename(g_get_user_data_dir(), "badwolf", "bookmarks.xbel", NULL); xmlDocPtr doc = NULL; xmlXPathContextPtr xpathCtx = NULL; xmlXPathObjectPtr xpathObj = NULL; - GtkTreeIter iter; - GtkListStore *list_store = gtk_list_store_new(1, G_TYPE_STRING); + GtkListStore *list_store = gtk_list_store_new(1, G_TYPE_STRING); if(access(filename, R_OK) != 0) { @@ -110,7 +108,7 @@ bookmarks_completion_init() return NULL; } - iter = load_xpath_results(list_store, xpathObj->nodesetval); + load_xpath_results(list_store, xpathObj->nodesetval); location_completion_cleanup(xpathObj, xpathCtx, doc);