[gnome-builder/wip/libide] libide: use G_DEFINE_BOXED_TYPE()



commit c869bf5e991964711fe3880ae11e384db22d8ff7
Author: Christian Hergert <christian hergert me>
Date:   Wed Feb 11 19:12:13 2015 -0800

    libide: use G_DEFINE_BOXED_TYPE()

 libide/ide-source-location.c |   21 +++------------------
 1 files changed, 3 insertions(+), 18 deletions(-)
---
diff --git a/libide/ide-source-location.c b/libide/ide-source-location.c
index 647dc1b..e39056c 100644
--- a/libide/ide-source-location.c
+++ b/libide/ide-source-location.c
@@ -19,6 +19,9 @@
 #include "ide-file.h"
 #include "ide-source-location.h"
 
+G_DEFINE_BOXED_TYPE (IdeSourceLocation, ide_source_location,
+                     ide_source_location_ref, ide_source_location_unref)
+
 struct _IdeSourceLocation
 {
   volatile gint  ref_count;
@@ -154,21 +157,3 @@ ide_source_location_new (IdeFile *file,
 
   return ret;
 }
-
-GType
-ide_source_location_get_type (void)
-{
-  static gsize type_id;
-
-  if (g_once_init_enter (&type_id))
-    {
-      gsize _type_id;
-
-      _type_id = g_boxed_type_register_static ("IdeSourceLocation",
-          (GBoxedCopyFunc)ide_source_location_ref,
-          (GBoxedFreeFunc)ide_source_location_unref);
-      g_once_init_leave (&type_id, _type_id);
-    }
-
-  return type_id;
-}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]