From 5dd935b27a765177960bdfe4d2fcb296cbbd41da Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Wed, 20 May 2020 00:44:44 +0200 Subject: Simplified the code by using existing helpers.h --- plugins/pychrysalide/arch/instruction.c | 8 +------- plugins/pychrysalide/arch/processor.c | 8 +------- plugins/pychrysalide/gui/panel.c | 8 +------- plugins/pychrysalide/plugin.c | 8 +------- 4 files changed, 4 insertions(+), 28 deletions(-) diff --git a/plugins/pychrysalide/arch/instruction.c b/plugins/pychrysalide/arch/instruction.c index a8ce3ab..058106d 100644 --- a/plugins/pychrysalide/arch/instruction.c +++ b/plugins/pychrysalide/arch/instruction.c @@ -379,7 +379,6 @@ static int py_arch_instruction_init(PyObject *self, PyObject *args, PyObject *kw unsigned short int uid; /* Indentifiant unique de type */ const char *keyword; /* Désignation d'instruction */ int ret; /* Bilan de lecture des args. */ - PyObject *new_kwds; /* Nouveau dictionnaire épuré */ GPyArchInstruction *instr; /* Instruction à manipuler */ static char *kwlist[] = { "uid", "keyword", NULL }; @@ -391,12 +390,7 @@ static int py_arch_instruction_init(PyObject *self, PyObject *args, PyObject *kw /* Initialisation d'un objet GLib */ - new_kwds = PyDict_New(); - - ret = PyGObject_Type.tp_init(self, args, new_kwds); - - Py_DECREF(new_kwds); - + ret = forward_pygobjet_init(self); if (ret == -1) return -1; /* Eléments de base */ diff --git a/plugins/pychrysalide/arch/processor.c b/plugins/pychrysalide/arch/processor.c index 71ef153..bd1b521 100644 --- a/plugins/pychrysalide/arch/processor.c +++ b/plugins/pychrysalide/arch/processor.c @@ -278,7 +278,6 @@ static int py_arch_processor_init(PyObject *self, PyObject *args, PyObject *kwds { unsigned int endianness; /* Boutisme du processeur */ int ret; /* Bilan de lecture des args. */ - PyObject *new_kwds; /* Nouveau dictionnaire épuré */ GArchProcessor *proc; /* Processeur à manipuler */ static char *kwlist[] = { "endianness", NULL }; @@ -313,12 +312,7 @@ static int py_arch_processor_init(PyObject *self, PyObject *args, PyObject *kwds /* Initialisation d'un objet GLib */ - new_kwds = PyDict_New(); - - ret = PyGObject_Type.tp_init(self, args, new_kwds); - - Py_DECREF(new_kwds); - + ret = forward_pygobjet_init(self); if (ret == -1) return -1; /* Eléments de base */ diff --git a/plugins/pychrysalide/gui/panel.c b/plugins/pychrysalide/gui/panel.c index 4f00ee3..fd31ef8 100644 --- a/plugins/pychrysalide/gui/panel.c +++ b/plugins/pychrysalide/gui/panel.c @@ -191,7 +191,6 @@ static int py_panel_item_init(PyObject *self, PyObject *args, PyObject *kwds) int startup; /* Recommandation au démarrage */ const char *path; /* Placement à l'affichage */ int ret; /* Bilan de lecture des args. */ - PyObject *new_kwds; /* Nouveau dictionnaire épuré */ GPanelItem *panel; /* Panneau à manipuler */ GEditorItem *item; /* Version basique d'instance */ @@ -239,12 +238,7 @@ static int py_panel_item_init(PyObject *self, PyObject *args, PyObject *kwds) /* Initialisation d'un objet GLib */ - new_kwds = PyDict_New(); - - ret = PyGObject_Type.tp_init(self, args, new_kwds); - - Py_DECREF(new_kwds); - + ret = forward_pygobjet_init(self); if (ret == -1) return -1; /* Eléments de base */ diff --git a/plugins/pychrysalide/plugin.c b/plugins/pychrysalide/plugin.c index 208c46a..3f3b56a 100644 --- a/plugins/pychrysalide/plugin.c +++ b/plugins/pychrysalide/plugin.c @@ -246,7 +246,6 @@ static void py_plugin_module_init_gclass(GPluginModuleClass *class, gpointer unu static int py_plugin_module_init(PyObject *self, PyObject *args, PyObject *kwds) { - PyObject *new_kwds; /* Nouveau dictionnaire épuré */ int ret; /* Bilan d'un appel */ GPluginModule *plugin; /* Greffon à manipuler */ plugin_interface *iface; /* Interface à constituer */ @@ -285,12 +284,7 @@ static int py_plugin_module_init(PyObject *self, PyObject *args, PyObject *kwds) /* Initialisation d'un objet GLib */ - new_kwds = PyDict_New(); - - ret = PyGObject_Type.tp_init(self, args, new_kwds); - - Py_DECREF(new_kwds); - + ret = forward_pygobjet_init(self); if (ret == -1) return -1; /* Eléments de base */ -- cgit v0.11.2-87-g4458