From 95dbbf6e75b44c04e8e69a4f4ac49e8b38d8604d Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sun, 15 Jul 2018 02:53:35 +0200 Subject: [PATCH] Simplification of the example. --- example/ex-mph.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/example/ex-mph.c b/example/ex-mph.c index ce6681e0..2e39c9ac 100644 --- a/example/ex-mph.c +++ b/example/ex-mph.c @@ -35,7 +35,7 @@ ARRAY_DEF(array_value, uint32_t) // Start from 1. 0 is 'None' // Defin an array of integer ARRAY_DEF(array_seed, int32_t) #define M_OPL_array_seed_t() ARRAY_OPLIST(array_seed) -ALGO_DEF(array_seed, M_OPL_array_seed_t()) +ALGO_DEF(array_seed, array_seed_t) // Define an array of constant string that are ordered by their size. ARRAY_DEF(array_cstr, const char *, M_CSTR_OPLIST) @@ -49,7 +49,7 @@ static inline int array_cstr_cmp(const array_cstr_t a, const array_cstr_t b) { // Define an array of array of constant string, and some algo over this container ARRAY_DEF(array_bucket, array_cstr_t) #define M_OPL_array_bucket_t() ARRAY_OPLIST(array_bucket, M_OPL_array_cstr_t() ) -ALGO_DEF(array_bucket, M_OPL_array_bucket_t()) +ALGO_DEF(array_bucket, array_bucket_t) // Define an array of string to save the input. ARRAY_DEF(array_string, string_t) @@ -199,6 +199,7 @@ dict_read_from_file(dict_mph_t dict, array_string_t arr, const char filename[]) string_strim(str); if (!string_empty_p(str)) { // Not clean as items of 'dict' points are linked to items of 'arr' + // and the containers are not aware of this link. array_string_push_back (arr, str); dict_mph_set_at(dict, string_get_cstr(*array_string_back(arr)), line); line++;