contenttype tests: better assertions
[platform/upstream/glib.git] / gio / gsrvtarget.c
index ac70627..3422750 100644 (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:
@@ -216,7 +203,7 @@ g_srv_target_get_weight (GSrvTarget *target)
   return target->weight;
 }
 
-gint
+static gint
 compare_target (gconstpointer a, gconstpointer b)
 {
   GSrvTarget *ta = (GSrvTarget *)a;
@@ -235,12 +222,12 @@ compare_target (gconstpointer a, gconstpointer b)
 }
 
 /**
- * g_srv_target_list_sort:
+ * g_srv_target_list_sort: (skip)
  * @targets: a #GList of #GSrvTarget
  *
  * Sorts @targets in place according to the algorithm in RFC 2782.
  *
- * Return value: the head of the sorted list.
+ * Return value: (transfer full): the head of the sorted list.
  *
  * Since: 2.22
  */