summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-10-18 21:24:25 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-10-18 21:24:25 (GMT)
commit39f8a5c2a48a209507dbc3fd407052999954a199 (patch)
tree1dc29f7ddab258242c397e4a29a41913b5b24f66 /src
parentf340a5d363c55d77aca047b6dd85dfaaae02bb6d (diff)
Updated the code for the types built from expressions.
Diffstat (limited to 'src')
-rw-r--r--src/analysis/types/expr.c6
-rw-r--r--src/analysis/types/expr.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/analysis/types/expr.c b/src/analysis/types/expr.c
index 376b0b4..02005f4 100644
--- a/src/analysis/types/expr.c
+++ b/src/analysis/types/expr.c
@@ -175,13 +175,13 @@ static void g_expr_type_finalize(GExprType *type)
* *
******************************************************************************/
-GDataType *g_expr_type_new(char *value)
+GDataType *g_expr_type_new(const char *value)
{
GExprType *result; /* Structure à retourner */
result = g_object_new(G_TYPE_EXPR_TYPE, NULL);
- result->value = value;
+ result->value = strdup(value);
return G_DATA_TYPE(result);
@@ -204,7 +204,7 @@ static GDataType *g_expr_type_dup(const GExprType *type)
{
GDataType *result; /* Copie à retourner */
- result = g_expr_type_new(strdup(type->value));
+ result = g_expr_type_new(type->value);
return result;
diff --git a/src/analysis/types/expr.h b/src/analysis/types/expr.h
index 3f7c953..45f66e3 100644
--- a/src/analysis/types/expr.h
+++ b/src/analysis/types/expr.h
@@ -51,7 +51,7 @@ typedef struct _GExprTypeClass GExprTypeClass;
GType g_expr_type_get_type(void);
/* Crée une représentation de type sous forme d'expressions. */
-GDataType *g_expr_type_new(char *);
+GDataType *g_expr_type_new(const char *);
/* Fournit la valeur d'un type fourni sous forme de caractères. */
const char *g_expr_type_get_value(const GExprType *);