Revision: 871 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=871&view=rev Author: frlan Date: 2009-07-26 20:14:42 +0000 (Sun, 26 Jul 2009)
Log Message: ----------- GeanyLaTeX: Port a fix for an compiler warning upstream
Modified Paths: -------------- trunk/geanylatex/src/reftex.c trunk/geanylatex/src/reftex.h
Modified: trunk/geanylatex/src/reftex.c =================================================================== --- trunk/geanylatex/src/reftex.c 2009-07-26 20:14:16 UTC (rev 870) +++ trunk/geanylatex/src/reftex.c 2009-07-26 20:14:42 UTC (rev 871) @@ -28,7 +28,7 @@ gchar **aux_entries = NULL; const gchar *file = NULL; int i = 0; - LaTeXLabel tmp; + LaTeXLabel *tmp;
if (file != NULL) { @@ -44,18 +44,21 @@ if (g_str_has_prefix(aux_entries[i], "\newlabel")) { tmp = glatex_parseLine(aux_entries[i]); - gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), tmp.label_name); + gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), tmp->label_name); + g_free(tmp); } } + g_free(aux_entries); } } } }
-LaTeXLabel glatex_parseLine(const gchar *line) +LaTeXLabel* glatex_parseLine(const gchar *line) { - LaTeXLabel label; - + LaTeXLabel *label; + label = g_new0(LaTeXLabel, 1); + gchar *t = NULL; const gchar *x = NULL; gint l = 0; @@ -72,7 +75,7 @@ } g_free(t); } - label.label_name = g_strndup(line, l); + label->label_name = g_strndup(line, l);
return label; }
Modified: trunk/geanylatex/src/reftex.h =================================================================== --- trunk/geanylatex/src/reftex.h 2009-07-26 20:14:16 UTC (rev 870) +++ trunk/geanylatex/src/reftex.h 2009-07-26 20:14:42 UTC (rev 871) @@ -33,6 +33,6 @@
void glatex_add_Labels(GtkWidget *combobox, GDir *dir);
-LaTeXLabel glatex_parseLine(const gchar *line); +LaTeXLabel *glatex_parseLine(const gchar *line);
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.