File cheops-ng-pointer_int_casts.patch of Package cheops-ng

--- agent-discover.c
+++ agent-discover.c
@@ -262,7 +262,7 @@
 	
 		DEBUG( c_log(LOG_WARNING,"Recieved ping reply %s\n",inet_ntoa(sin.sin_addr)) );
 	
-		add_to_cache((void *)sin.sin_addr.s_addr,NULL);
+		add_to_cache((void *)(unsigned long)sin.sin_addr.s_addr,NULL);
 		
 		send_discover_reply(sin.sin_addr.s_addr,pp);
 	}
@@ -302,7 +302,7 @@
 		}
 		
 
-		if((pp->flags & FLAG_FORCE) || !in_cache((void *)ntohl(pp->current)))
+		if((pp->flags & FLAG_FORCE) || !in_cache((void *)(long)ntohl(pp->current)))
 		{
 			/* Have to send a ping packet */
 			
--- cheops-agent.c
+++ cheops-agent.c
@@ -119,7 +119,7 @@
 
 void *do_it(void *type)
 {
-	if( event_create_agent((int)type) )
+	if( event_create_agent((int)(unsigned long)type) )
 	{
 		c_log(LOG_ERROR, "unable to listen.\n");
 		exit(1);
@@ -142,7 +142,7 @@
 
 void do_tasks(int type)
 {
-	do_it((void *)type);
+	do_it((void *)(unsigned long)type);
 }
 
 int main(int argc, char *argv[])
--- cheops-gui.c
+++ cheops-gui.c
@@ -475,7 +475,7 @@
 
 static void do_map(GtkWidget *w, gpointer data)
 {
-	switch((int)data)
+	switch(GPOINTER_TO_INT(data))
 	{
 		case 0:
 			net_page_map_all(get_current_net_page());
@@ -607,7 +607,7 @@
 
 static void do_zoom(GtkWidget *w, gpointer data)
 {
-	switch((int)data)
+	switch(GPOINTER_TO_INT(data))
 	{
 		case 0:
 			net_page_zoom_normal(get_current_net_page());
@@ -747,7 +747,7 @@
 	char *name;
 	net_page *np = get_current_net_page();
 	
-	export_type = (int)data;
+	export_type = GPOINTER_TO_INT(data);
 	if(np->name && strlen(np->name) > 0)
 	{
 		name = malloc(strlen(np->name) + 1 + 4);
--- gui-canvas.c
+++ gui-canvas.c
@@ -1876,8 +1876,8 @@
 
 void page_object_service_callback(GtkWidget *widget, gpointer data)
 {
-	int port = (u32)data >> 8;
-	int protocol = (u32)data & 0xFF;
+	int port = (u32)(unsigned long)data >> 8;
+	int protocol = (u32)(unsigned long)data & 0xFF;
 
 	// there can only be one page_object selected that can show the service list,
 	// so i use this quick and dirty way to get at the page object :)
@@ -2259,7 +2259,7 @@
 						item = gtk_menu_item_new_with_label(buf);
 						gtk_signal_connect(GTK_OBJECT(item), "activate",
 						                   GTK_SIGNAL_FUNC(page_object_service_callback),
-						                   (gpointer)(port->port << 8) + port->protocol);
+						                   GINT_TO_POINTER(port->port << 8) + port->protocol);
 						
 						gtk_menu_append(GTK_MENU(submenu), item);
 						gtk_widget_show(item);
@@ -2314,7 +2314,7 @@
 					item = gtk_menu_item_new_with_label(buf);
 					gtk_signal_connect(GTK_OBJECT(item), "activate",
 					                   GTK_SIGNAL_FUNC(page_object_service_callback),
-					                   (gpointer)(port->port << 8) + port->protocol);
+					                   GINT_TO_POINTER(port->port << 8) + port->protocol);
 					
 					gtk_menu_append(GTK_MENU(pagemenu), item);
 					gtk_widget_show(item);
--- gui-io.c
+++ gui-io.c
@@ -59,7 +59,7 @@
 	l->callback = callback;
 	l->events = events;
 	l->data = data;
-	l->id = (void *)gdk_input_add(fd,events,gtk_cheops_io_std_callback,l);
+	l->id = GINT_TO_POINTER(gdk_input_add(fd,events,gtk_cheops_io_std_callback,l));
 	l->next = list;
 	list = l;
 	
@@ -83,7 +83,7 @@
 			{
 				prev->next = l->next;
 			}
-			gdk_input_remove((int)id);
+			gdk_input_remove((int)(unsigned long)id);
 			free(l);
 			ret=0;
 			break;
--- gui-service.c
+++ gui-service.c
@@ -153,7 +153,7 @@
 	}
 	
 	for(c = &default_list[0]; c[0];c+=4)
-		service_list_add( *(c), (int)*(c+1), (int)*(c+2), *(c+3));
+		service_list_add( *(c), (int)(unsigned long)*(c+1), (int)(unsigned long)*(c+2), *(c+3));
 }	
 
 void service_list_remove(int port, int protocol)
--- probe.c
+++ probe.c
@@ -92,8 +92,8 @@
 
 void get_probe_each(gpointer data, gpointer user_data)
 {
-	u32 *args = (u32 *)user_data;
-	u32 port = args[0];
+	uintptr_t *args = (uintptr_t *)user_data;
+	uintptr_t port = args[0];
 	struct probe *p = (struct probe *)data;
 	struct probe **pp = (struct probe **)args[1];
 	
@@ -107,12 +107,12 @@
 
 struct probe *get_probe(unsigned short port)
 {
-	u32 args[2];
+	uintptr_t args[2];
 	struct probe *p = NULL;
 	
 	DEBUG(printf("%s()\n", __FUNCTION__));
 	args[0] = port;
-	args[1] = (u32)&p;
+	args[1] = (uintptr_t)&p;
 	
 	g_list_foreach(probes, get_probe_each, args);
 	
@@ -229,7 +229,7 @@
 char *strip_version(int fd, void *arg, void *user_data)
 {
 	char *c, *d;
-	int count = (int)arg;
+	long count = (long)arg;
 	DEBUG(printf("%s()\n", __FUNCTION__));
 	
 	c = get_text(fd, arg, user_data);
@@ -255,7 +255,7 @@
 char *strip_newline(int fd, void *arg, void *user_data)
 {
 	char *c, *d;
-	int count = (int)arg;
+	long count = (long)arg;
 	DEBUG(printf("%s()\n", __FUNCTION__));
 	
 	c = get_text(fd, arg, user_data);
--- script.c
+++ script.c
@@ -45,7 +45,7 @@
 	script_list = NULL;
 	
 	for(c = &default_list[0]; c[0]; c += 3)
-		script_add(*c, *(c + 1), (unsigned int)*(c + 2));
+		script_add(*c, *(c + 1), (unsigned long)*(c + 2));
 }	
 
 script_t *script_add(char *name, char *script, unsigned int flags)