SF.net SVN: geany:[4861] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sun Apr 25 17:43:09 UTC 2010


Revision: 4861
          http://geany.svn.sourceforge.net/geany/?rev=4861&view=rev
Author:   eht16
Date:     2010-04-25 17:43:09 +0000 (Sun, 25 Apr 2010)

Log Message:
-----------
Make string arguments const where appropriate (patch by Colomban Wendling, thanks).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/plugins/export.c
    trunk/plugins/filebrowser.c
    trunk/plugins/htmlchars.c
    trunk/plugins/saveactions.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-04-25 17:42:56 UTC (rev 4860)
+++ trunk/ChangeLog	2010-04-25 17:43:09 UTC (rev 4861)
@@ -12,6 +12,10 @@
  * src/main.c:
    Remove malloc() fallback since we completely rely on g_malloc()
    nowadays.
+ * plugins/export.c, plugins/filebrowser.c, plugins/htmlchars.c,
+   plugins/saveactions.c:
+   Make string arguments const where appropriate (patch by
+   Colomban Wendling, thanks).
 
 
 2010-04-22  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: trunk/plugins/export.c
===================================================================
--- trunk/plugins/export.c	2010-04-25 17:42:56 UTC (rev 4860)
+++ trunk/plugins/export.c	2010-04-25 17:43:09 UTC (rev 4861)
@@ -207,7 +207,7 @@
 		gchar *file_name;
 		gchar *locale_filename;
 		gchar *locale_dirname;
-		gchar *suffix = "";
+		const gchar *suffix = "";
 
 		if (g_str_has_suffix(doc->file_name, extension))
 			suffix = "_export";
@@ -220,6 +220,7 @@
 		 * gtk_file_chooser_set_current_folder() additionally */
 		gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), locale_dirname);
 		gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), file_name);
+		g_free(locale_dirname);
 		g_free(locale_filename);
 		g_free(short_name);
 		g_free(file_name);
@@ -275,7 +276,7 @@
 
 static gchar *get_date(gint type)
 {
-	gchar *format;
+	const gchar *format;
 
 	if (type == DATE_TYPE_HTML)
 /* needs testing */

Modified: trunk/plugins/filebrowser.c
===================================================================
--- trunk/plugins/filebrowser.c	2010-04-25 17:42:56 UTC (rev 4860)
+++ trunk/plugins/filebrowser.c	2010-04-25 17:43:09 UTC (rev 4861)
@@ -150,7 +150,8 @@
 static void add_item(const gchar *name)
 {
 	GtkTreeIter iter;
-	gchar *fname, *utf8_name, *utf8_fullname, *sep;
+	gchar *fname, *utf8_name, *utf8_fullname;
+	const gchar *sep;
 	gboolean dir;
 
 	if (! show_hidden_files && check_hidden(name))

Modified: trunk/plugins/htmlchars.c
===================================================================
--- trunk/plugins/htmlchars.c	2010-04-25 17:42:56 UTC (rev 4860)
+++ trunk/plugins/htmlchars.c	2010-04-25 17:43:09 UTC (rev 4861)
@@ -345,7 +345,7 @@
 
 
 /* Functions to toggle the status of plugin */
-void set_status(gboolean new_status)
+static void set_status(gboolean new_status)
 {
 	if (plugin_active != new_status)
 	{
@@ -398,7 +398,7 @@
 
 /* Function takes over value of key which was pressed and returns
  * HTML/SGML entity if any */
-const gchar *get_entity(gchar *letter)
+static const gchar *get_entity(gchar *letter)
 {
 	guint i, len;
 
@@ -635,7 +635,7 @@
 }
 
 
-static void replace_special_character()
+static void replace_special_character(void)
 {
 	GeanyDocument *doc = NULL;
 	doc = document_get_current();
@@ -707,7 +707,7 @@
 }
 
 
-static void init_configuration()
+static void init_configuration(void)
 {
 	GKeyFile *config = g_key_file_new();
 

Modified: trunk/plugins/saveactions.c
===================================================================
--- trunk/plugins/saveactions.c	2010-04-25 17:42:56 UTC (rev 4860)
+++ trunk/plugins/saveactions.c	2010-04-25 17:43:09 UTC (rev 4861)
@@ -278,7 +278,7 @@
 };
 
 
-gboolean auto_save(gpointer data)
+static gboolean auto_save(gpointer data)
 {
 	GeanyDocument *doc;
 	GeanyDocument *cur_doc = document_get_current();
@@ -316,7 +316,7 @@
 }
 
 
-void autosave_set_timeout(void)
+static void autosave_set_timeout(void)
 {
 	if (! enable_autosave)
 		return;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list