From: John Darrington Date: Mon, 9 Aug 2010 18:25:49 +0000 (+0200) Subject: Avoid compiler warnings X-Git-Tag: v0.7.9~159^2~5 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bc2f8c0fb6b963b52fe86d1259ae254f40362c5;p=pspp-builds.git Avoid compiler warnings --- diff --git a/src/ui/gui/psppire-syntax-window.c b/src/ui/gui/psppire-syntax-window.c index 7c70cbcb..436830c3 100644 --- a/src/ui/gui/psppire-syntax-window.c +++ b/src/ui/gui/psppire-syntax-window.c @@ -111,13 +111,10 @@ psppire_syntax_window_class_init (PsppireSyntaxWindowClass *class) GtkSourceLanguageManager *lm = gtk_source_language_manager_get_default (); const gchar * const *existing_paths = gtk_source_language_manager_get_search_path (lm); + gchar **new_paths = g_strdupv ((gchar **)existing_paths); + int n = g_strv_length ((gchar **) existing_paths); - const gchar **new_paths = g_strdupv (existing_paths); - - int n = g_strv_length (existing_paths); - - new_paths = g_realloc (new_paths, (n+1) * sizeof (*new_paths)); - + new_paths = g_realloc (new_paths, (n + 1) * sizeof (*new_paths)); new_paths[n] = g_strdup (relocate (PKGDATADIR)); new_paths[n+1] = NULL; @@ -130,6 +127,8 @@ psppire_syntax_window_class_init (PsppireSyntaxWindowClass *class) g_warning ("pspp.lang file not found. Syntax highlighting will not be available."); parent_class = g_type_class_peek_parent (class); + + g_strfreev (new_paths); }