Pointer casting Vs type convertion macros
- From: Jacob Kroon <jacob kroon gmail com>
- To: gtk-list gnome org
- Subject: Pointer casting Vs type convertion macros
- Date: Fri, 24 Feb 2006 13:28:23 +0100
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]