Kaydet (Commit) 3f3d2d1b authored tarafından Enrico Tröger's avatar Enrico Tröger

Make string arguments const where appropriate (patch by Colomban Wendling, thanks).

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4861 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst f12ed2fa
......@@ -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>
......
......@@ -207,7 +207,7 @@ static void create_file_save_as_dialog(const gchar *extension, ExportFunc func,
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 @@ static void create_file_save_as_dialog(const gchar *extension, ExportFunc func,
* 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 void write_data(const gchar *filename, const gchar *data)
static gchar *get_date(gint type)
{
gchar *format;
const gchar *format;
if (type == DATE_TYPE_HTML)
/* needs testing */
......
......@@ -150,7 +150,8 @@ static gboolean check_filtered(const gchar *base_name)
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))
......
......@@ -345,7 +345,7 @@ PluginCallback plugin_callbacks[] =
/* 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 @@ static gboolean sc_insert(GtkTreeModel *model, GtkTreeIter *iter);
/* 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 sc_on_tree_row_activated(GtkTreeView *treeview, GtkTreePath *path,
}
static void replace_special_character()
static void replace_special_character(void)
{
GeanyDocument *doc = NULL;
doc = document_get_current();
......@@ -707,7 +707,7 @@ static void kb_special_chars_replacement(G_GNUC_UNUSED guint key_id)
}
static void init_configuration()
static void init_configuration(void)
{
GKeyFile *config = g_key_file_new();
......
......@@ -278,7 +278,7 @@ PluginCallback plugin_callbacks[] =
};
gboolean auto_save(gpointer data)
static gboolean auto_save(gpointer data)
{
GeanyDocument *doc;
GeanyDocument *cur_doc = document_get_current();
......@@ -316,7 +316,7 @@ gboolean auto_save(gpointer data)
}
void autosave_set_timeout(void)
static void autosave_set_timeout(void)
{
if (! enable_autosave)
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment