summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/arch
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2023-05-22 20:56:32 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2023-05-22 20:56:32 (GMT)
commite1a2823b5d831349467d309ce42d56055ec9c04f (patch)
treebc4dd464d10cd379622ceb361398895d59849409 /plugins/pychrysalide/arch
parent15fb909bdd8ca0f37dd71da7427ea6bc6bb71cbb (diff)
Rely on GObject-introspection implementation for some registrations.
Diffstat (limited to 'plugins/pychrysalide/arch')
-rw-r--r--plugins/pychrysalide/arch/context.c4
-rw-r--r--plugins/pychrysalide/arch/instruction.c3
-rw-r--r--plugins/pychrysalide/arch/instructions/raw.c4
-rw-r--r--plugins/pychrysalide/arch/instructions/undefined.c4
-rw-r--r--plugins/pychrysalide/arch/operand.c4
-rw-r--r--plugins/pychrysalide/arch/operands/immediate.c2
-rw-r--r--plugins/pychrysalide/arch/operands/known.c2
-rw-r--r--plugins/pychrysalide/arch/operands/proxy.c7
-rw-r--r--plugins/pychrysalide/arch/operands/register.c7
-rw-r--r--plugins/pychrysalide/arch/operands/target.c7
-rw-r--r--plugins/pychrysalide/arch/processor.c4
-rw-r--r--plugins/pychrysalide/arch/register.c4
12 files changed, 30 insertions, 22 deletions
diff --git a/plugins/pychrysalide/arch/context.c b/plugins/pychrysalide/arch/context.c
index b1803a4..79c782f 100644
--- a/plugins/pychrysalide/arch/context.c
+++ b/plugins/pychrysalide/arch/context.c
@@ -121,7 +121,7 @@ static PyObject *py_proc_context_new(PyTypeObject *type, PyObject *args, PyObjec
if (first_time)
{
- status = register_class_for_dynamic_pygobject(gtype, type, base);
+ status = register_class_for_dynamic_pygobject(gtype, type);
if (!status)
{
@@ -522,7 +522,7 @@ bool ensure_python_proc_context_is_registered(void)
if (!ensure_python_preload_info_is_registered())
return false;
- if (!register_class_for_pygobject(dict, G_TYPE_PROC_CONTEXT, type, &PyGObject_Type))
+ if (!register_class_for_pygobject(dict, G_TYPE_PROC_CONTEXT, type))
return false;
if (!define_proc_context_constants(type))
diff --git a/plugins/pychrysalide/arch/instruction.c b/plugins/pychrysalide/arch/instruction.c
index 5acb3bd..f77afca 100644
--- a/plugins/pychrysalide/arch/instruction.c
+++ b/plugins/pychrysalide/arch/instruction.c
@@ -896,8 +896,7 @@ bool ensure_python_arch_instruction_is_registered(void)
if (!ensure_python_line_generator_is_registered())
return false;
- if (!_register_class_for_pygobject(dict, G_TYPE_ARCH_INSTRUCTION, type,
- &PyGObject_Type, get_python_line_generator_type(), NULL))
+ if (!_register_class_for_pygobject(dict, G_TYPE_ARCH_INSTRUCTION, type))
return false;
if (!define_arch_instruction_constants(type))
diff --git a/plugins/pychrysalide/arch/instructions/raw.c b/plugins/pychrysalide/arch/instructions/raw.c
index c1366c6..7e58b96 100644
--- a/plugins/pychrysalide/arch/instructions/raw.c
+++ b/plugins/pychrysalide/arch/instructions/raw.c
@@ -99,7 +99,7 @@ static PyObject *py_raw_instruction_new(PyTypeObject *type, PyObject *args, PyOb
if (first_time)
{
- status = register_class_for_dynamic_pygobject(gtype, type, base);
+ status = register_class_for_dynamic_pygobject(gtype, type);
if (!status)
{
@@ -458,7 +458,7 @@ bool ensure_python_raw_instruction_is_registered(void)
if (!ensure_python_arch_instruction_is_registered())
return false;
- if (!register_class_for_pygobject(dict, G_TYPE_RAW_INSTRUCTION, type, get_python_arch_instruction_type()))
+ if (!register_class_for_pygobject(dict, G_TYPE_RAW_INSTRUCTION, type))
return false;
if (!define_raw_instruction_constants(type))
diff --git a/plugins/pychrysalide/arch/instructions/undefined.c b/plugins/pychrysalide/arch/instructions/undefined.c
index 99fd2ff..1246daa 100644
--- a/plugins/pychrysalide/arch/instructions/undefined.c
+++ b/plugins/pychrysalide/arch/instructions/undefined.c
@@ -88,7 +88,7 @@ static PyObject *py_undef_instruction_new(PyTypeObject *type, PyObject *args, Py
if (first_time)
{
- status = register_class_for_dynamic_pygobject(gtype, type, base);
+ status = register_class_for_dynamic_pygobject(gtype, type);
if (!status)
{
@@ -285,7 +285,7 @@ bool ensure_python_undefined_instruction_is_registered(void)
if (!ensure_python_arch_instruction_is_registered())
return false;
- if (!register_class_for_pygobject(dict, G_TYPE_UNDEF_INSTRUCTION, type, get_python_arch_instruction_type()))
+ if (!register_class_for_pygobject(dict, G_TYPE_UNDEF_INSTRUCTION, type))
return false;
if (!define_undefined_instruction_constants(type))
diff --git a/plugins/pychrysalide/arch/operand.c b/plugins/pychrysalide/arch/operand.c
index edddbe6..abd1f06 100644
--- a/plugins/pychrysalide/arch/operand.c
+++ b/plugins/pychrysalide/arch/operand.c
@@ -149,7 +149,7 @@ static PyObject *py_arch_operand_new(PyTypeObject *type, PyObject *args, PyObjec
if (first_time)
{
- status = register_class_for_dynamic_pygobject(gtype, type, base);
+ status = register_class_for_dynamic_pygobject(gtype, type);
if (!status)
{
@@ -787,7 +787,7 @@ bool ensure_python_arch_operand_is_registered(void)
if (!ensure_python_singleton_candidate_is_registered())
return false;
- if (!register_class_for_pygobject(dict, G_TYPE_ARCH_OPERAND, type, &PyGObject_Type))
+ if (!register_class_for_pygobject(dict, G_TYPE_ARCH_OPERAND, type))
return false;
}
diff --git a/plugins/pychrysalide/arch/operands/immediate.c b/plugins/pychrysalide/arch/operands/immediate.c
index 62f6328..2239eb2 100644
--- a/plugins/pychrysalide/arch/operands/immediate.c
+++ b/plugins/pychrysalide/arch/operands/immediate.c
@@ -603,7 +603,7 @@ bool ensure_python_imm_operand_is_registered(void)
if (!ensure_python_renameable_operand_is_registered())
return false;
- if (!register_class_for_pygobject(dict, G_TYPE_IMM_OPERAND, type, get_python_arch_operand_type()))
+ if (!register_class_for_pygobject(dict, G_TYPE_IMM_OPERAND, type))
return false;
if (!define_imm_operand_constants(type))
diff --git a/plugins/pychrysalide/arch/operands/known.c b/plugins/pychrysalide/arch/operands/known.c
index 435ea0f..fab426e 100644
--- a/plugins/pychrysalide/arch/operands/known.c
+++ b/plugins/pychrysalide/arch/operands/known.c
@@ -169,7 +169,7 @@ bool ensure_python_known_imm_operand_is_registered(void)
if (!ensure_python_renamed_operand_is_registered())
return false;
- if (!register_class_for_pygobject(dict, G_TYPE_KNOWN_IMM_OPERAND, type, get_python_imm_operand_type()))
+ if (!register_class_for_pygobject(dict, G_TYPE_KNOWN_IMM_OPERAND, type))
return false;
}
diff --git a/plugins/pychrysalide/arch/operands/proxy.c b/plugins/pychrysalide/arch/operands/proxy.c
index 1cfd4a4..5009d29 100644
--- a/plugins/pychrysalide/arch/operands/proxy.c
+++ b/plugins/pychrysalide/arch/operands/proxy.c
@@ -105,7 +105,7 @@ static PyObject *py_proxy_operand_new(PyTypeObject *type, PyObject *args, PyObje
if (first_time)
{
- status = register_class_for_dynamic_pygobject(gtype, type, base);
+ status = register_class_for_dynamic_pygobject(gtype, type);
if (!status)
{
@@ -319,7 +319,10 @@ bool ensure_python_proxy_operand_is_registered(void)
dict = PyModule_GetDict(module);
- if (!register_class_for_pygobject(dict, G_TYPE_PROXY_OPERAND, type, get_python_arch_operand_type()))
+ if (!ensure_python_arch_operand_is_registered())
+ return false;
+
+ if (!register_class_for_pygobject(dict, G_TYPE_PROXY_OPERAND, type))
return false;
}
diff --git a/plugins/pychrysalide/arch/operands/register.c b/plugins/pychrysalide/arch/operands/register.c
index d032e04..2a48a0f 100644
--- a/plugins/pychrysalide/arch/operands/register.c
+++ b/plugins/pychrysalide/arch/operands/register.c
@@ -112,7 +112,7 @@ static PyObject *py_register_operand_new(PyTypeObject *type, PyObject *args, PyO
if (first_time)
{
- status = register_class_for_dynamic_pygobject(gtype, type, base);
+ status = register_class_for_dynamic_pygobject(gtype, type);
if (!status)
{
@@ -427,7 +427,10 @@ bool ensure_python_register_operand_is_registered(void)
dict = PyModule_GetDict(module);
- if (!register_class_for_pygobject(dict, G_TYPE_REGISTER_OPERAND, type, get_python_arch_operand_type()))
+ if (!ensure_python_arch_operand_is_registered())
+ return false;
+
+ if (!register_class_for_pygobject(dict, G_TYPE_REGISTER_OPERAND, type))
return false;
}
diff --git a/plugins/pychrysalide/arch/operands/target.c b/plugins/pychrysalide/arch/operands/target.c
index 76c8269..b8cd536 100644
--- a/plugins/pychrysalide/arch/operands/target.c
+++ b/plugins/pychrysalide/arch/operands/target.c
@@ -115,7 +115,7 @@ static PyObject *py_target_operand_new(PyTypeObject *type, PyObject *args, PyObj
if (first_time)
{
- status = register_class_for_dynamic_pygobject(gtype, type, base);
+ status = register_class_for_dynamic_pygobject(gtype, type);
if (!status)
{
@@ -429,10 +429,13 @@ bool ensure_python_target_operand_is_registered(void)
dict = PyModule_GetDict(module);
+ if (!ensure_python_arch_operand_is_registered())
+ return false;
+
if (!ensure_python_targetable_operand_is_registered())
return false;
- if (!register_class_for_pygobject(dict, G_TYPE_TARGET_OPERAND, type, get_python_arch_operand_type()))
+ if (!register_class_for_pygobject(dict, G_TYPE_TARGET_OPERAND, type))
return false;
}
diff --git a/plugins/pychrysalide/arch/processor.c b/plugins/pychrysalide/arch/processor.c
index 80b55d3..00b472f 100644
--- a/plugins/pychrysalide/arch/processor.c
+++ b/plugins/pychrysalide/arch/processor.c
@@ -186,7 +186,7 @@ static PyObject *py_arch_processor_new(PyTypeObject *type, PyObject *args, PyObj
if (first_time)
{
- status = register_class_for_dynamic_pygobject(gtype, type, base);
+ status = register_class_for_dynamic_pygobject(gtype, type);
if (!status)
{
@@ -1452,7 +1452,7 @@ bool ensure_python_arch_processor_is_registered(void)
dict = PyModule_GetDict(module);
- if (!register_class_for_pygobject(dict, G_TYPE_ARCH_PROCESSOR, type, &PyGObject_Type))
+ if (!register_class_for_pygobject(dict, G_TYPE_ARCH_PROCESSOR, type))
return false;
if (!define_arch_processor_constants(type))
diff --git a/plugins/pychrysalide/arch/register.c b/plugins/pychrysalide/arch/register.c
index 5d9e90b..615a5b7 100644
--- a/plugins/pychrysalide/arch/register.c
+++ b/plugins/pychrysalide/arch/register.c
@@ -144,7 +144,7 @@ static PyObject *py_arch_register_new(PyTypeObject *type, PyObject *args, PyObje
if (first_time)
{
- status = register_class_for_dynamic_pygobject(gtype, type, base);
+ status = register_class_for_dynamic_pygobject(gtype, type);
if (!status)
{
@@ -686,7 +686,7 @@ bool ensure_python_arch_register_is_registered(void)
if (!ensure_python_serializable_object_is_registered())
return false;
- if (!register_class_for_pygobject(dict, G_TYPE_ARCH_REGISTER, type, &PyGObject_Type))
+ if (!register_class_for_pygobject(dict, G_TYPE_ARCH_REGISTER, type))
return false;
}