Use G_DEFINE_[BOXED|POINTER]_TYPE instead of handwritten code

Now that we have convenience macros to implement boxed and pointer
types, use them.
This commit is contained in:
Christian Persch
2008-05-24 16:08:28 +02:00
parent dc1999316d
commit 71e73ffdfb
7 changed files with 51 additions and 264 deletions

View File

@@ -65,21 +65,8 @@ struct _GSrvTarget {
* A single target host/port that a network service is running on.
*/
GType
g_srv_target_get_type (void)
{
static volatile gsize type_volatile = 0;
if (g_once_init_enter (&type_volatile))
{
GType type = g_boxed_type_register_static (
g_intern_static_string ("GSrvTarget"),
(GBoxedCopyFunc) g_srv_target_copy,
(GBoxedFreeFunc) g_srv_target_free);
g_once_init_leave (&type_volatile, type);
}
return type_volatile;
}
G_DEFINE_BOXED_TYPE (GSrvTarget, g_srv_target,
g_srv_target_copy, g_srv_target_free)
/**
* g_srv_target_new: