diff --git a/m-array.h b/m-array.h index 77bbc7f7..56a43d72 100644 --- a/m-array.h +++ b/m-array.h @@ -89,7 +89,7 @@ ,INIT_MOVE(M_F(name, _init_move)) \ ,MOVE(M_F(name, _move)) \ ,SWAP(M_F(name, _swap)) \ - ,TYPE(M_F(name,_ct)) \ + ,TYPE(M_F(name,_ct)) , GENTYPE(struct M_F(name,_s)*) \ ,NAME(name) \ ,SUBTYPE(M_F(name, _subtype_ct)) \ ,EMPTY_P(M_F(name,_empty_p)) \ diff --git a/m-bptree.h b/m-bptree.h index bd823311..5ef60be6 100644 --- a/m-bptree.h +++ b/m-bptree.h @@ -166,7 +166,7 @@ MOVE(M_F(name, _move)), \ SWAP(M_F(name, _swap)), \ NAME(name), \ - TYPE(M_F(name,_ct)), \ + TYPE(M_F(name,_ct)), GENTYPE(struct M_F(name,_s)*), \ SUBTYPE(M_F(name, _subtype_ct)), \ IT_TYPE(M_F(name, _it_ct)), \ IT_FIRST(M_F(name,_it)), \ @@ -215,7 +215,7 @@ MOVE(M_F(name, _move)), \ SWAP(M_F(name, _swap)), \ NAME(name), \ - TYPE(M_F(name,_ct)), \ + TYPE(M_F(name,_ct)), GENTYPE(struct M_F(name,_s)*), \ SUBTYPE(M_F(name, _subtype_ct)), \ EMPTY_P(M_F(name,_empty_p)), \ IT_TYPE(M_F(name, _it_ct)), \ diff --git a/m-buffer.h b/m-buffer.h index a98630fa..a3ee02f3 100644 --- a/m-buffer.h +++ b/m-buffer.h @@ -1308,7 +1308,7 @@ M_F(name, _init)(buffer_t v, size_t size) \ ,SET(M_F(name, _set)) \ ,CLEAR(M_F(name, _clear)) \ ,NAME(name) \ - ,TYPE(M_F(name,_ct)) \ + ,TYPE(M_F(name,_ct)), GENTYPE(struct M_F(name,_s)*) \ ,SUBTYPE(M_F(name, _subtype_ct)) \ ,RESET(M_F(name,_reset)) \ ,PUSH(M_F(name,_push)) \ diff --git a/m-concurrent.h b/m-concurrent.h index 0360c39f..4a940424 100644 --- a/m-concurrent.h +++ b/m-concurrent.h @@ -106,7 +106,7 @@ ,M_IF_METHOD(MOVE, oplist)(MOVE(M_F(name, _move)),) \ ,M_IF_METHOD(SWAP,oplist)(SWAP(M_F(name, _swap)),) \ ,NAME(name) \ - ,TYPE(M_F(name,_ct)) \ + ,TYPE(M_F(name,_ct)), GENTYPE(struct M_F(name,_s)*) \ ,SUBTYPE(M_F(name, _subtype_ct)) \ ,OPLIST(oplist) \ ,M_IF_METHOD(EMPTY_P, oplist)(EMPTY_P(M_F(name,_empty_p)),) \ diff --git a/m-deque.h b/m-deque.h index f8742e71..eecba7fd 100644 --- a/m-deque.h +++ b/m-deque.h @@ -1104,7 +1104,7 @@ ,MOVE(M_F(name, _move)) \ ,SWAP(M_F(name, _swap)) \ ,NAME(name) \ - ,TYPE(M_F(name,_ct)) \ + ,TYPE(M_F(name,_ct)), GENTYPE(struct M_F(name,_s)*) \ ,SUBTYPE(M_F(name, _subtype_ct)) \ ,EMPTY_P(M_F(name,_empty_p)) \ ,IT_TYPE(M_F(name,_it_ct)) \ diff --git a/m-dict.h b/m-dict.h index 61f086b8..b0cacc21 100644 --- a/m-dict.h +++ b/m-dict.h @@ -1071,7 +1071,7 @@ SWAP(M_F(name, _swap)), \ RESET(M_F(name, _reset)), \ NAME(name), \ - TYPE(M_F(name, _ct)), \ + TYPE(M_F(name, _ct)), GENTYPE(struct M_F(name,_s)*), \ SUBTYPE(M_F(name, _subtype_ct)), \ EMPTY_P(M_F(name,_empty_p)), \ IT_TYPE(M_F(name, _it_ct)), \ @@ -1126,7 +1126,7 @@ SWAP(M_F(name, _swap)), \ RESET(M_F(name, _reset)), \ NAME(name), \ - TYPE(M_F(name, _ct)), \ + TYPE(M_F(name, _ct)), GENTYPE(struct M_F(name,_s)*), \ SUBTYPE(M_F(name, _subtype_ct)), \ EMPTY_P(M_F(name,_empty_p)), \ PUSH(M_F(name,_push)), \ diff --git a/m-funcobj.h b/m-funcobj.h index 7b5401e8..f4d4d9d4 100644 --- a/m-funcobj.h +++ b/m-funcobj.h @@ -111,7 +111,7 @@ /* Specialization of the OPLIST in function if there is at least one member or not */ #define M_FUNC0BJ_INS_NO_ATTR_OPLIST(name) ( \ NAME(name), \ - TYPE(M_F(name, _ct)), \ + TYPE(M_F(name, _ct)), GENTYPE(struct M_F(name,_s)*), \ CLEAR(M_F(name, _clear)), \ INIT(M_F(name,_init)) \ ) @@ -127,7 +127,7 @@ /* Define the oplist of the instance */ #define M_FUNC0BJ_INS_ATTR_OPLIST_P3(name, ...) ( \ NAME(name), \ - TYPE(M_F(name, _ct)), \ + TYPE(M_F(name, _ct)), GENTYPE(struct M_F(name,_s)*), \ INIT_WITH(M_F(name, _init_with)), \ CLEAR(M_F(name, _clear)), \ M_IF_METHOD_ALL(INIT, __VA_ARGS__)(INIT(M_F(name,_init)),), \ diff --git a/m-i-list.h b/m-i-list.h index 9ce955d6..f9a88ff2 100644 --- a/m-i-list.h +++ b/m-i-list.h @@ -100,7 +100,7 @@ typedef struct m_il1st_head_s { INIT_MOVE(M_F(name, _init_move)), \ MOVE(M_F(name, _move)), \ NAME(name), \ - TYPE(M_F(name,_ct)), \ + TYPE(M_F(name,_ct)), GENTYPE(struct M_F(name,_s)*), \ RESET(M_F(name,_reset)), \ SUBTYPE(M_F(name,_subtype_ct)), \ EMPTY_P(M_F(name,_empty_p)), \ diff --git a/m-i-shared.h b/m-i-shared.h index f81fa555..9c6b1e48 100644 --- a/m-i-shared.h +++ b/m-i-shared.h @@ -95,7 +95,7 @@ M_BEGIN_PROTECTED_CODE CLEAR(M_F(name, _clear)), \ RESET(M_F(name, _reset) M_IPTR), \ NAME(name), \ - TYPE(M_F(name, _ct)), \ + TYPE(M_F(name, _ct)), GENTYPE(struct M_F(name,_s)*), \ OPLIST(oplist), \ SUBTYPE(M_F(name, _subtype_ct)) \ ) diff --git a/m-list.h b/m-list.h index 7a79b9a9..fc5951fb 100644 --- a/m-list.h +++ b/m-list.h @@ -109,7 +109,7 @@ INIT_MOVE(M_F(name, _init_move)), \ SWAP(M_F(name, _swap)), \ NAME(name), \ - TYPE(M_F(name,_ct)), \ + TYPE(M_F(name,_ct)), GENTYPE(struct M_F(name,_s)**), \ SUBTYPE(M_F(name,_subtype_ct)), \ EMPTY_P(M_F(name,_empty_p)), \ IT_TYPE(M_F(name, _it_ct)), \ diff --git a/m-prioqueue.h b/m-prioqueue.h index 4c79c0a6..2a30a12e 100644 --- a/m-prioqueue.h +++ b/m-prioqueue.h @@ -82,7 +82,7 @@ ,MOVE(M_F(name, _move)) \ ,SWAP(M_F(name, _swap)) \ ,NAME(name) \ - ,TYPE(M_F(name,_ct)) \ + ,TYPE(M_F(name,_ct)), GENTYPE(struct M_F(name,_s)*) \ ,SUBTYPE(M_F(name, _subtype_ct)) \ ,RESET(M_F(name,_reset)) \ ,PUSH(M_F(name,_push)) \ diff --git a/m-rbtree.h b/m-rbtree.h index f5880f20..460d878a 100644 --- a/m-rbtree.h +++ b/m-rbtree.h @@ -81,7 +81,7 @@ MOVE(M_F(name, _move)), \ SWAP(M_F(name, _swap)), \ NAME(name), \ - TYPE(M_F(name,_ct)), \ + TYPE(M_F(name,_ct)), GENTYPE(struct M_F(name,_s)*), \ SUBTYPE(M_F(name, _subtype_ct)), \ EMPTY_P(M_F(name,_empty_p)), \ GET_SIZE(M_F(name, _size)), \ diff --git a/m-shared.h b/m-shared.h index 8fba531d..17847af9 100644 --- a/m-shared.h +++ b/m-shared.h @@ -118,7 +118,7 @@ M_BEGIN_PROTECTED_CODE MOVE(M_F(name, _move)), \ SWAP(M_F(name, _swap)) \ ,NAME(name) \ - ,TYPE(M_F(name, _ct)) \ + ,TYPE(M_F(name, _ct)), GENTYPE(struct M_F(name,_s)*) \ ) // OPLIST to handle a counter of atomic type diff --git a/m-snapshot.h b/m-snapshot.h index 860ce57f..7b24480a 100644 --- a/m-snapshot.h +++ b/m-snapshot.h @@ -112,7 +112,7 @@ M_BEGIN_PROTECTED_CODE ,SET(M_F(name, _set)) \ ,CLEAR(M_F(name, _clear)) \ ,NAME(name) \ - ,TYPE(M_F(name, _ct)) \ + ,TYPE(M_F(name, _ct)) , GENTYPE(struct M_F(name,_s)*) \ ,SUBTYPE(M_F(name, _subtype_ct)) \ ,OPLIST(oplist) \ ,M_IF_METHOD(INIT_MOVE, oplist)(INIT_MOVE(M_F(name, _init_move)),) \ diff --git a/m-string.h b/m-string.h index e10dc4b3..039e4e7d 100644 --- a/m-string.h +++ b/m-string.h @@ -2101,7 +2101,7 @@ namespace m_lib { SWAP(m_string_swap), RESET(m_string_reset), \ EMPTY_P(m_string_empty_p), \ CLEAR(m_string_clear), HASH(m_string_hash), EQUAL(m_string_equal_p), \ - CMP(m_string_cmp), TYPE(m_string_t), GENTYPE(struct m_string_s *), \ + CMP(m_string_cmp), TYPE(m_string_t), GENTYPE(struct m_string_s*), \ PARSE_STR(m_string_parse_str), GET_STR(m_string_get_str), \ OUT_STR(m_string_out_str), IN_STR(m_string_in_str), \ OUT_SERIAL(m_string_out_serial), IN_SERIAL(m_string_in_serial), \ @@ -2197,7 +2197,7 @@ namespace m_lib { /* Set the string a to the string (or C string) b */ #define m_string_set(a,b) M_STR1NG_SELECT2(m_string_set, m_string_set_cstr, a, b) -/* Concatene the string (or C string) b to the string a */ +/* Concatenate the string (or C string) b to the string a */ #define m_string_cat(a,b) M_STR1NG_SELECT2(m_string_cat, m_string_cat_cstr, a, b) /* Compare the string a to the string (or C string) b and return the sort order */ @@ -2273,7 +2273,7 @@ namespace m_lib { HASH(M_F(name,_hash)), \ EQUAL(M_F(name,_equal_p)), \ CMP(M_F(name,_cmp)), \ - TYPE(M_F(name,_ct)), \ + TYPE(M_F(name,_ct)), GENTYPE(struct M_F(name,_s)*), \ OOR_EQUAL(M_F(name,_oor_equal_p)), \ OOR_SET(M_F(name, _oor_set)), \ PARSE_STR(M_F(name,_parse_str)), \ diff --git a/m-tuple.h b/m-tuple.h index 55edc1ae..5a0864bc 100644 --- a/m-tuple.h +++ b/m-tuple.h @@ -750,7 +750,7 @@ namespace m_lib { SET(M_F(name,_set)), \ CLEAR(M_F(name, _clear)), \ NAME(name), \ - TYPE(M_F(name,_ct)), \ + TYPE(M_F(name,_ct)), GENTYPE(struct M_F(name,_s)*), \ OPLIST( (__VA_ARGS__) ), \ M_IF_METHOD_ALL(CMP, __VA_ARGS__)(CMP(M_F(name, _cmp)),), \ M_IF_METHOD_ALL(HASH, __VA_ARGS__)(HASH(M_F(name, _hash)),), \ diff --git a/m-variant.h b/m-variant.h index 1644bc19..2aab7b28 100644 --- a/m-variant.h +++ b/m-variant.h @@ -774,7 +774,7 @@ M_INLINE void \ CLEAR(M_F(name, _clear)), \ RESET(M_F(name, _reset)), \ NAME(name), \ - TYPE(M_F(name,_ct)), \ + TYPE(M_F(name,_ct)), GENTYPE(struct M_F(name,_s)*), \ EMPTY_P(M_F(name,_empty_p)), \ M_IF_METHOD_ALL(HASH, __VA_ARGS__)(HASH(M_F(name, _hash)),), \ M_IF_METHOD_ALL(EQUAL, __VA_ARGS__)(EQUAL(M_F(name, _equal_p)),), \ diff --git a/tests/test-mgeneric.c b/tests/test-mgeneric.c index d4678891..eb4f23e2 100644 --- a/tests/test-mgeneric.c +++ b/tests/test-mgeneric.c @@ -53,8 +53,6 @@ const string_t gx; CLEAR(M_NOTHING_DEFAULT) ) #define INT1 (GENTYPE(int), TYPE(int), INIT(M_INIT_BASIC), INIT_SET(M_SET_BASIC), SET(M_SET_BASIC), \ CLEAR(M_NOTHING_DEFAULT) ) -#define ARRAY1 M_OPEXTEND(M_OPL_array_int_t(), GENTYPE(struct array_int_s *)) -#define LIST1 M_OPEXTEND(M_OPL_list_int_t(), GENTYPE(struct list_int_s **)) //NOTE: string_t is registered by the CORE component of the MLIB organization @@ -65,9 +63,9 @@ const string_t gx; #define M_GENERIC_ORG_3() (ARRAY) #define M_GENERIC_ORG_ARRAY_COMP_5() (AINT) -#define M_GENERIC_ORG_ARRAY_COMP_AINT_OPLIST_6() ARRAY1 +#define M_GENERIC_ORG_ARRAY_COMP_AINT_OPLIST_6() M_OPL_array_int_t() #define M_GENERIC_ORG_ARRAY_COMP_10() (LINT) -#define M_GENERIC_ORG_ARRAY_COMP_LINT_OPLIST_30() LIST1 +#define M_GENERIC_ORG_ARRAY_COMP_LINT_OPLIST_30() M_OPL_list_int_t() static bool test_empty(const string_t p) {