<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39555 >

On 13/08/07, William Allen Simpson <[EMAIL PROTECTED]> wrote:
>
> That's why GTK2 uses macros for such things.

 As does Xaw. Already committed patch attached.

> It's pretty silly to grab the index from the pointer, cram it into a
> pointer, convert it back to an integer on the other side, then lookup the
> original pointer!
>
> Passing pointers in the first place would be better....

 Indeed.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/gui-xaw/repodlgs.c freeciv/client/gui-xaw/repodlgs.c
--- freeciv/client/gui-xaw/repodlgs.c	2007-08-13 20:51:06.000000000 +0300
+++ freeciv/client/gui-xaw/repodlgs.c	2007-08-14 00:05:40.000000000 +0300
@@ -347,7 +347,7 @@
 				  popupmenu,
 				  NULL);
 	XtAddCallback(entry, XtNcallback, science_change_callback,
-		      (XtPointer) i);
+		      INT_TO_XTPOINTER(i));
       flag = 1;
       }
     } advance_index_iterate_end;
@@ -368,7 +368,7 @@
 				  goalmenu,
 				  NULL);
 	XtAddCallback(entry, XtNcallback, science_goal_callback, 
-		      (XtPointer) i); 
+		      INT_TO_XTPOINTER(i)); 
 	flag = 1;
       }
     } advance_index_iterate_end;
@@ -557,7 +557,7 @@
 				  popupmenu,
 				  NULL);
 	XtAddCallback(entry, XtNcallback, science_change_callback, 
-		      (XtPointer) i); 
+		      INT_TO_XTPOINTER(i)); 
 	flag=1;
       }
     } advance_index_iterate_end;
@@ -583,7 +583,7 @@
 				  goalmenu,
 				  NULL);
 	XtAddCallback(entry, XtNcallback, science_goal_callback, 
-		      (XtPointer) i); 
+		      INT_TO_XTPOINTER(i)); 
 	flag=1;
       }
     } advance_index_iterate_end;
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to