diff src/color-man.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 3a9fb1b52559
children b5608391f479
line wrap: on
line diff
--- a/src/color-man.c	Mon Apr 06 21:52:49 2009 +0000
+++ b/src/color-man.c	Mon Apr 06 22:13:54 2009 +0000
@@ -326,7 +326,7 @@
 	if (cm->imd &&
 	    cm->pixbuf != image_get_pixbuf(cm->imd))
 		{
-		cm->idle_id = -1;
+		cm->idle_id = 0;
 		color_man_done(cm, COLOR_RETURN_IMAGE_CHANGED);
 		return FALSE;
 		}
@@ -341,7 +341,7 @@
 			image_area_changed(cm->imd, 0, 0, width, height);
 			}
 
-		cm->idle_id = -1;
+		cm->idle_id = 0;
 		color_man_done(cm, COLOR_RETURN_SUCCESS);
 		return FALSE;
 		}
@@ -369,10 +369,6 @@
 	cm->pixbuf = pixbuf;
 	if (cm->pixbuf) g_object_ref(cm->pixbuf);
 
-	cm->incremental_sync = FALSE;
-	cm->row = 0;
-	cm->idle_id = -1;
-
 	has_alpha = pixbuf ? gdk_pixbuf_get_has_alpha(pixbuf) : FALSE;
 
 	cm->profile = color_man_cache_get(input_type, input_file, input_data, input_data_len,
@@ -415,7 +411,7 @@
 {
 	if (!cm) return;
 
-	if (cm->idle_id != -1) g_source_remove(cm->idle_id);
+	if (cm->idle_id) g_source_remove(cm->idle_id);
 	if (cm->pixbuf) g_object_unref(cm->pixbuf);
 
 	color_man_cache_unref(cm->profile);