Pointer casting Vs type convertion macros



Hi,

Extract from gtk_button_class_init():

...
gobject_class = G_OBJECT_CLASS (klass);
object_class = (GtkObjectClass*) klass;
widget_class = (GtkWidgetClass*) klass;
container_class = (GtkContainerClass*) klass;
...

Why does the code use the type convertion macro for the gobject_class, but pointer casting
for the rest of the classes ? Is there a reason for this ?

I'm trying to figure out when one can use pointer casting instead of type macros, but I guess it boils down to how sure you are that the pointer really is what you think it is...?

//Jacob




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