Re: What is the best way to default construct an object.
- From: James Henstridge <james daa com au>
- To: Havoc Pennington <hp redhat com>
- Cc: Jeff Franks <jcf tpg com au>, gtk-devel-list gnome org
- Subject: Re: What is the best way to default construct an object.
- Date: Fri, 02 Nov 2001 16:42:59 +1100
Havoc Pennington wrote:
Jeff Franks <jcf tpg com au> writes:
g_object_new(GType, 0);
You're supposed to use this one. (I'm not sure "0" works for a pointer
in if there's no pointer type in the prototype though - what if
sizeof(int) != sizeof(void*)? I'm not enough of a language lawyer to
actually know the answer to that though. ;-)
But the prototype is:
gpointer g_object_new (GType object_type, const gchar
*first_property_name, ...);
So the 0 should get cast correctly to a pointer :)
James.
--
Email: james daa com au
WWW: http://www.daa.com.au/~james/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]