[libpeas] libpeas: ignore GParameter deprecation



commit 8ee917d0f2f276efef38f79962d6e9f379298d96
Author: Christian Hergert <chergert redhat com>
Date:   Mon Aug 5 14:47:08 2019 -0700

    libpeas: ignore GParameter deprecation
    
    The API we use here relies on GParameter, and while it may be deprecated
    from GLib, the API will have to live for some time in libpeas itself.
    
    Instead, we can disable deprecations and rely on the GLib compiler
    warnings for projects that are consuming these APIs.
    
    Doing so also frees up a lot of our console output in builds to ensure
    people see other deprecations that need to be adjusted.

 libpeas/peas-engine.c          |  7 ++++++-
 libpeas/peas-extension-set.c   | 13 +++++++++++++
 libpeas/peas-object-module.c   |  4 ++++
 libpeas/peas-plugin-loader-c.c |  2 ++
 libpeas/peas-plugin-loader.c   |  2 ++
 libpeas/peas-utils.c           |  2 ++
 libpeas/peas-utils.h           |  2 ++
 7 files changed, 31 insertions(+), 1 deletion(-)
---
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index 5713cb0..9b70569 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -1301,6 +1301,7 @@ peas_engine_provides_extension (PeasEngine     *engine,
   return peas_plugin_loader_provides_extension (loader, info, extension_type);
 }
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 /**
  * peas_engine_create_extensionv: (rename-to peas_engine_create_extension)
  * @engine: A #PeasEngine.
@@ -1352,6 +1353,7 @@ peas_engine_create_extensionv (PeasEngine     *engine,
 
   return extension;
 }
+G_GNUC_END_IGNORE_DEPRECATIONS
 
 /**
  * peas_engine_create_extension_valist: (skip)
@@ -1381,9 +1383,12 @@ peas_engine_create_extension_valist (PeasEngine     *engine,
                                      const gchar    *first_property,
                                      va_list         var_args)
 {
-  guint n_parameters;
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   GParameter *parameters;
+  G_GNUC_END_IGNORE_DEPRECATIONS
+
   PeasExtension *exten;
+  guint n_parameters;
 
   g_return_val_if_fail (PEAS_IS_ENGINE (engine), NULL);
   g_return_val_if_fail (info != NULL, NULL);
diff --git a/libpeas/peas-extension-set.c b/libpeas/peas-extension-set.c
index a4e0f3f..9fa738a 100644
--- a/libpeas/peas-extension-set.c
+++ b/libpeas/peas-extension-set.c
@@ -92,7 +92,10 @@ struct _PeasExtensionSetPrivate {
   PeasEngine *engine;
   GType exten_type;
   guint n_parameters;
+
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   GParameter *parameters;
+  G_GNUC_END_IGNORE_DEPRECATIONS
 
   GQueue extensions;
 };
@@ -104,7 +107,10 @@ typedef struct {
 
 typedef struct {
   guint n_parameters;
+
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   GParameter *parameters;
+  G_GNUC_END_IGNORE_DEPRECATIONS
 } PeasParameterArray;
 
 /* Signals */
