From c2475a319597d498a97e388dada1640fd5543be2 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 30 Jul 2018 07:53:01 +0200 Subject: girepository: port from g_type_class_add_private() to G_ADD_PRIVATE() This lets us enable -Wdeprecated-declarations --- configure.ac | 2 -- girepository/girepository.c | 7 ++----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 78e500ea..29bddde3 100644 --- a/configure.ac +++ b/configure.ac @@ -64,8 +64,6 @@ m4_ifndef([AX_COMPILER_FLAGS], [AC_MSG_ERROR(['autoconf-archive' missing])]) AX_COMPILER_FLAGS(,, [yes]) # These get triggered a lot, not worth it imo, but feel free to fix them AX_APPEND_COMPILE_FLAGS([-Wno-duplicated-branches -Wno-switch-enum]) -# FIXME: Fix the warnings and remove the flags -AX_APPEND_COMPILE_FLAGS([-Wno-deprecated-declarations]) WARN_CFLAGS_PYTHON="$WARN_CFLAGS" AX_APPEND_COMPILE_FLAGS([-Wno-discarded-qualifiers], [WARN_CFLAGS_PYTHON]) diff --git a/girepository/girepository.c b/girepository/girepository.c index 819f8e76..c1fa3d3a 100644 --- a/girepository/girepository.c +++ b/girepository/girepository.c @@ -66,7 +66,7 @@ struct _GIRepositoryPrivate GHashTable *info_by_error_domain; /* GQuark -> GIBaseInfo */ }; -G_DEFINE_TYPE (GIRepository, g_irepository, G_TYPE_OBJECT); +G_DEFINE_TYPE_WITH_CODE (GIRepository, g_irepository, G_TYPE_OBJECT, G_ADD_PRIVATE (GIRepository)); #ifdef G_PLATFORM_WIN32 @@ -104,8 +104,7 @@ DllMain (HINSTANCE hinstDLL, static void g_irepository_init (GIRepository *repository) { - repository->priv = G_TYPE_INSTANCE_GET_PRIVATE (repository, G_TYPE_IREPOSITORY, - GIRepositoryPrivate); + repository->priv = g_irepository_get_instance_private (repository); repository->priv->typelibs = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) NULL, @@ -145,8 +144,6 @@ g_irepository_class_init (GIRepositoryClass *class) gobject_class = G_OBJECT_CLASS (class); gobject_class->finalize = g_irepository_finalize; - - g_type_class_add_private (class, sizeof (GIRepositoryPrivate)); } static void -- cgit v1.2.1