Revision: 1217 http://svn.sourceforge.net/geany/?rev=1217&view=rev Author: eht16 Date: 2007-01-21 10:22:14 -0800 (Sun, 21 Jan 2007)
Log Message: ----------- Applied patch from Jeff Pohlmeyer to avoid parsing of compiler errors by the va_list system.
Modified Paths: -------------- trunk/ChangeLog trunk/src/build.c trunk/src/msgwindow.c trunk/src/msgwindow.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-01-21 17:43:52 UTC (rev 1216) +++ trunk/ChangeLog 2007-01-21 18:22:14 UTC (rev 1217) @@ -1,3 +1,12 @@ +2007-01-21 Enrico Tröger enrico.troeger@uvena.de + + * src/project.c: Implemented loading and saving of the project file + and minor improvements. + * src/build.c, src/msgwindow.c, src/msgwindow.h: + Applied patch from Jeff Pohlmeyer to avoid parsing of compiler errors + by the va_list system. + + 2007-01-20 Enrico Tröger enrico.troeger@uvena.de
* scintilla/makefile.win32: Fixed typo. @@ -4,8 +13,6 @@ * scintilla/*, src/sci_cb.c: Updated Scintilla to version 1.72. * doc/geany.docbook: Added a notice of changed DnD behaviour in Scintilla 1.72. - * src/project.c: Implemented loading and saving of the project file - and minor improvements.
2007-01-19 Enrico Tröger enrico.troeger@uvena.de
Modified: trunk/src/build.c =================================================================== --- trunk/src/build.c 2007-01-21 17:43:52 UTC (rev 1216) +++ trunk/src/build.c 2007-01-21 18:22:14 UTC (rev 1217) @@ -431,7 +431,7 @@ working_dir = g_path_get_dirname(locale_filename); utf8_working_dir = g_path_get_dirname(doc_list[idx].file_name); gtk_list_store_clear(msgwindow.store_compiler); - msgwin_compiler_add(COLOR_BLUE, _("%s (in directory: %s)"), utf8_cmd_string, utf8_working_dir); + msgwin_compiler_add_fmt(COLOR_BLUE, _("%s (in directory: %s)"), utf8_cmd_string, utf8_working_dir); gtk_notebook_set_current_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_COMPILER);
// set the build info for the message window @@ -774,7 +774,7 @@ if (failure) { msg = _("Compilation failed."); - msgwin_compiler_add(COLOR_DARK_RED, "%s", msg); + msgwin_compiler_add(COLOR_DARK_RED, msg); // If msgwindow is hidden, user will want to display it to see the error if (! app->msgwindow_visible) { @@ -788,7 +788,7 @@ else { msg = _("Compilation finished successfully."); - msgwin_compiler_add(COLOR_BLUE, "%s", msg); + msgwin_compiler_add(COLOR_BLUE, msg); if (! app->msgwindow_visible || gtk_notebook_get_current_page(GTK_NOTEBOOK(msgwindow.notebook)) != MSG_COMPILER) ui_set_statusbar("%s", msg);
Modified: trunk/src/msgwindow.c =================================================================== --- trunk/src/msgwindow.c 2007-01-21 17:43:52 UTC (rev 1216) +++ trunk/src/msgwindow.c 2007-01-21 18:22:14 UTC (rev 1217) @@ -186,8 +186,20 @@
static const GdkColor color_error = {0, 65535, 0, 0};
+void msgwin_compiler_add_fmt(gint msg_color, const gchar *format, ...) +{ + gchar string[512]; + va_list args; + + va_start(args, format); + g_vsnprintf(string, 512, format, args); + va_end(args); + msgwin_compiler_add(msg_color, string); +} + + // adds string to the compiler textview -void msgwin_compiler_add(gint msg_color, const gchar *format, ...) +void msgwin_compiler_add(gint msg_color, const gchar *msg) { GtkTreeIter iter; GtkTreePath *path; @@ -195,13 +207,7 @@ const GdkColor dark_red = {0, 65535 / 2, 0, 0}; const GdkColor blue = {0, 0, 0, 0xD000}; // not too bright ;-) const GdkColor black = {0, 0, 0, 0}; - gchar string[512]; - va_list args;
- va_start(args, format); - g_vsnprintf(string, 512, format, args); - va_end(args); - switch (msg_color) { case COLOR_RED: color = &color_error; break; @@ -211,7 +217,7 @@ }
gtk_list_store_append(msgwindow.store_compiler, &iter); - gtk_list_store_set(msgwindow.store_compiler, &iter, 0, color, 1, string, -1); + gtk_list_store_set(msgwindow.store_compiler, &iter, 0, color, 1, msg, -1);
if (app->msgwindow_visible) {
Modified: trunk/src/msgwindow.h =================================================================== --- trunk/src/msgwindow.h 2007-01-21 17:43:52 UTC (rev 1216) +++ trunk/src/msgwindow.h 2007-01-21 18:22:14 UTC (rev 1217) @@ -71,16 +71,18 @@
void msgwin_msg_add(gint line, gint idx, const gchar *string);
-void msgwin_compiler_add(gint msg_color, const gchar *format, ...) - G_GNUC_PRINTF (2, 3); +void msgwin_compiler_add_fmt(gint msg_color, const gchar *format, ...) G_GNUC_PRINTF (2, 3);
+void msgwin_compiler_add(gint msg_color, const gchar *msg); + void msgwin_status_add(const gchar *format, ...) G_GNUC_PRINTF (1, 2);
void msgwin_menu_add_common_items(GtkMenu *menu);
gboolean msgwin_goto_compiler_file_line();
-void msgwin_parse_compiler_error_line(const gchar *string, const gchar *dir, gchar **filename, gint *line); +void msgwin_parse_compiler_error_line(const gchar *string, const gchar *dir, + gchar **filename, gint *line);
gboolean msgwin_goto_messages_file_line();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.