summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/arch/arm/v7
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysa/arch/arm/v7')
-rw-r--r--plugins/pychrysa/arch/arm/v7/instruction.c16
-rw-r--r--plugins/pychrysa/arch/arm/v7/processor.c15
2 files changed, 7 insertions, 24 deletions
diff --git a/plugins/pychrysa/arch/arm/v7/instruction.c b/plugins/pychrysa/arch/arm/v7/instruction.c
index 8a19259..08e9468 100644
--- a/plugins/pychrysa/arch/arm/v7/instruction.c
+++ b/plugins/pychrysa/arch/arm/v7/instruction.c
@@ -32,6 +32,7 @@
#include "../instruction.h"
+#include "../../../helpers.h"
@@ -93,25 +94,16 @@ PyTypeObject *get_python_armv7_instruction_type(void)
bool register_python_armv7_instruction(PyObject *module)
{
PyTypeObject *py_armv7_instruction_type;/* Type Python 'BinContent' */
- int ret; /* Bilan d'un appel */
PyObject *dict; /* Dictionnaire du module */
py_armv7_instruction_type = get_python_armv7_instruction_type();
- py_armv7_instruction_type->tp_base = get_python_arm_instruction_type();
- py_armv7_instruction_type->tp_basicsize = py_armv7_instruction_type->tp_base->tp_basicsize;
+ dict = PyModule_GetDict(module);
- if (PyType_Ready(py_armv7_instruction_type) != 0)
+ if (!register_class_for_pygobject(dict, G_TYPE_ARMV7_INSTRUCTION,
+ py_armv7_instruction_type, get_python_arm_instruction_type()))
return false;
- Py_INCREF(py_armv7_instruction_type);
- ret = PyModule_AddObject(module, "ArmV7Instruction", (PyObject *)py_armv7_instruction_type);
- if (ret != 0) return false;
-
- dict = PyModule_GetDict(module);
- pygobject_register_class(dict, "ArmV7Instruction", G_TYPE_ARMV7_INSTRUCTION, py_armv7_instruction_type,
- Py_BuildValue("(O)", py_armv7_instruction_type->tp_base));
-
return true;
}
diff --git a/plugins/pychrysa/arch/arm/v7/processor.c b/plugins/pychrysa/arch/arm/v7/processor.c
index 1844066..25bd1eb 100644
--- a/plugins/pychrysa/arch/arm/v7/processor.c
+++ b/plugins/pychrysa/arch/arm/v7/processor.c
@@ -32,6 +32,7 @@
#include "../processor.h"
+#include "../../../helpers.h"
@@ -93,25 +94,15 @@ PyTypeObject *get_python_armv7_processor_type(void)
bool register_python_armv7_processor(PyObject *module)
{
PyTypeObject *py_armv7_processor_type; /* Type Python 'BinContent' */
- int ret; /* Bilan d'un appel */
PyObject *dict; /* Dictionnaire du module */
py_armv7_processor_type = get_python_armv7_processor_type();
- py_armv7_processor_type->tp_base = get_python_arm_processor_type();
- py_armv7_processor_type->tp_basicsize = py_armv7_processor_type->tp_base->tp_basicsize;
+ dict = PyModule_GetDict(module);
- if (PyType_Ready(py_armv7_processor_type) != 0)
+ if (!register_class_for_pygobject(dict, G_TYPE_ARMV7_PROCESSOR, py_armv7_processor_type, get_python_arm_processor_type()))
return false;
- Py_INCREF(py_armv7_processor_type);
- ret = PyModule_AddObject(module, "ArmV7Processor", (PyObject *)py_armv7_processor_type);
- if (ret != 0) return false;
-
- dict = PyModule_GetDict(module);
- pygobject_register_class(dict, "ArmV7Processor", G_TYPE_ARMV7_PROCESSOR, py_armv7_processor_type,
- Py_BuildValue("(O)", py_armv7_processor_type->tp_base));
-
return true;
}