summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-12-29 14:52:02 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-12-29 14:52:02 (GMT)
commitab3e5a58c2bde7802ba22cfad6113fe77bc86da4 (patch)
tree277c9dcaceca39701dcf49fee91e2ccd6f3d2c98 /plugins
parentf6b02ed08bb39257436921154dc617f4a07ca990 (diff)
Allowed more than one dynamic GType.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/pychrysalide/dt.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/plugins/pychrysalide/dt.c b/plugins/pychrysalide/dt.c
index edfc032..0b46b45 100644
--- a/plugins/pychrysalide/dt.c
+++ b/plugins/pychrysalide/dt.c
@@ -97,7 +97,7 @@ static void g_dynamic_types_unuse(GDynamicTypes *);
static void g_dynamic_types_complete_type(GDynamicTypes *, GType, GTypeInfo *, GTypeValueTable *);
/* Retrouve les informations concernant un type dynamique. */
-static type_dyn_info_t *g_dynamic_types_find(GDynamicTypes *, GType);
+static const type_dyn_info_t *g_dynamic_types_find(const GDynamicTypes *, GType);
/* Fournit un identifiant GLib pour un nouveau type Python. */
static GType g_dynamic_types_register_type(GDynamicTypes *, GType, const char *, GClassInitFunc);
@@ -296,7 +296,7 @@ static void g_dynamic_types_unuse(GDynamicTypes *types)
static void g_dynamic_types_complete_type(GDynamicTypes *types, GType type, GTypeInfo *info, GTypeValueTable *table)
{
- type_dyn_info_t *nfo; /* Source d'inspiration */
+ const type_dyn_info_t *nfo; /* Source d'inspiration */
GType parent; /* Type parent du type */
GTypeQuery query; /* Informations complémentaires*/
@@ -331,11 +331,18 @@ static void g_dynamic_types_complete_type(GDynamicTypes *types, GType type, GTyp
* *
******************************************************************************/
-static type_dyn_info_t *g_dynamic_types_find(GDynamicTypes *types, GType target)
+static const type_dyn_info_t *g_dynamic_types_find(const GDynamicTypes *types, GType target)
{
+ type_dyn_info_t *result; /* Informations à retourner */
+ size_t i; /* Boucle de parcours */
- return types->info[0];
+ result = NULL;
+ for (i = 0; i < types->count && result == NULL; i++)
+ if (types->info[i]->type == target)
+ result = types->info[i];
+
+ return result;
}