Re: warning in g_value_register_transform_func

Sven Neumann <sven gimp org> writes:

> Hi Tim,
> I wonder if the g_warning in g_value_register_transform_func() makes
> sense (gvalue.c:267):
>   if (transform_func_lookup (src_type, dest_type))
>     g_warning ("reregistering value transformation function (%p) for `%s' to `%s'",
> 	       transform_func,
> 	       g_type_name (src_type),
> 	       g_type_name (dest_type));
> is there a reason why one shouldn't be able to change a transform_func?
> If so, there still is a problem since transform_func_lookup() does not
> check if there's a transform function registered for the two types.
> Instead it walks up the type hierarchy and pulls in a transform function
> from a parent class if one is available. This fact makes it impossible
> to register different transform functions for deriveded value types.
> Oh, well, it does not really make it impossible. In fact, it works
> pretty well (check gimp CVS), but there's that warning being emitted :-(

I think this is just a bug and the check here is meant to be for an exact
match on the two types. (The inner check in the loop in transform_func_lookup() -
the check for value table equality isn't needed in this context, but won't

Why don't you go ahead and make up a patch to fix this problem.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]