diff src/pan-view.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 c9ed5a43c576
children 2a96ff43ab3e
line wrap: on
line diff
--- a/src/pan-view.c	Mon Apr 06 21:52:49 2009 +0000
+++ b/src/pan-view.c	Mon Apr 06 22:13:54 2009 +0000
@@ -1107,7 +1107,7 @@
 
 			if (pan_cache_step(pw)) return TRUE;
 
-			pw->idle_id = -1;
+			pw->idle_id = 0;
 			return FALSE;
 			}
 		}
@@ -1142,13 +1142,13 @@
 
 	pan_window_message(pw, NULL);
 
-	pw->idle_id = -1;
+	pw->idle_id = 0;
 	return FALSE;
 }
 
 static void pan_layout_update_idle(PanWindow *pw)
 {
-	if (pw->idle_id == -1)
+	if (!pw->idle_id)
 		{
 		pw->idle_id = g_idle_add(pan_layout_update_idle_cb, pw);
 		}
@@ -2301,7 +2301,7 @@
 	pref_list_int_set(PAN_PREF_GROUP, PAN_PREF_INFO_IMAGE, pw->info_image_size);
 	pref_list_int_set(PAN_PREF_GROUP, PAN_PREF_INFO_EXIF, pw->info_includes_exif);
 
-	if (pw->idle_id != -1)
+	if (pw->idle_id)
 		{
 		g_source_remove(pw->idle_id);
 		}
@@ -2359,8 +2359,7 @@
 
 	pw->ignore_symlinks = TRUE;
 
-	pw->overlay_id = -1;
-	pw->idle_id = -1;
+	pw->idle_id = 0;
 
 	pw->window = window_new(GTK_WINDOW_TOPLEVEL, "panview", NULL, NULL, _("Pan View"));