From 2af35673bb45a8e935e7ff54f78f2d4213edb18f Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Tue, 15 May 2018 21:02:34 +0200 Subject: [PATCH] Update comments about TODO. --- m-core.h | 2 ++ m-string.h | 4 +++- tests/test-malgo.c | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/m-core.h b/m-core.h index fa22248f..da80b738 100644 --- a/m-core.h +++ b/m-core.h @@ -1545,6 +1545,8 @@ m_core_hash (const void *str, size_t length) #define M_GET_CLEAN(...) M_GET_METHOD(CLEAN, M_NO_DEFAULT, __VA_ARGS__) #define M_GET_PUSH(...) M_GET_METHOD(PUSH, M_NO_DEFAULT, __VA_ARGS__) #define M_GET_POP(...) M_GET_METHOD(POP, M_NO_DEFAULT, __VA_ARGS__) +// TODO: PUSH_MOVE (push the object by moving it). obj is cleared at func end. or PUSH_NEW? +// TODO: POP_MOVE (Pop the object by moving it). obj is cleared at func start. #define M_GET_REVERSE(...) M_GET_METHOD(REVERSE, M_NO_DEFAULT, __VA_ARGS__) #define M_GET_GET_STR(...) M_GET_METHOD(GET_STR, M_NO_DEFAULT, __VA_ARGS__) #define M_GET_PARSE_STR(...) M_GET_METHOD(PARSE_STR, M_NO_DEFAULT, __VA_ARGS__) diff --git a/m-string.h b/m-string.h index 555e4733..9824ae7f 100644 --- a/m-string.h +++ b/m-string.h @@ -1130,7 +1130,8 @@ string_utf8_p(string_t str) } -/* Define the split function for algorithm inclusion */ +/* Define the split & the join functions + in case of usage with the algorithm module */ #define STRING_SPLIT(name, oplist, type_oplist) \ static inline void M_C(name, _split)(M_GET_TYPE oplist cont, \ const string_t str, const char sep) \ @@ -1143,6 +1144,7 @@ string_utf8_p(string_t str) char c = string_get_char(str, i); \ if (c == sep) { \ string_set_strn(tmp, &str->ptr[begin], i - begin); \ + /* TODO: PUSH_MOVE will be better if available */ \ M_GET_PUSH oplist (cont, tmp); \ begin = i + 1; \ } \ diff --git a/tests/test-malgo.c b/tests/test-malgo.c index b5e5a00a..6f8e3040 100644 --- a/tests/test-malgo.c +++ b/tests/test-malgo.c @@ -25,6 +25,7 @@ #include "m-string.h" #include "m-algo.h" +// TODO: Test other containers? HASHMAP, RBTREE, B+TREE, Intrusive List ARRAY_DEF(array_int, int) LIST_DEF(list_int, int) LIST_DEF(list_string, string_t, STRING_OPLIST) @@ -32,9 +33,7 @@ LIST_DEF(list_string, string_t, STRING_OPLIST) #include "coverage.h" START_COVERAGE ALGO_DEF(algo_array, ARRAY_OPLIST(array_int)) - ALGO_DEF(algo_list, LIST_OPLIST(list_int)) - ALGO_DEF(algo_string, LIST_OPLIST(list_string, STRING_OPLIST)) END_COVERAGE