summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/format/format.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/format/format.c')
-rw-r--r--plugins/pychrysalide/format/format.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/plugins/pychrysalide/format/format.c b/plugins/pychrysalide/format/format.c
index 82cb575..1dc4edd 100644
--- a/plugins/pychrysalide/format/format.c
+++ b/plugins/pychrysalide/format/format.c
@@ -150,17 +150,15 @@ static PyObject *py_binary_format_register_code_point(PyObject *self, PyObject *
static PyObject *py_binary_format_add_symbol(PyObject *self, PyObject *args)
{
PyObject *result; /* Valeur à retourner */
- PyObject *symbol_obj; /* Version Python d'un symbole */
+ GBinSymbol *symbol; /* Enventuel symbole trouvé */
int ret; /* Bilan de lecture des args. */
GBinFormat *format; /* Format de binaire manipulé */
- GBinSymbol *symbol; /* Enventuel symbole trouvé */
bool added; /* Bilan de l'appel interne */
- ret = PyArg_ParseTuple(args, "O!", get_python_binary_symbol_type(), &symbol_obj);
+ ret = PyArg_ParseTuple(args, "O&", convert_to_binary_symbol, &symbol);
if (!ret) return NULL;
format = G_BIN_FORMAT(pygobject_get(self));
- symbol = G_BIN_SYMBOL(pygobject_get(symbol_obj));
g_object_ref(G_OBJECT(symbol));
added = g_binary_format_add_symbol(format, symbol);
@@ -189,16 +187,14 @@ static PyObject *py_binary_format_add_symbol(PyObject *self, PyObject *args)
static PyObject *py_binary_format_remove_symbol(PyObject *self, PyObject *args)
{
PyObject *result; /* Valeur à retourner */
- PyObject *symbol_obj; /* Version Python d'un symbole */
+ GBinSymbol *symbol; /* Enventuel symbole trouvé */
int ret; /* Bilan de lecture des args. */
GBinFormat *format; /* Format de binaire manipulé */
- GBinSymbol *symbol; /* Enventuel symbole trouvé */
- ret = PyArg_ParseTuple(args, "O!", get_python_binary_symbol_type(), &symbol_obj);
+ ret = PyArg_ParseTuple(args, "O&", convert_to_binary_symbol, &symbol);
if (!ret) return NULL;
format = G_BIN_FORMAT(pygobject_get(self));
- symbol = G_BIN_SYMBOL(pygobject_get(symbol_obj));
g_binary_format_remove_symbol(format, symbol);