|
The g_return*_if_fail() calls should use PREFIX_IS_TYPE_NAME [1], which
returns whether the given instance is of the right type, not
PREFIX_TYPE_NAME [2], which checks whether the given instance if of the
right type, warns if not, and returns the passed-in instance unchanged.
Using the wrong one means the returned value is the passed-in pointer,
and thus passes the g_return*_if_fail() whenever the pointer is
non-NULL, no matter whether it's of the right type or not.
A warning would still be emitted by g_type_check_instance_cast(), but
the execution wouldn't get short-circuited.
[1] calls g_type_check_instance_is_a()
[2] calls g_type_check_instance_cast()
|