diff options
Diffstat (limited to 'plugins/pychrysa/arch/arm/instruction.c')
| -rw-r--r-- | plugins/pychrysa/arch/arm/instruction.c | 17 | 
1 files changed, 4 insertions, 13 deletions
| diff --git a/plugins/pychrysa/arch/arm/instruction.c b/plugins/pychrysa/arch/arm/instruction.c index ed53386..14c4ab5 100644 --- a/plugins/pychrysa/arch/arm/instruction.c +++ b/plugins/pychrysa/arch/arm/instruction.c @@ -94,26 +94,17 @@ PyTypeObject *get_python_arm_instruction_type(void)  bool register_python_arm_instruction(PyObject *module)  {      PyTypeObject *py_arm_instruction_type;  /* Type Python 'BinContent'    */ -    int ret;                                /* Bilan d'un appel            */      PyObject *dict;                         /* Dictionnaire du module      */      py_arm_instruction_type = get_python_arm_instruction_type(); -    py_arm_instruction_type->tp_base = get_python_arch_instruction_type(); -    py_arm_instruction_type->tp_basicsize = py_arm_instruction_type->tp_base->tp_basicsize; -      APPLY_ABSTRACT_FLAG(py_arm_instruction_type); -    if (PyType_Ready(py_arm_instruction_type) != 0) -        return false; - -    Py_INCREF(py_arm_instruction_type); -    ret = PyModule_AddObject(module, "ArmInstruction", (PyObject *)py_arm_instruction_type); -    if (ret != 0) return false; -      dict = PyModule_GetDict(module); -    pygobject_register_class(dict, "ArmInstruction", G_TYPE_ARM_INSTRUCTION, py_arm_instruction_type, -                             Py_BuildValue("(O)", py_arm_instruction_type->tp_base)); + +    if (!register_class_for_pygobject(dict, G_TYPE_ARM_INSTRUCTION, +                                      py_arm_instruction_type, get_python_arch_instruction_type())) +        return false;      return true; | 
