Hi,

Dave Neary <[EMAIL PROTECTED]> writes:

> I couldn't build gimp 1.2 (with gcc 2.96 - RedHat's 7.0 prerelease) for
> the first time recently because of the following line in
> app/histogram_tool.c:
> Line 230:
>       gimp_option_menu_set_history (g_list_nth_data
> (gtk_container_children 
>       (GTK_CONTAINER (histogram_tool_dialog->channel_menu)), 1), 
>       GIMP_HISTOGRAM_VALUE);
> 
> The prototype for gimp_option_menu_set_history is 
> void  gimp_option_menu_set_history (GtkOptionMenu      *option_menu,
>                                   gpointer            user_data);
> and GIMP_HISTOGRAM_VALUE is an enum value equal to 0. The problem is
> hidden with a cast to gpointer.

the code is subtly wrong. Integers (thus enums) should always be casted
using GINT_TO_POINTER() before passing them as user_data. The callback
function then has to use GPOINTER_TO_INT(). Usually these macros do
nothing but cast to (void *) and (int) respectively, but an explicit
cast should be enough here to make your compiler happy.

I'll look into fixing this later or wait for a patch. Please report if 
you find more of these.


Salut, Sven
_______________________________________________
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer

Reply via email to