Revision: 1029 http://svn.sourceforge.net/geany/?rev=1029&view=rev Author: ntrel Date: 2006-11-25 04:17:50 -0800 (Sat, 25 Nov 2006)
Log Message: ----------- Add some const char* argument modifiers, remove unneeded static from some local vars.
Modified Paths: -------------- trunk/ChangeLog trunk/src/msgwindow.c trunk/src/msgwindow.h trunk/src/notebook.c trunk/src/notebook.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-11-24 11:55:26 UTC (rev 1028) +++ trunk/ChangeLog 2006-11-25 12:17:50 UTC (rev 1029) @@ -1,3 +1,10 @@ +2006-11-25 Nick Treleaven nick.treleaven@btinternet.com + + * src/msgwindow.c, src/notebook.c, src/msgwindow.h, src/notebook.h: + Add some const char* argument modifiers, remove unneeded static from + some local vars. + + 2006-11-24 Nick Treleaven nick.treleaven@btinternet.com
* src/ui_utils.h, src/prefs.c, src/dialogs.c, src/ui_utils.c:
Modified: trunk/src/msgwindow.c =================================================================== --- trunk/src/msgwindow.c 2006-11-24 11:55:26 UTC (rev 1028) +++ trunk/src/msgwindow.c 2006-11-25 12:17:50 UTC (rev 1029) @@ -49,8 +49,8 @@ gint file_idx; // idx of the field where the filename is or -1 } ParseData;
-static GdkColor dark = {0, 58832, 58832, 58832}; -static GdkColor white = {0, 65535, 65535, 65535}; +static const GdkColor dark = {0, 58832, 58832, 58832}; +static const GdkColor white = {0, 65535, 65535, 65535};
MessageWindow msgwindow;
@@ -156,16 +156,16 @@
// adds string to the compiler textview -void msgwin_compiler_add(gint msg_color, gboolean scroll, gchar const *format, ...) +void msgwin_compiler_add(gint msg_color, gboolean scroll, const gchar *format, ...) { GtkTreeIter iter; GtkTreePath *path; - GdkColor *color; - static GdkColor red = {0, 65535, 0, 0}; - static GdkColor dark_red = {0, 65535 / 2, 0, 0}; - static GdkColor blue = {0, 0, 0, 65535}; - static GdkColor black = {0, 0, 0, 0}; - static gchar string[512]; + const GdkColor *color; + const GdkColor red = {0, 65535, 0, 0}; + const GdkColor dark_red = {0, 65535 / 2, 0, 0}; + const GdkColor blue = {0, 0, 0, 65535}; + const GdkColor black = {0, 0, 0, 0}; + gchar string[512]; va_list args;
va_start(args, format); @@ -206,7 +206,7 @@
// adds string to the msg treeview -void msgwin_msg_add(gint line, gint idx, gchar *string) +void msgwin_msg_add(gint line, gint idx, const gchar *string) { GtkTreeIter iter; static gint state = 0; @@ -219,12 +219,12 @@ }
-// adds a status message -void msgwin_status_add(gchar const *format, ...) +// logs a status message (use ui_set_statusbar() to just display text on the statusbar) +void msgwin_status_add(const gchar *format, ...) { GtkTreeIter iter; static gint state = 0; - static gchar string[512]; + gchar string[512]; gchar *statusmsg, *time_str; va_list args;
Modified: trunk/src/msgwindow.h =================================================================== --- trunk/src/msgwindow.h 2006-11-24 11:55:26 UTC (rev 1028) +++ trunk/src/msgwindow.h 2006-11-25 12:17:50 UTC (rev 1029) @@ -74,12 +74,12 @@
void msgwin_show();
-void msgwin_msg_add(gint line, gint idx, gchar *string); +void msgwin_msg_add(gint line, gint idx, const gchar *string);
-void msgwin_compiler_add(gint msg_color, gboolean scroll, gchar const *format, ...) +void msgwin_compiler_add(gint msg_color, gboolean scroll, const gchar *format, ...) G_GNUC_PRINTF (3, 4);
-void msgwin_status_add(gchar const *format, ...) G_GNUC_PRINTF (1, 2); +void msgwin_status_add(const gchar *format, ...) G_GNUC_PRINTF (1, 2);
GtkWidget *msgwin_create_message_popup_menu(gint type);
Modified: trunk/src/notebook.c =================================================================== --- trunk/src/notebook.c 2006-11-24 11:55:26 UTC (rev 1028) +++ trunk/src/notebook.c 2006-11-25 12:17:50 UTC (rev 1029) @@ -295,7 +295,7 @@
/* Returns index of notebook page, or -1 on error */ -gint notebook_new_tab(gint doc_idx, gchar *title, GtkWidget *page) +gint notebook_new_tab(gint doc_idx, const gchar *title, GtkWidget *page) { GtkWidget *hbox, *but; GtkWidget *align;
Modified: trunk/src/notebook.h =================================================================== --- trunk/src/notebook.h 2006-11-24 11:55:26 UTC (rev 1028) +++ trunk/src/notebook.h 2006-11-25 12:17:50 UTC (rev 1029) @@ -27,7 +27,7 @@ void notebook_init();
/* Returns index of notebook page, or -1 on error */ -gint notebook_new_tab(gint doc_idx, gchar *title, GtkWidget *page); +gint notebook_new_tab(gint doc_idx, const gchar *title, GtkWidget *page);
// Always use this instead of gtk_notebook_remove_page(). void notebook_remove_page(gint page_num);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.