diff options
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/pychrysalide/dt.c | 15 | 
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;  }  | 
