From 4d370b81498fc93e0199232110e9edeb526fd53b Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Tue, 21 Apr 2020 20:53:45 +0200 Subject: Deleted obsolete code for dynamic types. --- plugins/pychrysalide/arch/processor.c | 19 ---------- src/plugins/dt.c | 66 ----------------------------------- src/plugins/dt.h | 6 ---- 3 files changed, 91 deletions(-) diff --git a/plugins/pychrysalide/arch/processor.c b/plugins/pychrysalide/arch/processor.c index 1cfb989..37f97a4 100644 --- a/plugins/pychrysalide/arch/processor.c +++ b/plugins/pychrysalide/arch/processor.c @@ -254,23 +254,6 @@ static PyObject *py_arch_processor_new(PyTypeObject *type, PyObject *args, PyObj static void py_arch_processor_init_gclass(GArchProcessorClass *class, gpointer unused) { - GType type; /* Type d'instances concerné */ - GArchProcessor *pattern; /* Patron de données à copier */ - - type = G_TYPE_FROM_CLASS(class); - - pattern = get_dynamic_type_pattern(type); - - if (pattern != NULL) - { - /* - class->endianness = pattern->endianness; - class->memsize = pattern->memsize; - class->inssize = pattern->inssize; - class->virt_space = pattern->virt_space; - */ - } - class->get_key = py_arch_processor_get_key_wrapper; class->get_desc = py_arch_processor_get_desc_wrapper; class->get_memsize = py_arch_processor_get_memory_size_wrapper; @@ -346,8 +329,6 @@ static int py_arch_processor_init(PyObject *self, PyObject *args, PyObject *kwds proc->endianness = endianness; - //register_dynamic_type_pattern(G_OBJECT(proc)); - return 0; } diff --git a/src/plugins/dt.c b/src/plugins/dt.c index a97785f..69bd5df 100644 --- a/src/plugins/dt.c +++ b/src/plugins/dt.c @@ -51,8 +51,6 @@ typedef struct _type_dyn_info_t GInstanceInitFunc init; /* Phase d'initialisation #2 */ - void *pattern; /* Modèle de données d'instance*/ - } type_dyn_info_t; /* Description de fichier binaire (instance) */ @@ -393,8 +391,6 @@ static GType g_dynamic_types_register_type(GDynamicTypes *types, GType parent, c new->init = init; - new->pattern = NULL; - /* Inscription définitive */ types->info = realloc(types->info, ++types->count * sizeof(type_dyn_info_t *)); @@ -486,65 +482,3 @@ GType build_dynamic_type(GType parent, const char *name, GClassInitFunc cinit, g return result; } - - -/****************************************************************************** -* * -* Paramètres : instance = instance portant les données à conserver. * -* * -* Description : Enregistre les données correspondant à une instance. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -void register_dynamic_type_pattern(GObject *instance) -{ - GType type; /* Type d'instances concerné */ - type_dyn_info_t *nfo; /* Source d'inspiration */ - GType parent; /* Type parent du type */ - GTypeQuery query; /* Informations complémentaires*/ - - type = G_TYPE_FROM_INSTANCE(instance); - - nfo = g_dynamic_types_find(_chrysalide_dtypes, type); - assert(nfo != NULL); - - parent = g_type_parent(type); - g_type_query(parent, &query); - - if (nfo->pattern == NULL) - nfo->pattern = malloc(query.instance_size); - - memcpy(nfo->pattern, instance, query.instance_size); - -} - - -/****************************************************************************** -* * -* Paramètres : type = type d'une instance créée sans initialisation. * -* * -* Description : Fournit les données correspondant à une instance initiale. * -* * -* Retour : Données issues de la première instance d'un type ou NULL. * -* * -* Remarques : - * -* * -******************************************************************************/ - -void *get_dynamic_type_pattern(GType type) -{ - void *result; /* Modèle éventuel à retourner */ - type_dyn_info_t *nfo; /* Source d'inspiration */ - - nfo = g_dynamic_types_find(_chrysalide_dtypes, type); - assert(nfo != NULL); - - result = nfo->pattern; - - return result; - -} diff --git a/src/plugins/dt.h b/src/plugins/dt.h index afa6580..88e17ba 100644 --- a/src/plugins/dt.h +++ b/src/plugins/dt.h @@ -42,12 +42,6 @@ void exit_chrysalide_dynamic_types(void); /* Fournit un identifiant GLib pour un nouveau type. */ GType build_dynamic_type(GType, const char *, GClassInitFunc, gconstpointer, GInstanceInitFunc); -/* Enregistre les données correspondant à une instance. */ -void register_dynamic_type_pattern(GObject *); - -/* Fournit les données correspondant à une instance initiale. */ -void *get_dynamic_type_pattern(GType); - #endif /* _PLUGINS_PYCHRYSALIDE_DT_H */ -- cgit v0.11.2-87-g4458