From: Guilhem Bonnefille Date: Thu, 13 Dec 2012 13:10:57 +0000 (+0100) Subject: [QA] Extract utility function from viktrwlayer X-Git-Url: https://git.street.me.uk/andy/viking.git/commitdiff_plain/70434be370289f8d95481e6804f76e049bc5070d?ds=sidebyside [QA] Extract utility function from viktrwlayer File src/viktrwlayer.c is huge enough to avoid utility functions. --- diff --git a/src/util.c b/src/util.c index 4acc70ec..fe23e846 100644 --- a/src/util.c +++ b/src/util.c @@ -116,3 +116,12 @@ gchar *uri_escape(gchar *str) return(esc_str); } + +GList * str_array_to_glist(gchar* data[]) +{ + GList *gl = NULL; + gpointer * p; + for (p = (gpointer)data; *p; p++) + gl = g_list_prepend(gl, *p); + return g_list_reverse(gl); +} diff --git a/src/util.h b/src/util.h index 5132b85e..12a07fc1 100644 --- a/src/util.h +++ b/src/util.h @@ -34,6 +34,8 @@ void new_email(GtkWindow *parent, const gchar * address); gchar *uri_escape(gchar *str); +GList * str_array_to_glist(gchar* data[]); + G_END_DECLS #endif diff --git a/src/viktrwlayer.c b/src/viktrwlayer.c index e50bc356..465cff7a 100644 --- a/src/viktrwlayer.c +++ b/src/viktrwlayer.c @@ -980,15 +980,6 @@ static VikTrwLayer *trw_layer_unmarshall( guint8 *data, gint len, VikViewport *v return rv; } -static GList * str_array_to_glist(gchar* data[]) -{ - GList *gl = NULL; - gpointer * p; - for (p = (gpointer)data; *p; p++) - gl = g_list_prepend(gl, *p); - return(g_list_reverse(gl)); -} - // Keep interesting hash function at least visible /* static guint strcase_hash(gconstpointer v)