+2001-09-10 Alex Larsson <alexl@redhat.com>
+
+ * gobject/gboxed.[ch]:
+ * gobject/gsourceclosure.c:
+ Removed is_refcounted and GBoxedInitFunc from
+ g_boxed_type_register_static().
+
Mon Sep 10 11:42:58 2001 Owen Taylor <otaylor@redhat.com>
* glib/gutf8.c glib/gstring.c glib/gfileutils.c glib/gmain.c:
+2001-09-10 Alex Larsson <alexl@redhat.com>
+
+ * gobject/gboxed.[ch]:
+ * gobject/gsourceclosure.c:
+ Removed is_refcounted and GBoxedInitFunc from
+ g_boxed_type_register_static().
+
Mon Sep 10 11:42:58 2001 Owen Taylor <otaylor@redhat.com>
* glib/gutf8.c glib/gstring.c glib/gfileutils.c glib/gmain.c:
+2001-09-10 Alex Larsson <alexl@redhat.com>
+
+ * gobject/gboxed.[ch]:
+ * gobject/gsourceclosure.c:
+ Removed is_refcounted and GBoxedInitFunc from
+ g_boxed_type_register_static().
+
Mon Sep 10 11:42:58 2001 Owen Taylor <otaylor@redhat.com>
* glib/gutf8.c glib/gstring.c glib/gfileutils.c glib/gmain.c:
+2001-09-10 Alex Larsson <alexl@redhat.com>
+
+ * gobject/gboxed.[ch]:
+ * gobject/gsourceclosure.c:
+ Removed is_refcounted and GBoxedInitFunc from
+ g_boxed_type_register_static().
+
Mon Sep 10 11:42:58 2001 Owen Taylor <otaylor@redhat.com>
* glib/gutf8.c glib/gstring.c glib/gfileutils.c glib/gmain.c:
+2001-09-10 Alex Larsson <alexl@redhat.com>
+
+ * gobject/gboxed.[ch]:
+ * gobject/gsourceclosure.c:
+ Removed is_refcounted and GBoxedInitFunc from
+ g_boxed_type_register_static().
+
Mon Sep 10 11:42:58 2001 Owen Taylor <otaylor@redhat.com>
* glib/gutf8.c glib/gstring.c glib/gfileutils.c glib/gmain.c:
+2001-09-10 Alex Larsson <alexl@redhat.com>
+
+ * gobject/gboxed.[ch]:
+ * gobject/gsourceclosure.c:
+ Removed is_refcounted and GBoxedInitFunc from
+ g_boxed_type_register_static().
+
Mon Sep 10 11:42:58 2001 Owen Taylor <otaylor@redhat.com>
* glib/gutf8.c glib/gstring.c glib/gfileutils.c glib/gmain.c:
+2001-09-10 Alex Larsson <alexl@redhat.com>
+
+ * gobject/gboxed.[ch]:
+ * gobject/gsourceclosure.c:
+ Removed is_refcounted and GBoxedInitFunc from
+ g_boxed_type_register_static().
+
Mon Sep 10 11:42:58 2001 Owen Taylor <otaylor@redhat.com>
* glib/gutf8.c glib/gstring.c glib/gfileutils.c glib/gmain.c:
+2001-09-10 Alex Larsson <alexl@redhat.com>
+
+ * gobject/gboxed.[ch]:
+ * gobject/gsourceclosure.c:
+ Removed is_refcounted and GBoxedInitFunc from
+ g_boxed_type_register_static().
+
Mon Sep 10 11:42:58 2001 Owen Taylor <otaylor@redhat.com>
* glib/gutf8.c glib/gstring.c glib/gfileutils.c glib/gmain.c:
typedef struct
{
GType type;
- GBoxedInitFunc init;
GBoxedCopyFunc copy;
GBoxedFreeFunc free;
- gboolean is_refcounted;
} BoxedNode;
}
static gpointer
-value_array_init (void)
-{
- return g_value_array_new (0);
-}
-
-static gpointer
-gstring_init (void)
-{
- return g_string_new ("");
-}
-
-static gpointer
gstring_copy (gpointer boxed)
{
const GString *src_gstring = boxed;
/* boxed: G_TYPE_CLOSURE
*/
type = g_boxed_type_register_static ("GClosure",
- (GBoxedInitFunc) NULL,
(GBoxedCopyFunc) g_closure_ref,
- (GBoxedFreeFunc) g_closure_unref,
- TRUE);
+ (GBoxedFreeFunc) g_closure_unref);
g_assert (type == G_TYPE_CLOSURE);
/* boxed: G_TYPE_VALUE
*/
type = g_boxed_type_register_static ("GValue",
- (GBoxedInitFunc) NULL,
value_copy,
- value_free,
- FALSE);
+ value_free);
g_assert (type == G_TYPE_VALUE);
/* boxed: G_TYPE_VALUE_ARRAY
*/
type = g_boxed_type_register_static ("GValueArray",
- value_array_init, /* don't allow NULL values */
(GBoxedCopyFunc) g_value_array_copy,
- (GBoxedFreeFunc) g_value_array_free,
- FALSE);
+ (GBoxedFreeFunc) g_value_array_free);
g_assert (type == G_TYPE_VALUE_ARRAY);
/* boxed: G_TYPE_GSTRING
* yes, the naming is a bit odd, but GString is obviously not G_TYPE_STRING
*/
type = g_boxed_type_register_static ("GString",
- gstring_init, /* don't allow NULL values */
gstring_copy,
- gstring_free,
- FALSE);
+ gstring_free);
g_assert (type == G_TYPE_GSTRING);
}
key.type = G_VALUE_TYPE (value);
node = g_bsearch_array_lookup (&boxed_bsa, &key);
- value->data[0].v_pointer = node->init ? node->init () : NULL;
+ value->data[0].v_pointer = NULL;
}
static void
key.type = G_VALUE_TYPE (value);
node = g_bsearch_array_lookup (&boxed_bsa, &key);
- /* for NULL values, we have to call GBoxedInitFunc */
if (!collect_values[0].v_pointer)
- value->data[0].v_pointer = node->init ? node->init () : NULL;
+ value->data[0].v_pointer = NULL;
else
{
- /* never honour G_VALUE_NOCOPY_CONTENTS for ref-counted types */
- if (!node->is_refcounted && (collect_flags & G_VALUE_NOCOPY_CONTENTS))
+ if (collect_flags & G_VALUE_NOCOPY_CONTENTS)
{
value->data[0].v_pointer = collect_values[0].v_pointer;
value->data[1].v_uint = G_VALUE_NOCOPY_CONTENTS;
GType
g_boxed_type_register_static (const gchar *name,
- GBoxedInitFunc boxed_init,
GBoxedCopyFunc boxed_copy,
- GBoxedFreeFunc boxed_free,
- gboolean is_refcounted)
+ GBoxedFreeFunc boxed_free)
{
static const GTypeValueTable vtable = {
boxed_proxy_value_init,
BoxedNode key;
key.type = type;
- key.init = boxed_init;
key.copy = boxed_copy;
key.free = boxed_free;
- key.is_refcounted = is_refcounted != FALSE;
g_bsearch_array_insert (&boxed_bsa, &key, TRUE);
}
/* --- typedefs --- */
-typedef gpointer (*GBoxedInitFunc) (void);
typedef gpointer (*GBoxedCopyFunc) (gpointer boxed);
typedef void (*GBoxedFreeFunc) (gpointer boxed);
/* --- convenience --- */
GType g_boxed_type_register_static (const gchar *name,
- GBoxedInitFunc boxed_init,
GBoxedCopyFunc boxed_copy,
- GBoxedFreeFunc boxed_free,
- gboolean is_refcounted);
+ GBoxedFreeFunc boxed_free);
/* --- marshaller specific --- */
if (our_type == 0)
our_type = g_boxed_type_register_static ("GIOChannel",
- NULL,
(GBoxedCopyFunc) g_io_channel_ref,
- (GBoxedFreeFunc) g_io_channel_unref,
- FALSE);
+ (GBoxedFreeFunc) g_io_channel_unref);
return our_type;
}