diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-10-18 21:24:25 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-10-18 21:24:25 (GMT) |
commit | 39f8a5c2a48a209507dbc3fd407052999954a199 (patch) | |
tree | 1dc29f7ddab258242c397e4a29a41913b5b24f66 /src | |
parent | f340a5d363c55d77aca047b6dd85dfaaae02bb6d (diff) |
Updated the code for the types built from expressions.
Diffstat (limited to 'src')
-rw-r--r-- | src/analysis/types/expr.c | 6 | ||||
-rw-r--r-- | src/analysis/types/expr.h | 2 |
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 *); |