Kaydet (Commit) 12db21f5 authored tarafından Colomban Wendling's avatar Colomban Wendling

Properly use 0 as the invalid timeout source ID, rather than G_MAXUINT

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5657 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst bf4b0638
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
Use new plugin_idle_add(), preventing an unlikely crash. Use new plugin_idle_add(), preventing an unlikely crash.
* doc/pluginsymbols.c, src/sciwrappers.c: * doc/pluginsymbols.c, src/sciwrappers.c:
Fix a few Doxygen warnings. Fix a few Doxygen warnings.
* plugins/saveactions.c:
Properly use 0 as the invalid timeout source ID.
2011-03-29 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> 2011-03-29 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
......
...@@ -74,7 +74,7 @@ static gboolean enable_backupcopy; ...@@ -74,7 +74,7 @@ static gboolean enable_backupcopy;
static gint autosave_interval; static gint autosave_interval;
static gboolean autosave_print_msg; static gboolean autosave_print_msg;
static gboolean autosave_save_all; static gboolean autosave_save_all;
static guint autosave_src_id = G_MAXUINT; static guint autosave_src_id = 0;
static gchar *instantsave_default_ft; static gchar *instantsave_default_ft;
...@@ -321,7 +321,7 @@ static void autosave_set_timeout(void) ...@@ -321,7 +321,7 @@ static void autosave_set_timeout(void)
if (! enable_autosave) if (! enable_autosave)
return; return;
if (autosave_src_id != G_MAXUINT) if (autosave_src_id != 0)
g_source_remove(autosave_src_id); g_source_remove(autosave_src_id);
autosave_src_id = g_timeout_add(autosave_interval * 1000, (GSourceFunc) auto_save, NULL); autosave_src_id = g_timeout_add(autosave_interval * 1000, (GSourceFunc) auto_save, NULL);
} }
...@@ -347,7 +347,7 @@ void plugin_init(GeanyData *data) ...@@ -347,7 +347,7 @@ void plugin_init(GeanyData *data)
instantsave_default_ft = utils_get_setting_string(config, "instantsave", "default_ft", instantsave_default_ft = utils_get_setting_string(config, "instantsave", "default_ft",
filetypes[GEANY_FILETYPES_NONE]->name); filetypes[GEANY_FILETYPES_NONE]->name);
autosave_src_id = G_MAXUINT; /* mark as invalid */ autosave_src_id = 0; /* mark as invalid */
autosave_interval = utils_get_setting_integer(config, "autosave", "interval", 300); autosave_interval = utils_get_setting_integer(config, "autosave", "interval", 300);
autosave_print_msg = utils_get_setting_boolean(config, "autosave", "print_messages", FALSE); autosave_print_msg = utils_get_setting_boolean(config, "autosave", "print_messages", FALSE);
autosave_save_all = utils_get_setting_boolean(config, "autosave", "save_all", FALSE); autosave_save_all = utils_get_setting_boolean(config, "autosave", "save_all", FALSE);
...@@ -719,7 +719,7 @@ GtkWidget *plugin_configure(GtkDialog *dialog) ...@@ -719,7 +719,7 @@ GtkWidget *plugin_configure(GtkDialog *dialog)
void plugin_cleanup(void) void plugin_cleanup(void)
{ {
if (autosave_src_id != G_MAXUINT) if (autosave_src_id != 0)
g_source_remove(autosave_src_id); g_source_remove(autosave_src_id);
g_free(instantsave_default_ft); g_free(instantsave_default_ft);
......
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