diff options
author | Emmanuele Bassi <ebassi@linux.intel.com> | 2010-10-19 09:49:05 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@linux.intel.com> | 2010-10-19 09:49:05 +0100 |
commit | 80665415cd945f3dafed6925c9975f36b916a80f (patch) | |
tree | d5c8507c928274a6f8bfd408a21f9d0fcf5605e0 | |
parent | 51e2eef48fabbee554193ee9eadfb8696ebb3ac7 (diff) | |
download | json-glib-80665415cd945f3dafed6925c9975f36b916a80f.tar.gz |
Use G_DEFINE_BOXED_TYPE()
-rw-r--r-- | json-glib/json-array.c | 13 | ||||
-rw-r--r-- | json-glib/json-node.c | 13 | ||||
-rw-r--r-- | json-glib/json-object.c | 13 |
3 files changed, 3 insertions, 36 deletions
diff --git a/json-glib/json-array.c b/json-glib/json-array.c index da26898..a51bf35 100644 --- a/json-glib/json-array.c +++ b/json-glib/json-array.c @@ -44,18 +44,7 @@ * To retrieve the length of the array, use json_array_get_length(). */ -GType -json_array_get_type (void) -{ - static GType array_type = 0; - - if (G_UNLIKELY (!array_type)) - array_type = g_boxed_type_register_static (g_intern_static_string ("JsonArray"), - (GBoxedCopyFunc) json_array_ref, - (GBoxedFreeFunc) json_array_unref); - - return array_type; -} +G_DEFINE_BOXED_TYPE (JsonArray, json_array, json_array_ref, json_array_unref); /** * json_array_new: diff --git a/json-glib/json-node.c b/json-glib/json-node.c index 6a79c4c..c8763fe 100644 --- a/json-glib/json-node.c +++ b/json-glib/json-node.c @@ -48,18 +48,7 @@ * they contain. */ -GType -json_node_get_type (void) -{ - static GType node_type = 0; - - if (G_UNLIKELY (node_type == 0)) - node_type = g_boxed_type_register_static (g_intern_static_string ("JsonNode"), - (GBoxedCopyFunc) json_node_copy, - (GBoxedFreeFunc) json_node_free); - - return node_type; -} +G_DEFINE_BOXED_TYPE (JsonNode, json_node, json_node_copy, json_node_free); /** * json_node_get_value_type: diff --git a/json-glib/json-object.c b/json-glib/json-object.c index 51072be..3b7a5fb 100644 --- a/json-glib/json-object.c +++ b/json-glib/json-object.c @@ -47,18 +47,7 @@ * use json_object_get_size(). */ -GType -json_object_get_type (void) -{ - static GType object_type = 0; - - if (G_UNLIKELY (!object_type)) - object_type = g_boxed_type_register_static (g_intern_static_string ("JsonObject"), - (GBoxedCopyFunc) json_object_ref, - (GBoxedFreeFunc) json_object_unref); - - return object_type; -} +G_DEFINE_BOXED_TYPE (JsonObject, json_object, json_object_ref, json_object_unref); /** * json_object_new: |