changeset 529:8815fea478ee

fix warning cast from pointer to integer of different size (when an integer is passed instead of a pointer to a callback, GINT_TO_POINTER(i) should be used)
author bruclik
date Sun, 27 Apr 2008 23:31:20 +0000
parents bf9c9e37adf4
children 1d67ef911fa8
files src/layout_image.c
diffstat 1 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/layout_image.c	Sun Apr 27 20:05:11 2008 +0000
+++ b/src/layout_image.c	Sun Apr 27 23:31:20 2008 +0000
@@ -1194,27 +1194,27 @@
 
  		for (last = y = x; y; y = y->next)
  			last = y;
-		for (y = x; y && ((gint)y->data) != index; y = y->next)
+		for (y = x; y && (GPOINTER_TO_INT(y->data)) != index; y = y->next)
 			;
 
 		if (y)
 			{
 			gint newindex;
 
-			if ((index > old && (index != (gint) last->data || old != (gint) x->data))
- 	        	    || (old == (gint) last->data && index == (gint) x->data))
+			if ((index > old && (index != GPOINTER_TO_INT(last->data) || old != GPOINTER_TO_INT(x->data)))
+ 	        	    || (old == GPOINTER_TO_INT(last->data) && index == GPOINTER_TO_INT(x->data)))
 				{
 				if (y->next)
- 					newindex = (gint) y->next->data;
+					newindex = GPOINTER_TO_INT(y->next->data);
 				else
- 					newindex = (gint) x->data;
+					newindex = GPOINTER_TO_INT(x->data);
 				}
 			else
 				{
 				if (y->prev)
-					newindex = (gint) y->prev->data;
+					newindex = GPOINTER_TO_INT(y->prev->data);
 				else
-					newindex = (gint) last->data;
+					newindex = GPOINTER_TO_INT(last->data);
  	    			}
 
 			read_ahead_fd = layout_list_get_fd(lw, newindex);
@@ -1338,14 +1338,14 @@
 		gint old = layout_list_get_index(lw, layout_image_get_path(lw));
 		GList *y;
 
-		for (y = x; y && ((gint) y->data) != old; y = y->next)
+		for (y = x; y && (GPOINTER_TO_INT(y->data)) != old; y = y->next)
 			;
 		if (y)
 			{
 			if (y->next)
-				layout_image_set_index(lw, (gint) y->next->data);
+				layout_image_set_index(lw, GPOINTER_TO_INT(y->next->data));
 			else
-				layout_image_set_index(lw, (gint) x->data);
+				layout_image_set_index(lw, GPOINTER_TO_INT(x->data));
 			}
 		while (x)
 			x = g_list_remove(x, x->data);
@@ -1411,14 +1411,14 @@
 
 		for (last = y = x; y; y = y->next)
 			last = y;
-		for (y = x; y && ((gint) y->data) != old; y = y->next)
+		for (y = x; y && (GPOINTER_TO_INT(y->data)) != old; y = y->next)
 			;
 		if (y)
 			{
 			if (y->prev)
-				layout_image_set_index(lw, (gint) y->prev->data);
+				layout_image_set_index(lw, GPOINTER_TO_INT(y->prev->data));
 			else
-				layout_image_set_index(lw, (gint) last->data);
+				layout_image_set_index(lw, GPOINTER_TO_INT(last->data));
 			}
 		while (x)
 			x = g_list_remove(x, x->data);