Skip to content

Commit

Permalink
Properly use 0 as the invalid timeout source ID, rather than G_MAXUINT
Browse files Browse the repository at this point in the history
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/0.20.1@5789 ea778897-0a13-0410-b9d1-a72fbfd435f5
  • Loading branch information
b4n committed May 9, 2011
1 parent f04b82f commit d695afa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Expand Up @@ -26,6 +26,8 @@
the actual job in IDLE callbacks for the TreeView's handler to have run.
* doc/pluginsymbols.c, src/sciwrappers.c:
Fix a few Doxygen warnings.
* plugins/saveactions.c:
Properly use 0 as the invalid timeout source ID.


2011-05-08 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Expand Down
8 changes: 4 additions & 4 deletions plugins/saveactions.c
Expand Up @@ -74,7 +74,7 @@ static gboolean enable_backupcopy;
static gint autosave_interval;
static gboolean autosave_print_msg;
static gboolean autosave_save_all;
static guint autosave_src_id = G_MAXUINT;
static guint autosave_src_id = 0;

static gchar *instantsave_default_ft;

Expand Down Expand Up @@ -321,7 +321,7 @@ static void autosave_set_timeout(void)
if (! enable_autosave)
return;

if (autosave_src_id != G_MAXUINT)
if (autosave_src_id != 0)
g_source_remove(autosave_src_id);
autosave_src_id = g_timeout_add(autosave_interval * 1000, (GSourceFunc) auto_save, NULL);
}
Expand All @@ -347,7 +347,7 @@ void plugin_init(GeanyData *data)
instantsave_default_ft = utils_get_setting_string(config, "instantsave", "default_ft",
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_print_msg = utils_get_setting_boolean(config, "autosave", "print_messages", FALSE);
autosave_save_all = utils_get_setting_boolean(config, "autosave", "save_all", FALSE);
Expand Down Expand Up @@ -719,7 +719,7 @@ GtkWidget *plugin_configure(GtkDialog *dialog)

void plugin_cleanup(void)
{
if (autosave_src_id != G_MAXUINT)
if (autosave_src_id != 0)
g_source_remove(autosave_src_id);

g_free(instantsave_default_ft);
Expand Down

0 comments on commit d695afa

Please sign in to comment.