@@ -142,7 +148,10 @@ set_construct_properties (PeasExtensionSet   *set,
 
   priv->n_parameters = array->n_parameters;
 
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   priv->parameters = g_new0 (GParameter, array->n_parameters);
+  G_GNUC_END_IGNORE_DEPRECATIONS
+
   for (i = 0; i < array->n_parameters; i++)
     {
       priv->parameters[i].name = g_intern_string (array->parameters[i].name);
@@ -604,6 +613,8 @@ peas_extension_set_foreach (PeasExtensionSet            *set,
     }
 }
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
 /**
  * peas_extension_set_newv: (rename-to peas_extension_set_new)
  * @engine: (allow-none): A #PeasEngine, or %NULL.
@@ -691,6 +702,8 @@ peas_extension_set_new_valist (PeasEngine  *engine,
   return set;
 }
 
+G_GNUC_END_IGNORE_DEPRECATIONS
+
 /**
  * peas_extension_set_new: (skip)
  * @engine: (allow-none): A #PeasEngine, or %NULL.
diff --git a/libpeas/peas-object-module.c b/libpeas/peas-object-module.c
index 6711667..bc771e6 100644
--- a/libpeas/peas-object-module.c
+++ b/libpeas/peas-object-module.c
@@ -433,6 +433,7 @@ peas_object_module_new_embedded (const gchar *module_name,
                                            NULL));
 }
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 /**
  * peas_object_module_create_object: (skip)
  * @module: A #PeasObjectModule.
@@ -473,6 +474,7 @@ peas_object_module_create_object (PeasObjectModule *module,
 
   return NULL;
 }
+G_GNUC_END_IGNORE_DEPRECATIONS
 
 /**
  * peas_object_module_provides_object: (skip)
@@ -624,6 +626,7 @@ peas_object_module_register_extension_factory (PeasObjectModule *module,
   g_debug ("Registered extension for type '%s'", g_type_name (exten_type));
 }
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 static GObject *
 create_gobject_from_type (guint       n_parameters,
                           GParameter *parameters,
@@ -653,6 +656,7 @@ create_gobject_from_type (guint       n_parameters,
 
   return G_OBJECT (g_object_newv (impl_type, n_parameters, parameters));
 }
+G_GNUC_END_IGNORE_DEPRECATIONS
 
 /**
  * peas_object_module_register_extension_type:
diff --git a/libpeas/peas-plugin-loader-c.c b/libpeas/peas-plugin-loader-c.c
index a476eb4..5395945 100644
--- a/libpeas/peas-plugin-loader-c.c
+++ b/libpeas/peas-plugin-loader-c.c
@@ -110,6 +110,7 @@ peas_plugin_loader_c_provides_extension  (PeasPluginLoader *loader,
   return peas_object_module_provides_object (info->loader_data, exten_type);
 }
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 static PeasExtension *
 peas_plugin_loader_c_create_extension (PeasPluginLoader *loader,
                                        PeasPluginInfo   *info,
@@ -158,6 +159,7 @@ peas_plugin_loader_c_create_extension (PeasPluginLoader *loader,
 
   return instance;
 }
+G_GNUC_END_IGNORE_DEPRECATIONS
 
 static void
 peas_plugin_loader_c_init (PeasPluginLoaderC *cloader)
diff --git a/libpeas/peas-plugin-loader.c b/libpeas/peas-plugin-loader.c
index e918ec0..136d7c3 100644
--- a/libpeas/peas-plugin-loader.c
+++ b/libpeas/peas-plugin-loader.c
@@ -116,6 +116,7 @@ peas_plugin_loader_provides_extension (PeasPluginLoader *loader,
   return klass->provides_extension (loader, info, ext_type);
 }
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 PeasExtension *
 peas_plugin_loader_create_extension (PeasPluginLoader *loader,
                                      PeasPluginInfo   *info,
@@ -131,6 +132,7 @@ peas_plugin_loader_create_extension (PeasPluginLoader *loader,
   return klass->create_extension (loader, info, ext_type,
                                   n_parameters, parameters);
 }
+G_GNUC_END_IGNORE_DEPRECATIONS
 
 void
 peas_plugin_loader_garbage_collect (PeasPluginLoader *loader)
diff --git a/libpeas/peas-utils.c b/libpeas/peas-utils.c
index 8436301..ba10452 100644
--- a/libpeas/peas-utils.c
+++ b/libpeas/peas-utils.c
@@ -180,6 +180,7 @@ find_param_spec_for_prerequisites (const gchar  *name,
   return pspec;
 }
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 gboolean
 peas_utils_valist_to_parameter_list (GType         exten_type,
                                      const gchar  *first_property,
@@ -250,6 +251,7 @@ error:
   g_free (*params);
   return FALSE;
 }
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 
 gint
 peas_utils_get_loader_id (const gchar *loader)
diff --git a/libpeas/peas-utils.h b/libpeas/peas-utils.h
index 5a19ba0..52c6875 100644
--- a/libpeas/peas-utils.h
+++ b/libpeas/peas-utils.h
@@ -27,11 +27,13 @@
 #define PEAS_UTILS_C_LOADER_ID  0
 #define PEAS_UTILS_N_LOADERS    4
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 gboolean  peas_utils_valist_to_parameter_list (GType         exten_type,
                                                const gchar  *first_property,
                                                va_list       var_args,
                                                GParameter  **params,
                                                guint        *n_params);
+G_GNUC_END_IGNORE_DEPRECATIONS
 
 gint     peas_utils_get_loader_id             (const gchar  *loader) G_GNUC_CONST;
 const gchar *


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