diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/itanium/component.c | 5 | ||||
-rw-r--r-- | plugins/pychrysalide/analysis/types/expr.c | 27 |
2 files changed, 25 insertions, 7 deletions
diff --git a/plugins/itanium/component.c b/plugins/itanium/component.c index 3baad57..25ea175 100644 --- a/plugins/itanium/component.c +++ b/plugins/itanium/component.c @@ -1407,6 +1407,7 @@ GDataType *itd_translate_component_to_type(const itanium_component *comp, Routin GDataType *arg; /* Argument de prototype */ GDataType *members; /* Type de membres de tableau */ GDataType *param; /* Paramètre de gabarit */ + char *value; /* Valeur quelconque exprimée */ /* Pour GCC !? */ result = NULL; @@ -1855,7 +1856,9 @@ GDataType *itd_translate_component_to_type(const itanium_component *comp, Routin break; case ICT_OPERATED_EXPRESSION: - result = g_expr_type_new(itd_translate_component(comp, NULL)); + value = itd_translate_component(comp, NULL); + result = g_expr_type_new(value); + free(value); break; case ICT_STD_SUBST: diff --git a/plugins/pychrysalide/analysis/types/expr.c b/plugins/pychrysalide/analysis/types/expr.c index 0d68a60..02cb02f 100644 --- a/plugins/pychrysalide/analysis/types/expr.c +++ b/plugins/pychrysalide/analysis/types/expr.c @@ -67,10 +67,20 @@ static PyObject *py_expr_type_new(PyTypeObject *type, PyObject *args, PyObject * int ret; /* Bilan de lecture des args. */ GDataType *dtype; /* Version GLib du type */ +#define EXPR_TYPE_DOC \ + "The ExprType class handles raw expressions defined for some types.\n" \ + "\n" \ + "Instances can be created using the following constructor:\n" \ + "\n" \ + " ExprType(value)" \ + "\n" \ + "The *value* expression can be any string value, which is not further" \ + " processed." + ret = PyArg_ParseTuple(args, "s", &value); if (!ret) return NULL; - dtype = g_expr_type_new(strdup(value)); + dtype = g_expr_type_new(value); result = pygobject_new(G_OBJECT(dtype)); g_object_unref(dtype); @@ -98,6 +108,14 @@ static PyObject *py_expr_type_get_value(PyObject *self, void *closure) GExprType *type; /* Version GLib du type */ const char *value; /* Valeur exprimée */ +#define EXPR_TYPE_VALUE_ATTRIB PYTHON_GET_DEF_FULL \ +( \ + value, py_expr_type, \ + "Value of the expression type.\n" \ + "\n" \ + "This value can be any string." \ +) + type = G_EXPR_TYPE(pygobject_get(self)); value = g_expr_type_get_value(type); @@ -128,10 +146,7 @@ PyTypeObject *get_python_expr_type_type(void) }; static PyGetSetDef py_expr_type_getseters[] = { - { - "value", py_expr_type_get_value, NULL, - "Provide the value of the expression type.", NULL - }, + EXPR_TYPE_VALUE_ATTRIB, { NULL } }; @@ -144,7 +159,7 @@ PyTypeObject *get_python_expr_type_type(void) .tp_flags = Py_TPFLAGS_DEFAULT, - .tp_doc = "PyChrysalide expr type", + .tp_doc = EXPR_TYPE_DOC, .tp_methods = py_expr_type_methods, .tp_getset = py_expr_type_getseters, |