diff src/collect-io.c @ 1523:24a12aa0cb54

Fix up event source ids type: gint -> guint. Functions like g_timeout_add() or g_idle_add() return a guint greater than 0, but in most places it was wrongly stored as int and initialized to -1. This broke assertions matching in g_source_remove() for example since id was always greater than 0 even when timer was not set (-1 was casted to the biggest guint).
author zas_
date Mon, 06 Apr 2009 22:13:54 +0000
parents 5f49f305a6b6
children 956aab097ea7
line wrap: on
line diff
--- a/src/collect-io.c	Mon Apr 06 21:52:49 2009 +0000
+++ b/src/collect-io.c	Mon Apr 06 22:13:54 2009 +0000
@@ -447,7 +447,7 @@
 static GList *collection_manager_entry_list = NULL;
 static GList *collection_manager_action_list = NULL;
 static GList *collection_manager_action_tail = NULL;
-static gint collection_manager_timer_id = -1;
+static guint collection_manager_timer_id = 0; /* event source id */
 
 
 static CollectManagerAction *collect_manager_action_new(const gchar *oldpath, const gchar *newpath,
@@ -833,18 +833,18 @@
 
 	g_idle_add_full(G_PRIORITY_LOW, collect_manager_process_cb, NULL, NULL);
 
-	collection_manager_timer_id = -1;
+	collection_manager_timer_id = 0;
 	return FALSE;
 }
 
 static void collect_manager_timer_push(gint stop)
 {
-	if (collection_manager_timer_id != -1)
+	if (collection_manager_timer_id)
 		{
 		if (!stop) return;
 
 		g_source_remove(collection_manager_timer_id);
-		collection_manager_timer_id = -1;
+		collection_manager_timer_id = 0;
 		}
 
 	if (!stop)