From e1abf0528ca74367a826f67ad9033b4774c1e3b0 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Fri, 8 Apr 2022 22:54:29 +0200 Subject: [PATCH] Rename M_DEFAULT_OPLIST in M_BASIC_OPLIST (cleaner name) --- README.md | 24 +++++++++---------- doc/API.txt | 1 + example/ex-algo03.c | 2 +- example/ex-array00.c | 14 +++++------ example/ex-bptree01.c | 4 ++-- example/ex-dict01.c | 2 +- example/ex-dict02.c | 4 ++-- example/ex-mph.c | 4 ++-- example/ex-multi02.c | 2 +- example/ex-multi03.c | 4 ++-- example/ex-multi04.c | 6 ++--- example/ex-string03.c | 2 +- example/ex11-algo02.c | 2 +- example/ex11-json01.c | 2 +- example/ex11-section.c | 2 +- example/ex11-tstc.c | 10 ++++---- m-array.h | 6 ++--- m-bptree.h | 4 ++-- m-buffer.h | 2 +- m-concurrent.h | 2 +- m-core.h | 34 +++++++++++++------------- m-deque.h | 2 +- m-dict.h | 8 +++---- m-funcobj.h | 2 +- m-i-list.h | 2 +- m-i-shared.h | 2 +- m-list.h | 2 +- m-prioqueue.h | 2 +- m-rbtree.h | 2 +- m-shared.h | 2 +- m-tuple.h | 4 ++-- m-variant.h | 4 ++-- tests/fail-chain-oplist.c | 34 +++++++++++++------------- tests/fail-incompatible.c | 50 +++++++++++++++++++-------------------- tests/fail-no-oplist.c | 38 ++++++++++++++--------------- tests/test-malgo.c | 24 +++++++++---------- tests/test-marray.c | 2 +- tests/test-mbptree.c | 14 +++++------ tests/test-mbuffer.c | 6 ++--- tests/test-mconcurrent.c | 10 ++++---- tests/test-mcore.c | 10 ++++---- tests/test-mdeque.c | 2 +- tests/test-mdict.c | 18 +++++++------- tests/test-mfuncobj.c | 4 ++-- tests/test-mlist.c | 4 ++-- tests/test-mprioqueue.c | 2 +- tests/test-mrbtree.c | 6 ++--- tests/test-mserial-bin.c | 12 +++++----- tests/test-mserial-json.c | 12 +++++----- tests/test-mshared.c | 2 +- tests/test-mtuple.c | 10 ++++---- tests/test-mvariant.c | 12 +++++----- tests/tgen-mdict.c | 4 ++-- 53 files changed, 222 insertions(+), 219 deletions(-) diff --git a/README.md b/README.md index b9d7e690..fa32cbc0 100644 --- a/README.md +++ b/README.md @@ -404,7 +404,7 @@ which reads from a text file a definition of sections: #include "m-string.h" TUPLE_DEF2(symbol, (offset, long), (value, long)) - #define M_OPL_symbol_t() TUPLE_OPLIST(symbol, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) + #define M_OPL_symbol_t() TUPLE_OPLIST(symbol, M_BASIC_OPLIST, M_BASIC_OPLIST) ARRAY_DEF(array_symbol, symbol_t) #define M_OPL_array_symbol_t() ARRAY_OPLIST(array_symbol, M_OPL_symbol_t()) @@ -517,7 +517,7 @@ INIT, INIT\_SET & SET methods shall only fail due to ***memory errors***. Not all operators are needed within an oplist to handle a container. If some operator is missing, the associated default operator of the function is used. To use C integer or float types, the default constructors are perfectly fine: -you may use M\_DEFAULT\_OPLIST to define the operator list of such types or you +you may use M\_BASIC\_OPLIST to define the operator list of such types or you can just omit it. NOTE: An iterator doesn't have a constructor nor destructor methods. @@ -682,8 +682,8 @@ An operator OP can be defined, omitted or disabled: My type is: -* a C Boolean: M\_BOOL\_OPLIST (M\_DEFAULT\_OPLIST also works partially), -* a C integer or a C float: M\_DEFAULT\_OPLIST (it can also be omitted), +* a C Boolean: M\_BOOL\_OPLIST (M\_BASIC\_OPLIST also works partially), +* a C integer or a C float: M\_BASIC\_OPLIST (it can also be omitted), * a C enumerate: M\_ENUM\_OPLIST, * a pointer to something (the contained do nothing on the pointed object): M\_PTR\_OPLIST, * a plain structure that can be init/copy/compare with memset/memcpy/memcmp: M\_POD\_OPLIST, @@ -695,7 +695,7 @@ My type is: * other things: you need to provide a custom OPLIST to your type. Note: The precise exported methods of the OPLIST depend of the version -of the used C language. Typically, in C11 mode, the M\_DEFAULT\_OPLIST +of the used C language. Typically, in C11 mode, the M\_BASIC\_OPLIST exports all needed methods to handle generic input/output of int/floats (using \_Generic) whereas it is not possible in C99 mode. @@ -773,7 +773,7 @@ The list of errors it can generate: * M\_LIB\_ERROR(ARGUMENT\_OF\_\*\_OPLIST\_IS\_NOT\_AN\_OPLIST, name, oplist): sub error of the previous error one, identifying the root cause. The error is in the oplist construction of the given macro. You need to give an oplist for this oplist construction. * M\_LIB\_MISSING\_METHOD: a required operator doesn't define any method in the given oplist. You need to complete the oplist with the missing method. * M\_LIB\_TYPE\_MISMATCH: the given oplist and the type do not match each other. You need to give the right oplist for this type. -* M\_LIB\_NOT\_A\_DEFAULT\_TYPE: The oplist M\_DEFAULT\_OPLIST (directly or indirectly) has been used with the given type, but the given type is not a default type. You need to give the right oplist for this type. +* M\_LIB\_NOT\_A\_BASIC\_TYPE: The oplist M\_BASIC\_OPLIST (directly or indirectly) has been used with the given type, but the given type is not a default type. You need to give the right oplist for this type. You should focus mainly on the first reported error/warning even if the link between what the compiler report and what the error is @@ -784,7 +784,7 @@ Examples of typical errors: * lack of inclusion of an header, * overriding locally operator names by macros (like NEW, DEL, INIT, OPLIST, ...), * lack of ( ) or double level of ( ) around the oplist, -* an unknown variable (example using DEFAULT\_OPLIST instead of M\_DEFAULT\_OPLIST or M\_STRING\_OPLIST instead of STRING\_OPLIST), +* an unknown variable (example using BASIC\_OPLIST instead of M\_BASIC\_OPLIST), * the name given to the oplist is not the same as the one used to define the methods, * use of a type instead of an oplist in the OPLIST definition, * a missing sub oplist in the OPLIST definition. @@ -2350,7 +2350,7 @@ Example: *k = (unsigned)(-n-1); } - DICT_OA_DEF2(dict_unsigned, unsigned, M_OPEXTEND(M_DEFAULT_OPLIST, OOR_EQUAL(oor_equal_p), OOR_SET(API_2(oor_set))), long long, M_DEFAULT_OPLIST) + DICT_OA_DEF2(dict_unsigned, unsigned, M_OPEXTEND(M_BASIC_OPLIST, OOR_EQUAL(oor_equal_p), OOR_SET(API_2(oor_set))), long long, M_BASIC_OPLIST) unsigned main(void) { dict_unsigned_t a; @@ -4947,7 +4947,7 @@ Example: /* Define a queue container (FIFO) */ DEQUE_DEF(deque_uint, unsigned int) - CONCURRENT_DEF(cdeque_uint, deque_uint_t, M_OPEXTEND(DEQUE_OPLIST(deque_uint, M_DEFAULT_OPLIST), PUSH(deque_uint_push_front))) + CONCURRENT_DEF(cdeque_uint, deque_uint_t, M_OPEXTEND(DEQUE_OPLIST(deque_uint, M_BASIC_OPLIST), PUSH(deque_uint_push_front))) extern parray1_t x1; extern cdeque_uint_t x2; @@ -6542,7 +6542,7 @@ Return the associated method to the given operator within the given oplist. Default oplist for C standard Boolean. -##### M\_DEFAULT\_OPLIST +##### M\_BASIC\_OPLIST Default oplist for C standard types (int & float) @@ -6637,7 +6637,7 @@ Global registered oplists are limited to typedef types. ##### M\_GLOBAL\_OPLIST\_OR\_DEF(a) If 'a' is a type that has registered a global oplist, it returns the registered oplist, -otherwise it return the default oplist M\_DEFAULT\_OPLIST. +otherwise it return the default oplist M\_BASIC\_OPLIST. The return value shall be evaluated once again to get the oplist (this is needed due to technical reasons) like this: @@ -8045,7 +8045,7 @@ Example: (value, int), (name, string_t) ) - #define M_OPL_my_t() TUPLE_OPLIST(my, M_DEFAULT_OPLIST, STRING_OPLIST ) + #define M_OPL_my_t() TUPLE_OPLIST(my, M_BASIC_OPLIST, STRING_OPLIST ) // Output in JSON file the structure my_t void output(my_t el1) diff --git a/doc/API.txt b/doc/API.txt index 26648bfd..12944552 100644 --- a/doc/API.txt +++ b/doc/API.txt @@ -73,3 +73,4 @@ V0.5.*: * M_INVERT is renamed into M_REVERSE to be more coherent with the REVERS * Rename CLEAN operator in RESET operator. * Rename GET_SET_KEY operator in SAFE_GET_KEY operator. +V0.6.*: * Rename M_DEFAULT_OPLIST in M_BASIC_OPLIST diff --git a/example/ex-algo03.c b/example/ex-algo03.c index 8a4e69e7..dd1e00ad 100644 --- a/example/ex-algo03.c +++ b/example/ex-algo03.c @@ -7,7 +7,7 @@ * from a string_t to int */ DICT_DEF2(dict, string_t, int) /* Register the oplist of this dictionnary globally */ -#define M_OPL_dict_t() DICT_OPLIST(dict, STRING_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_dict_t() DICT_OPLIST(dict, STRING_OPLIST, M_BASIC_OPLIST) /* Define an array of integer */ ARRAY_DEF(vector_int, int) diff --git a/example/ex-array00.c b/example/ex-array00.c index 296b7df2..609a9ec7 100644 --- a/example/ex-array00.c +++ b/example/ex-array00.c @@ -24,7 +24,7 @@ /* Generate prototypes and inline functions for basic types. For integer and floats, there is no need to specify - an oplist. M_DEFAULT_OPLIST will be used. + an oplist. M_BASIC_OPLIST will be used. */ ARRAY_DEF(r_bool, bool) @@ -105,7 +105,7 @@ test_int(int n) But with an explicit oplist. This generates exactly the same code than r_int */ -ARRAY_DEF(r_int2, signed int, M_DEFAULT_OPLIST) +ARRAY_DEF(r_int2, signed int, M_BASIC_OPLIST) static int test_int2(int n) @@ -180,7 +180,7 @@ test_float(int n) /* Same with type double and an explicit oplist*/ -ARRAY_DEF(r_double, double, M_DEFAULT_OPLIST) +ARRAY_DEF(r_double, double, M_BASIC_OPLIST) static int test_double(int n) @@ -478,7 +478,7 @@ test_rockme2b(int n) /* Same with a structure type defined as a tuple. We first define a tuple. No need to specify the oplist as it uses basic C types - so M_DEFAULT_OPLIST is used. + so M_BASIC_OPLIST is used. Then we define the array, giving it the oplist definition of the tuple: the macro TUPLE_OPLIST is used to build it based on the tuple name, @@ -486,7 +486,7 @@ test_rockme2b(int n) */ TUPLE_DEF2(rock_you, (n, int), (other, float)) -ARRAY_DEF(r_rockme3, rock_you_t, TUPLE_OPLIST(rock_you, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST)) +ARRAY_DEF(r_rockme3, rock_you_t, TUPLE_OPLIST(rock_you, M_BASIC_OPLIST, M_BASIC_OPLIST)) static int test_rockme3(int n) @@ -520,7 +520,7 @@ test_rockme3(int n) /* Same with a structure type defined as a tuple using global registeration. We first define a tuple. No need to specify the oplist as it uses basic C types - so M_DEFAULT_OPLIST is used. + so M_BASIC_OPLIST is used. Then we register the oplist of rock_us_t by defining a macro based on M_OPL_ + type name + () which expands with the oplist of the type. @@ -533,7 +533,7 @@ test_rockme3(int n) */ TUPLE_DEF2(rock_us, (n, int), (other, float)) -#define M_OPL_rock_us_t() TUPLE_OPLIST(rock_us, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_rock_us_t() TUPLE_OPLIST(rock_us, M_BASIC_OPLIST, M_BASIC_OPLIST) ARRAY_DEF(r_rockme4, rock_us_t) diff --git a/example/ex-bptree01.c b/example/ex-bptree01.c index d80406d5..f0c64d04 100644 --- a/example/ex-bptree01.c +++ b/example/ex-bptree01.c @@ -5,13 +5,13 @@ // The number 5 is the number of elements in a node of the B+TREE BPTREE_DEF2(map_employee_id, 5, int, string_t) // Register the oplist of this map globally. -#define M_OPL_map_employee_id_t() BPTREE_OPLIST2(map_employee_id, M_DEFAULT_OPLIST, STRING_OPLIST) +#define M_OPL_map_employee_id_t() BPTREE_OPLIST2(map_employee_id, M_BASIC_OPLIST, STRING_OPLIST) // Define a map string -> int named map_employee_name // The number 5 is the number of elements in a node of the B+TREE BPTREE_DEF2(map_employee_name, 5, string_t, int) // Register the oplist of this map globally. -#define M_OPL_map_employee_name_t() BPTREE_OPLIST2(map_employee_name, STRING_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_map_employee_name_t() BPTREE_OPLIST2(map_employee_name, STRING_OPLIST, M_BASIC_OPLIST) int main(void) { diff --git a/example/ex-dict01.c b/example/ex-dict01.c index c7506924..50c06599 100644 --- a/example/ex-dict01.c +++ b/example/ex-dict01.c @@ -6,7 +6,7 @@ // Define a dictionnary of string --> int // named 'dict_str' -DICT_DEF2(dict_str, string_t, STRING_OPLIST, int, M_DEFAULT_OPLIST) +DICT_DEF2(dict_str, string_t, STRING_OPLIST, int, M_BASIC_OPLIST) int main(void) { diff --git a/example/ex-dict02.c b/example/ex-dict02.c index 63639d11..c2cd9da1 100644 --- a/example/ex-dict02.c +++ b/example/ex-dict02.c @@ -1,10 +1,10 @@ #include "m-dict.h" // Let's define a dictionary of 'unsigned int' --> 'char -DICT_DEF2(dict_m32, unsigned int, M_DEFAULT_OPLIST, char, M_DEFAULT_OPLIST) +DICT_DEF2(dict_m32, unsigned int, M_BASIC_OPLIST, char, M_BASIC_OPLIST) // Let's create a synonym for its oplist. -#define M32_OPLIST DICT_OPLIST(dict_m32, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) +#define M32_OPLIST DICT_OPLIST(dict_m32, M_BASIC_OPLIST, M_BASIC_OPLIST) #if 1 // Non macro version. diff --git a/example/ex-mph.c b/example/ex-mph.c index bd181baf..ec4c6964 100644 --- a/example/ex-mph.c +++ b/example/ex-mph.c @@ -25,8 +25,8 @@ /* Define the needed data structure : */ // Define a dictionnary of constant string --> integer and register it. -DICT_DEF2(dict_mph, const char *, M_CSTR_OPLIST, uint32_t, M_DEFAULT_OPLIST) -#define M_OPL_dict_mph_t() DICT_OPLIST(dict_mph, M_CSTR_OPLIST, M_DEFAULT_OPLIST) +DICT_DEF2(dict_mph, const char *, M_CSTR_OPLIST, uint32_t, M_BASIC_OPLIST) +#define M_OPL_dict_mph_t() DICT_OPLIST(dict_mph, M_CSTR_OPLIST, M_BASIC_OPLIST) // Define an array of integer to store the value and register it. ARRAY_DEF(array_value, uint32_t) // Start from 1. 0 is 'None' diff --git a/example/ex-multi02.c b/example/ex-multi02.c index 765a1d9d..680c02ec 100644 --- a/example/ex-multi02.c +++ b/example/ex-multi02.c @@ -48,7 +48,7 @@ VARIANT_DEF2(my_integer, (n, long long), (z, mpz_t)) /* Define the oplist associated to this variant and register it */ -#define M_OPL_my_integer_t() VARIANT_OPLIST(my_integer, M_DEFAULT_OPLIST, M_OPL_mpz_t() ) +#define M_OPL_my_integer_t() VARIANT_OPLIST(my_integer, M_BASIC_OPLIST, M_OPL_mpz_t() ) /* Define a dictionary of string --> integer named dict_my_t */ DICT_DEF2(my_dict, string_t, my_integer_t) diff --git a/example/ex-multi03.c b/example/ex-multi03.c index 67c514f9..f2a34dcd 100644 --- a/example/ex-multi03.c +++ b/example/ex-multi03.c @@ -84,8 +84,8 @@ DICT_DEF2(dict_json, string_t, STRING_OPLIST, json_t, JSON_OPLIST) ARRAY_DEF(array_json, json_t, JSON_OPLIST) VARIANT_DEF2(variant_json, - (boolean, bool, M_OPEXTEND(M_DEFAULT_OPLIST, OUT_STR(boolean_out_str), IN_STR(boolean_in_str M_IPTR)) ), - (real, float, M_OPEXTEND (M_DEFAULT_OPLIST, OUT_STR(real_out_str), IN_STR(real_in_str M_IPTR))), + (boolean, bool, M_OPEXTEND(M_BASIC_OPLIST, OUT_STR(boolean_out_str), IN_STR(boolean_in_str M_IPTR)) ), + (real, float, M_OPEXTEND (M_BASIC_OPLIST, OUT_STR(real_out_str), IN_STR(real_in_str M_IPTR))), (array, array_json_t, ARRAY_OPLIST(array_json, JSON_OPLIST)), (dict, dict_json_t, DICT_OPLIST(dict_json, STRING_OPLIST, JSON_OPLIST))) diff --git a/example/ex-multi04.c b/example/ex-multi04.c index c81ef2c2..6a807738 100644 --- a/example/ex-multi04.c +++ b/example/ex-multi04.c @@ -10,7 +10,7 @@ order to show/test the good chaining of the structures */ TUPLE_DEF2(symbol, (type, int), (name, string_t)) -#define M_OPL_symbol_t() TUPLE_OPLIST(symbol, M_DEFAULT_OPLIST, STRING_OPLIST) +#define M_OPL_symbol_t() TUPLE_OPLIST(symbol, M_BASIC_OPLIST, STRING_OPLIST) ARRAY_DEF(symbol_list, symbol_t) #define M_OPL_symbol_list_t() ARRAY_OPLIST(symbol_list, M_OPL_symbol_t()) @@ -37,11 +37,11 @@ BUFFER_DEF(trbuff, my_triple_tuple_t, 100, BUFFER_QUEUE) #define M_OPL_trbuff_t() BUFFER_OPLIST(trbuff, M_OPL_my_triple_tuple_t()) TUPLE_DEF2(my_junction, (active, bool), (buffer, trbuff_t)) -#define M_OPL_my_junction_t() TUPLE_OPLIST(my_junction, M_DEFAULT_OPLIST, M_OPL_trbuff_t()) +#define M_OPL_my_junction_t() TUPLE_OPLIST(my_junction, M_BASIC_OPLIST, M_OPL_trbuff_t()) TUPLE_DEF2(mlib_point, (x, int), (y, int)) #define M_OPL_mlib_point_t() \ - TUPLE_OPLIST(mlib_point, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) + TUPLE_OPLIST(mlib_point, M_BASIC_OPLIST, M_BASIC_OPLIST) TUPLE_DEF2(mlib_points, (first_ref, mlib_point_ptr, M_PTR_OPLIST), (second_ref, mlib_point_ptr, M_PTR_OPLIST), diff --git a/example/ex-string03.c b/example/ex-string03.c index a72cf286..b3410720 100644 --- a/example/ex-string03.c +++ b/example/ex-string03.c @@ -5,7 +5,7 @@ /* Definition of an associative map string_t --> size_t */ DICT_DEF2(dict_str, string_t, size_t) -#define M_OPL_dict_str_t() DICT_OPLIST(dict_str, STRING_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_dict_str_t() DICT_OPLIST(dict_str, STRING_OPLIST, M_BASIC_OPLIST) /* Definition of an array of string_t */ ARRAY_DEF(vector_str, string_t) diff --git a/example/ex11-algo02.c b/example/ex11-algo02.c index 95861f56..4502a2d5 100644 --- a/example/ex11-algo02.c +++ b/example/ex11-algo02.c @@ -11,7 +11,7 @@ TUPLE_DEF2(employee, (age, int), (idnum, int)) /* Register globaly the employee_t oplist */ -#define M_OPL_employee_t() TUPLE_OPLIST(employee, STRING_OPLIST, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_employee_t() TUPLE_OPLIST(employee, STRING_OPLIST, M_BASIC_OPLIST, M_BASIC_OPLIST) /* Define an array of employee, register the oplist and define further algorithms on it */ ARRAY_DEF(vector_employee, employee_t) diff --git a/example/ex11-json01.c b/example/ex11-json01.c index 4cd595a9..e2044cc7 100644 --- a/example/ex11-json01.c +++ b/example/ex11-json01.c @@ -9,7 +9,7 @@ TUPLE_DEF2(person, (present, bool) ) // Register the oplist of this tuple globaly -#define M_OPL_person_t() TUPLE_OPLIST(person, M_DEFAULT_OPLIST, STRING_OPLIST, M_DEFAULT_OPLIST ) +#define M_OPL_person_t() TUPLE_OPLIST(person, M_BASIC_OPLIST, STRING_OPLIST, M_BASIC_OPLIST ) // Let's define an array of person ARRAY_DEF(base, person_t) diff --git a/example/ex11-section.c b/example/ex11-section.c index f5d072f5..ea8ff140 100644 --- a/example/ex11-section.c +++ b/example/ex11-section.c @@ -7,7 +7,7 @@ // Let's define a tuple composed of (offset, value) and register it TUPLE_DEF2(symbol, (offset, long), (value, long)) -#define M_OPL_symbol_t() TUPLE_OPLIST(symbol, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_symbol_t() TUPLE_OPLIST(symbol, M_BASIC_OPLIST, M_BASIC_OPLIST) // Let's define an array of such tuple and register it ARRAY_DEF(array_symbol, symbol_t) diff --git a/example/ex11-tstc.c b/example/ex11-tstc.c index 2c117795..5831b396 100644 --- a/example/ex11-tstc.c +++ b/example/ex11-tstc.c @@ -12,14 +12,14 @@ // Define a basic structure (POD structure) using a tuple to get the default functions TUPLE_DEF2(Point, (x, float), (y, float)) -#define M_OPL_Point_t() TUPLE_OPLIST(Point, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_Point_t() TUPLE_OPLIST(Point, M_BASIC_OPLIST, M_BASIC_OPLIST) // NOTE: array, list, deque don't have a native find function. // We'll use the algorithm header to create a find function for such containers. // Define a set of int & register its oplist DICT_SET_DEF(cset_i, int) -#define M_OPL_cset_i_t() DICT_SET_OPLIST(cset_i, M_DEFAULT_OPLIST) +#define M_OPL_cset_i_t() DICT_SET_OPLIST(cset_i, M_BASIC_OPLIST) // Define an array of Point, register its oplist & include some basic algorithms ARRAY_DEF(cvec_p, Point_t) @@ -28,17 +28,17 @@ ALGO_DEF(cvec_p, cvec_p_t) // Define a deque of int, including some basic algorithms DEQUE_DEF(cdeq_i, int) -#define M_OPL_cdeq_i_t() DEQUE_OPLIST(cdeq_i, M_DEFAULT_OPLIST) +#define M_OPL_cdeq_i_t() DEQUE_OPLIST(cdeq_i, M_BASIC_OPLIST) ALGO_DEF(cdeq_i, cdeq_i_t) // Define a backward list, including some basic algorithms LIST_DEF(clist_i, int) -#define M_OPL_clist_i_t() LIST_OPLIST(clist_i, M_DEFAULT_OPLIST) +#define M_OPL_clist_i_t() LIST_OPLIST(clist_i, M_BASIC_OPLIST) ALGO_DEF(clist_i, clist_i_t) // Define an unordered map of int to int DICT_DEF2(csmap_i, int, int) -#define M_OPL_csmap_i_t() DICT_OPLIST(csmap_i, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_csmap_i_t() DICT_OPLIST(csmap_i, M_BASIC_OPLIST, M_BASIC_OPLIST) int main(void) { diff --git a/m-array.h b/m-array.h index d4e9241f..19d8f7da 100644 --- a/m-array.h +++ b/m-array.h @@ -45,11 +45,11 @@ /* Define the oplist of a dynamic array given its name and its oplist. - If no oplist is given it is assumed to be M_DEFAULT_OPLIST + If no oplist is given it is assumed to be M_BASIC_OPLIST USAGE: ARRAY_OPLIST(name[, oplist of the type]) */ #define M_ARRAY_OPLIST(...) \ M_ARRA4_OPLIST_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ - ((__VA_ARGS__, M_DEFAULT_OPLIST), \ + ((__VA_ARGS__, M_BASIC_OPLIST), \ (__VA_ARGS__ ))) @@ -109,7 +109,7 @@ ,RESET(M_C(name,_reset)) \ ,KEY_TYPE(size_t) \ ,VALUE_TYPE(M_C(name, _subtype_ct)) \ - ,KEY_OPLIST(M_DEFAULT_OPLIST) \ + ,KEY_OPLIST(M_BASIC_OPLIST) \ ,VALUE_OPLIST(oplist) \ ,M_IF_METHOD(SET, oplist)(SET_KEY(M_C(name, _set_at)) ,) \ ,GET_KEY(M_C(name, _get)) \ diff --git a/m-bptree.h b/m-bptree.h index 93c44a72..4d7e63c5 100644 --- a/m-bptree.h +++ b/m-bptree.h @@ -123,7 +123,7 @@ USAGE: BPTREE_OPLIST(name [, oplist_of_the_type]) */ #define M_BPTREE_OPLIST(...) \ M_BPTR33_KEY_OPLIST_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ - ((__VA_ARGS__, M_DEFAULT_OPLIST ), \ + ((__VA_ARGS__, M_BASIC_OPLIST ), \ (__VA_ARGS__ ))) @@ -134,7 +134,7 @@ */ #define M_BPTREE_OPLIST2(...) \ M_BPTR33_OPLIST2_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ - ((__VA_ARGS__, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST ), \ + ((__VA_ARGS__, M_BASIC_OPLIST, M_BASIC_OPLIST ), \ (__VA_ARGS__ ))) diff --git a/m-buffer.h b/m-buffer.h index 03e11b57..799f9fc9 100644 --- a/m-buffer.h +++ b/m-buffer.h @@ -74,7 +74,7 @@ typedef enum { USAGE: BUFFER_OPLIST(name[, oplist of the type]) */ #define M_BUFFER_OPLIST(...) \ M_BUFF3R_OPLIST_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ - ((__VA_ARGS__, M_DEFAULT_OPLIST), \ + ((__VA_ARGS__, M_BASIC_OPLIST), \ (__VA_ARGS__ ))) diff --git a/m-concurrent.h b/m-concurrent.h index 3e609a26..1bd5f807 100644 --- a/m-concurrent.h +++ b/m-concurrent.h @@ -72,7 +72,7 @@ USAGE: CONCURRENT_OPLIST(name[, oplist of the type]) */ #define M_CONCURRENT_OPLIST(...) \ M_C0NCURRENT_OPLIST_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ - ((__VA_ARGS__, M_DEFAULT_OPLIST), \ + ((__VA_ARGS__, M_BASIC_OPLIST), \ (__VA_ARGS__ ))) diff --git a/m-core.h b/m-core.h index 29b048b5..e889eba1 100644 --- a/m-core.h +++ b/m-core.h @@ -3118,7 +3118,7 @@ static inline size_t m_core_cstr_hash(const char str[]) float: 1, double:1, long double: 1, \ char *:1, void*:1, \ default: 0), \ - M_LIB_NOT_A_DEFAULT_TYPE, \ + M_LIB_NOT_A_BASIC_TYPE, \ "The variable " M_AS_STR(a) " is not a basic C type (int/float), " \ "but the given methods use it like this. " \ "It is likely the given oplist is not right.") @@ -3127,7 +3127,7 @@ static inline size_t m_core_cstr_hash(const char str[]) M_STATIC_ASSERT(sizeof (a) <= M_MAX(sizeof(long long), \ M_MAX(sizeof (long double), \ sizeof (uintmax_t))), \ - M_LIB_NOT_A_DEFAULT_TYPE, \ + M_LIB_NOT_A_BASIC_TYPE, \ "The variable " M_AS_STR(a) " is too big to be a basic C type (int/float), " \ "but the given methods use it like this. " \ "It is likely the given oplist is not right.") @@ -3291,7 +3291,7 @@ static inline size_t m_core_cstr_hash(const char str[]) # if M_USE_STDIO /* C11 + FILE support */ -# define M_DEFAULT_OPLIST \ +# define M_BASIC_OPLIST \ (INIT(M_INIT_BASIC), INIT_SET(M_SET_BASIC), SET(M_SET_BASIC), \ CLEAR(M_NOTHING_DEFAULT), EQUAL(M_EQUAL_BASIC), CMP(M_CMP_BASIC), \ INIT_MOVE(M_MOVE_DEFAULT), MOVE(M_MOVE_DEFAULT) , \ @@ -3304,7 +3304,7 @@ static inline size_t m_core_cstr_hash(const char str[]) PARSE_STR(M_PARSE_DEFAULT_TYPE M_IPTR), M_GET_STR_METHOD_FOR_DEFAULT_TYPE) # else /* C11 + No FILE support */ -# define M_DEFAULT_OPLIST \ +# define M_BASIC_OPLIST \ (INIT(M_INIT_BASIC), INIT_SET(M_SET_BASIC), SET(M_SET_BASIC), \ CLEAR(M_NOTHING_DEFAULT), EQUAL(M_EQUAL_BASIC), CMP(M_CMP_BASIC), \ INIT_MOVE(M_MOVE_DEFAULT), MOVE(M_MOVE_DEFAULT) , \ @@ -3317,7 +3317,7 @@ static inline size_t m_core_cstr_hash(const char str[]) # endif #else /* C99 */ -# define M_DEFAULT_OPLIST \ +# define M_BASIC_OPLIST \ (INIT(M_INIT_BASIC), INIT_SET(M_SET_BASIC), SET(M_SET_BASIC), \ CLEAR(M_NOTHING_DEFAULT), EQUAL(M_EQUAL_BASIC), CMP(M_CMP_BASIC), \ INIT_MOVE(M_MOVE_DEFAULT), MOVE(M_MOVE_DEFAULT) , \ @@ -3327,18 +3327,20 @@ static inline size_t m_core_cstr_hash(const char str[]) HASH(M_HASH_DEFAULT), SWAP(M_SWAP_DEFAULT) ) #endif +/* Obsolete name */ +#define M_DEFAULT_OPLIST M_BASIC_OPLIST /* Specialized oplist for a boolean. - * M_DEFAULT_OPLIST is nearly ok, except for ADD/SUB/MUL/DIV + * M_BASIC_OPLIST is nearly ok, except for ADD/SUB/MUL/DIV * that generates warnings with boolean. */ #define M_BOOL_OPLIST \ - M_OPEXTEND(M_DEFAULT_OPLIST, ADD(M_OR_DEFAULT), MUL(M_AND_DEFAULT), \ + M_OPEXTEND(M_BASIC_OPLIST, ADD(M_OR_DEFAULT), MUL(M_AND_DEFAULT), \ SUB(0), DIV(0)) /* Specialized oplist for an enumerate. - * M_DEFAULT_OPLIST is nearly ok, except if build in C++ mode. + * M_BASIC_OPLIST is nearly ok, except if build in C++ mode. * Also I/O are specialized and arithmetics are removed * OPLIST doesn't store an oplist but an additional parameter * (the initial value) @@ -3581,7 +3583,7 @@ m_core_parse2_enum (const char str[], const char **endptr) #define M_GLOBALI_TYPE_GET(a) M_GET_TYPE a /* If a symbol composed of M_OPL_##a() exists and is defined as an oplist, - it returns it otherwise it returns M_DEFAULT_OPLIST. + it returns it otherwise it returns M_BASIC_OPLIST. Global oplist is limited to typedef types. NOTE1: It first tests if the type doesn't start with a parenthesis, in which case concatenation cannot be used. @@ -3592,18 +3594,18 @@ m_core_parse2_enum (const char str[], const char **endptr) #define M_GLOBAL_OPLIST_OR_DEF(a) \ M_IF( M_PARENTHESIS_P(a))(M_GLOBALI_OPLIST_DEFAULT1, M_GLOBALI_OPLIST_OR_DEF_ELSE)(a) #define M_GLOBALI_OPLIST_DEFAULT1(a) M_GLOBALI_OPLIST_DEFAULT2 -#define M_GLOBALI_OPLIST_DEFAULT2() M_DEFAULT_OPLIST +#define M_GLOBALI_OPLIST_DEFAULT2() M_BASIC_OPLIST #define M_GLOBALI_OPLIST_OR_DEF_ELSE(a) M_GLOBALI_OPLIST_OR_DEF_ELSE2(a, M_C(M_OPL_, a)()) #define M_GLOBALI_OPLIST_OR_DEF_ELSE2(a, op) M_IF( M_PARENTHESIS_P(op))(M_C(M_OPL_, a), M_GLOBALI_OPLIST_DEFAULT2) /* Register simple classic C types (no qualifier) */ -#define M_OPL_char() M_DEFAULT_OPLIST -#define M_OPL_short() M_DEFAULT_OPLIST -#define M_OPL_int() M_DEFAULT_OPLIST -#define M_OPL_long() M_DEFAULT_OPLIST -#define M_OPL_float() M_DEFAULT_OPLIST -#define M_OPL_double() M_DEFAULT_OPLIST +#define M_OPL_char() M_BASIC_OPLIST +#define M_OPL_short() M_BASIC_OPLIST +#define M_OPL_int() M_BASIC_OPLIST +#define M_OPL_long() M_BASIC_OPLIST +#define M_OPL_float() M_BASIC_OPLIST +#define M_OPL_double() M_BASIC_OPLIST /* Add as suffix for the given function the number of arguments of the calls. Can be used to call different function in function of the number of arguments. */ diff --git a/m-deque.h b/m-deque.h index dece5200..2ad5c911 100644 --- a/m-deque.h +++ b/m-deque.h @@ -48,7 +48,7 @@ USAGE: DEQUE_OPLIST(name[, oplist of the type]) */ #define M_DEQUE_OPLIST(...) \ M_D3QU3_OPLIST_P1 (M_IF_NARGS_EQ1(__VA_ARGS__) \ - ((__VA_ARGS__, M_DEFAULT_OPLIST), \ + ((__VA_ARGS__, M_BASIC_OPLIST), \ (__VA_ARGS__ ))) /* Default initial size of a bucket of items */ diff --git a/m-dict.h b/m-dict.h index 416f06e6..df898cdc 100644 --- a/m-dict.h +++ b/m-dict.h @@ -165,7 +165,7 @@ */ #define M_DICT_OPLIST(...) \ M_IF_NARGS_EQ1(__VA_ARGS__) \ - (M_D1CT_OPLIST_P1((__VA_ARGS__, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST )), \ + (M_D1CT_OPLIST_P1((__VA_ARGS__, M_BASIC_OPLIST, M_BASIC_OPLIST )), \ M_D1CT_OPLIST_P1((__VA_ARGS__ ))) @@ -173,7 +173,7 @@ USAGE: DICT_SET_OPLIST(name[, oplist of the key type]) */ #define M_DICT_SET_OPLIST(...) \ M_IF_NARGS_EQ1(__VA_ARGS__) \ - (M_D1CT_SET_OPLIST_P1((__VA_ARGS__, M_DEFAULT_OPLIST)), \ + (M_D1CT_SET_OPLIST_P1((__VA_ARGS__, M_BASIC_OPLIST)), \ M_D1CT_SET_OPLIST_P1((__VA_ARGS__ ))) @@ -237,10 +237,10 @@ M_CHECK_COMPATIBLE_OPLIST(name, 1, key_type, key_oplist) \ M_CHECK_COMPATIBLE_OPLIST(name, 2, value_type, value_oplist) \ \ - TUPLE_DEF2(M_C(name, _pair), (hash, size_t, M_DEFAULT_OPLIST), (key, key_type, key_oplist), (value, value_type, value_oplist)) \ + TUPLE_DEF2(M_C(name, _pair), (hash, size_t, M_BASIC_OPLIST), (key, key_type, key_oplist), (value, value_type, value_oplist)) \ \ M_D1CT_FUNC_DEF2_P5(name, key_type, key_oplist, value_type, value_oplist, \ - M_C(name, _pair_ct), TUPLE_OPLIST(M_C(name, _pair), M_DEFAULT_OPLIST, key_oplist, value_oplist), 0, 1, \ + M_C(name, _pair_ct), TUPLE_OPLIST(M_C(name, _pair), M_BASIC_OPLIST, key_oplist, value_oplist), 0, 1, \ dict_t, dict_it_t, it_deref_t ) diff --git a/m-funcobj.h b/m-funcobj.h index 9c803e55..47ee4dc7 100644 --- a/m-funcobj.h +++ b/m-funcobj.h @@ -266,7 +266,7 @@ M_MAP_C(M_FUNC0BJ_INJECT_OPLIST_A, __VA_ARGS__) /* Transform (x, type) into (x, type, oplist) if there is global registered oplist - or (x, type, M_DEFAULT_OPLIST) if there is no global one, + or (x, type, M_BASIC_OPLIST) if there is no global one, or keep (x, type, oplist) if oplist was already present */ #define M_FUNC0BJ_INJECT_OPLIST_A( duo_or_trio ) \ M_FUNC0BJ_INJECT_OPLIST_B duo_or_trio diff --git a/m-i-list.h b/m-i-list.h index 2289fd29..dc69645f 100644 --- a/m-i-list.h +++ b/m-i-list.h @@ -68,7 +68,7 @@ ILIST_OPLIST(name [, oplist_of_the_type]) */ #define M_ILIST_OPLIST(...) \ M_IL1ST_OPLIST_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ - ((__VA_ARGS__, M_DEFAULT_OPLIST), \ + ((__VA_ARGS__, M_BASIC_OPLIST), \ (__VA_ARGS__ ))) diff --git a/m-i-shared.h b/m-i-shared.h index e722d200..53a17a65 100644 --- a/m-i-shared.h +++ b/m-i-shared.h @@ -34,7 +34,7 @@ M_BEGIN_PROTECTED_CODE USAGE: ISHARED_OPLIST(name [, oplist_of_the_type]) */ #define M_ISHARED_PTR_OPLIST(...) \ M_ISHAR3D_PTR_OPLIST_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ - ((__VA_ARGS__, M_DEFAULT_OPLIST), \ + ((__VA_ARGS__, M_BASIC_OPLIST), \ (__VA_ARGS__ ))) diff --git a/m-list.h b/m-list.h index 2d441768..6d5b20e1 100644 --- a/m-list.h +++ b/m-list.h @@ -65,7 +65,7 @@ USAGE: LIST_OPLIST(name [, oplist_of_the_type]) */ #define M_LIST_OPLIST(...) \ M_L1ST_OPLIST_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ - ((__VA_ARGS__, M_DEFAULT_OPLIST ), \ + ((__VA_ARGS__, M_BASIC_OPLIST ), \ (__VA_ARGS__ ))) /* Define an init value to init global variables of type list. diff --git a/m-prioqueue.h b/m-prioqueue.h index e1042dcb..58ed3cfb 100644 --- a/m-prioqueue.h +++ b/m-prioqueue.h @@ -51,7 +51,7 @@ USAGE: PRIOQUEUE_OPLIST(name[, oplist of the type]) */ #define M_PRIOQUEUE_OPLIST(...) \ M_PR1OQUEUE_OPLIST_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ - ((__VA_ARGS__, M_DEFAULT_OPLIST), \ + ((__VA_ARGS__, M_BASIC_OPLIST), \ (__VA_ARGS__ ))) diff --git a/m-rbtree.h b/m-rbtree.h index 8d8711c1..e15d3051 100644 --- a/m-rbtree.h +++ b/m-rbtree.h @@ -48,7 +48,7 @@ USAGE: RBTREE_OPLIST(name [, oplist_of_the_type]) */ #define M_RBTREE_OPLIST(...) \ M_RBTR33_OPLIST_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ - ((__VA_ARGS__, M_DEFAULT_OPLIST), \ + ((__VA_ARGS__, M_BASIC_OPLIST), \ (__VA_ARGS__ ))) diff --git a/m-shared.h b/m-shared.h index c0b2e087..07f27732 100644 --- a/m-shared.h +++ b/m-shared.h @@ -35,7 +35,7 @@ M_BEGIN_PROTECTED_CODE USAGE: SHARED_OPLIST(name [, oplist_of_the_type]) */ #define M_SHARED_PTR_OPLIST(...) \ M_SHAR3D_PTR_OPLIST_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ - ((__VA_ARGS__, M_DEFAULT_OPLIST ), \ + ((__VA_ARGS__, M_BASIC_OPLIST ), \ (__VA_ARGS__ ))) diff --git a/m-tuple.h b/m-tuple.h index d6273ac0..f1f8f35e 100644 --- a/m-tuple.h +++ b/m-tuple.h @@ -50,7 +50,7 @@ USAGE: TUPLE_OPLIST(name[, oplist of the first type, ...]) */ #define M_TUPLE_OPLIST(...) \ M_IF_NARGS_EQ1(__VA_ARGS__) \ - (M_TUPL3_OPLIST_P1((__VA_ARGS__, M_DEFAULT_OPLIST )), \ + (M_TUPL3_OPLIST_P1((__VA_ARGS__, M_BASIC_OPLIST )), \ M_TUPL3_OPLIST_P1((__VA_ARGS__ ))) @@ -93,7 +93,7 @@ namespace m_lib { M_MAP(M_TUPL3_INJECT_OPLIST_A, __VA_ARGS__) /* Transform (x, type) into (x, type, oplist) if there is global registered oplist - or (x, type, M_DEFAULT_OPLIST) if there is no global one, + or (x, type, M_BASIC_OPLIST) if there is no global one, or keep (x, type, oplist) if oplist was already present */ #define M_TUPL3_INJECT_OPLIST_A( duo_or_trio ) \ M_TUPL3_INJECT_OPLIST_B duo_or_trio diff --git a/m-variant.h b/m-variant.h index 029e793a..4d930d51 100644 --- a/m-variant.h +++ b/m-variant.h @@ -51,7 +51,7 @@ USAGE: VARIANT_OPLIST(name[, oplist of the first type, ...]) */ #define M_VARIANT_OPLIST(...) \ M_IF_NARGS_EQ1(__VA_ARGS__) \ - (M_VAR1ANT_OPLIST_P1((__VA_ARGS__, M_DEFAULT_OPLIST)), \ + (M_VAR1ANT_OPLIST_P1((__VA_ARGS__, M_BASIC_OPLIST)), \ M_VAR1ANT_OPLIST_P1((__VA_ARGS__ ))) @@ -69,7 +69,7 @@ M_MAP(M_VAR1ANT_INJECT_OPLIST_A, __VA_ARGS__) /* Transform (x, type) into (x, type, oplist) if there is global registered oplist - or (x, type, M_DEFAULT_OPLIST) if there is no global one, + or (x, type, M_BASIC_OPLIST) if there is no global one, or keep (x, type, oplist) if oplist was already present */ #define M_VAR1ANT_INJECT_OPLIST_A( duo_or_trio ) \ M_VAR1ANT_INJECT_OPLIST_B duo_or_trio diff --git a/tests/fail-chain-oplist.c b/tests/fail-chain-oplist.c index 4d7c8849..463ba8d7 100644 --- a/tests/fail-chain-oplist.c +++ b/tests/fail-chain-oplist.c @@ -64,14 +64,14 @@ BPTREE_DEF(bptree2, 5, bptree_t, BPTREE_OPLIST(bptree, DEFAULT_OPLIST)) #include "m-bptree.h" BPTREE_DEF2(bptree, 4, int, int) -BPTREE_DEF2(bptree2, 5, bptree_t, BPTREE_OPLIST2(bptree, DEFAULT_OPLIST, M_DEFAULT_OPLIST), int, M_DEFAULT_OPLIST) +BPTREE_DEF2(bptree2, 5, bptree_t, BPTREE_OPLIST2(bptree, DEFAULT_OPLIST, M_BASIC_OPLIST), int, M_BASIC_OPLIST) #elif TEST == 6 #include "m-bptree.h" BPTREE_DEF2(bptree, 4, int, int) -BPTREE_DEF2(bptree2, 5, bptree_t, BPTREE_OPLIST2(bptree, M_DEFAULT_OPLIST, DEFAULT_OPLIST), int, M_DEFAULT_OPLIST) +BPTREE_DEF2(bptree2, 5, bptree_t, BPTREE_OPLIST2(bptree, M_BASIC_OPLIST, DEFAULT_OPLIST), int, M_BASIC_OPLIST) #elif TEST == 7 @@ -86,7 +86,7 @@ BUFFER_DEF(buffer2, buffer_t, 5, BUFFER_QUEUE, BUFFER_OPLIST(buffer, DEFAULT_OPL #include "m-concurrent.h" ARRAY_DEF(array, int) -CONCURRENT_DEF(array2, array_t, ARRAY_OPLIST(array, M_DEFAULT_OPLIST)) +CONCURRENT_DEF(array2, array_t, ARRAY_OPLIST(array, M_BASIC_OPLIST)) ARRAY_DEF(array3, array2_t, CONCURRENT_OPLIST(array2, ARRAY_OPLIST(array, DEFAULT_OPLIST))) #elif TEST == 9 @@ -94,14 +94,14 @@ ARRAY_DEF(array3, array2_t, CONCURRENT_OPLIST(array2, ARRAY_OPLIST(array, DEFAUL #include "m-dict.h" DICT_DEF2(dict, int, int) -DICT_DEF2(dict2, int, M_DEFAULT_OPLIST, dict_t, DICT_OPLIST(dict, DEFAULT_OPLIST, M_DEFAULT_OPLIST) ) +DICT_DEF2(dict2, int, M_BASIC_OPLIST, dict_t, DICT_OPLIST(dict, DEFAULT_OPLIST, M_BASIC_OPLIST) ) #elif TEST == 10 #include "m-dict.h" DICT_DEF2(dict, int, int) -DICT_DEF2(dict2, int, M_DEFAULT_OPLIST, dict_t, DICT_OPLIST(dict, M_DEFAULT_OPLIST, DEFAULT_OPLIST) ) +DICT_DEF2(dict2, int, M_BASIC_OPLIST, dict_t, DICT_OPLIST(dict, M_BASIC_OPLIST, DEFAULT_OPLIST) ) #elif TEST == 11 @@ -140,64 +140,64 @@ CONCURRENT_DEF(array, tmpstr_t, ISHARED_PTR_OPLIST(tmpstr, X())) #include "m-prioqueue.h" PRIOQUEUE_DEF(prioqueue, int) -PRIOQUEUE_DEF(prioqueue2, prioqueue_t, PRIOQUEUE_OPLIST(prioqueue, M_DEFAULT_OPLIST())) +PRIOQUEUE_DEF(prioqueue2, prioqueue_t, PRIOQUEUE_OPLIST(prioqueue, M_BASIC_OPLIST())) #elif TEST == 15 #include "m-rbtree.h" RBTREE_DEF(rbtree, int) -RBTREE_DEF(rbtree2, rbtree_t, RBTREE_OPLIST(rbtree, M_DEFAULT_OPLIST2)) +RBTREE_DEF(rbtree2, rbtree_t, RBTREE_OPLIST(rbtree, M_BASIC_OPLIST2)) #elif TEST == 16 #include "m-shared.h" SHARED_PTR_DEF(shared, int) -SHARED_PTR_DEF(shared2, shared_t, SHARED_PTR_OPLIST(shared, M_DEFAULT_OPLISTop)) +SHARED_PTR_DEF(shared2, shared_t, SHARED_PTR_OPLIST(shared, M_BASIC_OPLISTop)) #elif TEST == 17 #include "m-snapshot.h" SNAPSHOT_SPSC_DEF(shared, int) -SNAPSHOT_SPSC_DEF(shared2, shared_t, SNAPSHOT_OPLIST(shared, M_DEFAULT_OPLIST x)) +SNAPSHOT_SPSC_DEF(shared2, shared_t, SNAPSHOT_OPLIST(shared, M_BASIC_OPLIST x)) #elif TEST == 18 #include "m-tuple.h" TUPLE_DEF2(aggregate, (x, int), (z, float)) -TUPLE_DEF2(struct2, (a, aggregate_t, TUPLE_OPLIST(aggregate, DEFAULT_OPLIST, M_DEFAULT_OPLIST))) +TUPLE_DEF2(struct2, (a, aggregate_t, TUPLE_OPLIST(aggregate, DEFAULT_OPLIST, M_BASIC_OPLIST))) #elif TEST == 19 #include "m-tuple.h" TUPLE_DEF2(aggregate, (x, int), (z, float)) -TUPLE_DEF2(struct2, (a, aggregate_t, TUPLE_OPLIST(aggregate, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST() ))) +TUPLE_DEF2(struct2, (a, aggregate_t, TUPLE_OPLIST(aggregate, M_BASIC_OPLIST, M_BASIC_OPLIST() ))) #elif TEST == 20 #include "m-variant.h" VARIANT_DEF2(aggregate, (x, int), (z, float)) -VARIANT_DEF2(struct2, (a, aggregate_t, VARIANT_OPLIST(aggregate, DEFAULT_OPLIST, M_DEFAULT_OPLIST))) +VARIANT_DEF2(struct2, (a, aggregate_t, VARIANT_OPLIST(aggregate, DEFAULT_OPLIST, M_BASIC_OPLIST))) #elif TEST == 21 #include "m-variant.h" VARIANT_DEF2(aggregate, (x, int), (z, float)) -VARIANT_DEF2(struct2, (a, aggregate_t, VARIANT_OPLIST(aggregate, M_DEFAULT_OPLIST, DEFAULT_OPLIST))) +VARIANT_DEF2(struct2, (a, aggregate_t, VARIANT_OPLIST(aggregate, M_BASIC_OPLIST, DEFAULT_OPLIST))) #elif TEST == 22 #include "m-funcobj.h" FUNC_OBJ_ITF_DEF(itf, int, int) -FUNC_OBJ_INS_DEF(ins, itf, (x), { return x * self->a + self->b; }, (a, int, M_DEFAULT_OPLIST), (b, int, M_DEFAULT_OPLIST)) -#define M_OPL_ins_t() FUNC_OBJ_INS_OPLIST(ins, M_DEFAULT_OPLIST, DEFAULT_OPLIST) +FUNC_OBJ_INS_DEF(ins, itf, (x), { return x * self->a + self->b; }, (a, int, M_BASIC_OPLIST), (b, int, M_BASIC_OPLIST)) +#define M_OPL_ins_t() FUNC_OBJ_INS_OPLIST(ins, M_BASIC_OPLIST, DEFAULT_OPLIST) int f(void) { int r; @@ -211,8 +211,8 @@ int f(void) { #include "m-funcobj.h" FUNC_OBJ_ITF_DEF(itf, int, int) -FUNC_OBJ_INS_DEF(ins, itf, (x), { return x * self->a + self->b; }, (a, int, M_DEFAULT_OPLIST), (b, int, M_DEFAULT_OPLIST)) -#define M_OPL_ins_t() FUNC_OBJ_INS_OPLIST(ins, DEFAULT_OPLIST, M_DEFAULT_OPLIST) +FUNC_OBJ_INS_DEF(ins, itf, (x), { return x * self->a + self->b; }, (a, int, M_BASIC_OPLIST), (b, int, M_BASIC_OPLIST)) +#define M_OPL_ins_t() FUNC_OBJ_INS_OPLIST(ins, DEFAULT_OPLIST, M_BASIC_OPLIST) int f(void) { int r; diff --git a/tests/fail-incompatible.c b/tests/fail-incompatible.c index 6fbe8efe..2686265d 100644 --- a/tests/fail-incompatible.c +++ b/tests/fail-incompatible.c @@ -40,7 +40,7 @@ ARRAY_DEF(array, int) ARRAY_DEF(array2, int) -ARRAY_DEF(array3, array_t, ARRAY_OPLIST(array2, M_DEFAULT_OPLIST)) +ARRAY_DEF(array3, array_t, ARRAY_OPLIST(array2, M_BASIC_OPLIST)) #elif TEST == 2 @@ -48,7 +48,7 @@ ARRAY_DEF(array3, array_t, ARRAY_OPLIST(array2, M_DEFAULT_OPLIST)) LIST_DEF(list, int) LIST_DEF(list2, int) -LIST_DEF(list3, list_t, LIST_OPLIST(list2, M_DEFAULT_OPLIST)) +LIST_DEF(list3, list_t, LIST_OPLIST(list2, M_BASIC_OPLIST)) #elif TEST == 3 @@ -56,7 +56,7 @@ LIST_DEF(list3, list_t, LIST_OPLIST(list2, M_DEFAULT_OPLIST)) DEQUE_DEF(deque, int) DEQUE_DEF(deque2, int) -DEQUE_DEF(deque3, deque_t, DEQUE_OPLIST(deque2, M_DEFAULT_OPLIST)) +DEQUE_DEF(deque3, deque_t, DEQUE_OPLIST(deque2, M_BASIC_OPLIST)) #elif TEST == 4 @@ -64,7 +64,7 @@ DEQUE_DEF(deque3, deque_t, DEQUE_OPLIST(deque2, M_DEFAULT_OPLIST)) BPTREE_DEF(bptree, 4, int) BPTREE_DEF(bptree2, 4, int) -BPTREE_DEF(bptree3, 5, bptree_t, BPTREE_OPLIST(bptree2, M_DEFAULT_OPLIST)) +BPTREE_DEF(bptree3, 5, bptree_t, BPTREE_OPLIST(bptree2, M_BASIC_OPLIST)) #elif TEST == 5 @@ -72,7 +72,7 @@ BPTREE_DEF(bptree3, 5, bptree_t, BPTREE_OPLIST(bptree2, M_DEFAULT_OPLIST)) BPTREE_DEF2(bptree, 4, int, int) BPTREE_DEF2(bptree2, 4, int, int) -BPTREE_DEF2(bptree3, 5, bptree_t, BPTREE_OPLIST2(bptree2, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST), int, M_DEFAULT_OPLIST) +BPTREE_DEF2(bptree3, 5, bptree_t, BPTREE_OPLIST2(bptree2, M_BASIC_OPLIST, M_BASIC_OPLIST), int, M_BASIC_OPLIST) #elif TEST == 6 @@ -80,7 +80,7 @@ BPTREE_DEF2(bptree3, 5, bptree_t, BPTREE_OPLIST2(bptree2, M_DEFAULT_OPLIST, M_DE BPTREE_DEF2(bptree, 4, int, int) BPTREE_DEF2(bptree2, 4, int, int) -BPTREE_DEF2(bptree3, 5, bptree_t, BPTREE_OPLIST2(bptree2, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST), int, M_DEFAULT_OPLIST) +BPTREE_DEF2(bptree3, 5, bptree_t, BPTREE_OPLIST2(bptree2, M_BASIC_OPLIST, M_BASIC_OPLIST), int, M_BASIC_OPLIST) #elif TEST == 7 @@ -88,7 +88,7 @@ BPTREE_DEF2(bptree3, 5, bptree_t, BPTREE_OPLIST2(bptree2, M_DEFAULT_OPLIST, M_DE BUFFER_DEF(buffer, int, 4, BUFFER_THREAD_UNSAFE) BUFFER_DEF(buffer2, int, 4, BUFFER_THREAD_UNSAFE) -BUFFER_DEF(buffer3, buffer_t, 5, BUFFER_QUEUE, BUFFER_OPLIST(buffer2, M_DEFAULT_OPLIST)) +BUFFER_DEF(buffer3, buffer_t, 5, BUFFER_QUEUE, BUFFER_OPLIST(buffer2, M_BASIC_OPLIST)) #elif TEST == 8 @@ -97,7 +97,7 @@ BUFFER_DEF(buffer3, buffer_t, 5, BUFFER_QUEUE, BUFFER_OPLIST(buffer2, M_DEFAULT_ ARRAY_DEF(array, int) ARRAY_DEF(array2, int) -CONCURRENT_DEF(array3, array_t, ARRAY_OPLIST(array2, M_DEFAULT_OPLIST)) +CONCURRENT_DEF(array3, array_t, ARRAY_OPLIST(array2, M_BASIC_OPLIST)) #elif TEST == 9 @@ -105,7 +105,7 @@ CONCURRENT_DEF(array3, array_t, ARRAY_OPLIST(array2, M_DEFAULT_OPLIST)) DICT_DEF2(dict, int, int) DICT_DEF2(dict2, int, int) -DICT_DEF2(dict3, int, M_DEFAULT_OPLIST, dict_t, DICT_OPLIST(dict2, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) ) +DICT_DEF2(dict3, int, M_BASIC_OPLIST, dict_t, DICT_OPLIST(dict2, M_BASIC_OPLIST, M_BASIC_OPLIST) ) #elif TEST == 10 @@ -113,7 +113,7 @@ DICT_DEF2(dict3, int, M_DEFAULT_OPLIST, dict_t, DICT_OPLIST(dict2, M_DEFAULT_OPL DICT_STOREHASH_DEF2(dict, int, int) DICT_STOREHASH_DEF2(dict2, int, int) -DICT_STOREHASH_DEF2(dict3, int, M_DEFAULT_OPLIST, dict_t, DICT_OPLIST(dict2, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) ) +DICT_STOREHASH_DEF2(dict3, int, M_BASIC_OPLIST, dict_t, DICT_OPLIST(dict2, M_BASIC_OPLIST, M_BASIC_OPLIST) ) #elif TEST == 11 @@ -122,7 +122,7 @@ DICT_STOREHASH_DEF2(dict3, int, M_DEFAULT_OPLIST, dict_t, DICT_OPLIST(dict2, M_D ARRAY_DEF(array, int) ARRAY_DEF(array2, int) -DICT_SET_DEF(dict, array_t, ARRAY_OPLIST(array2, M_DEFAULT_OPLIST) ) +DICT_SET_DEF(dict, array_t, ARRAY_OPLIST(array2, M_BASIC_OPLIST) ) #elif TEST == 12 @@ -152,7 +152,7 @@ ISHARED_PTR_DEF(tmpstr, tmp_str_t, (TYPE(struct toto), CLEAR(M_NOTHING_DEFAULT)) PRIOQUEUE_DEF(prioqueue, int) PRIOQUEUE_DEF(prioqueue2, int) -PRIOQUEUE_DEF(prioqueue3, prioqueue_t, PRIOQUEUE_OPLIST(prioqueue2, M_DEFAULT_OPLIST )) +PRIOQUEUE_DEF(prioqueue3, prioqueue_t, PRIOQUEUE_OPLIST(prioqueue2, M_BASIC_OPLIST )) #elif TEST == 15 @@ -160,7 +160,7 @@ PRIOQUEUE_DEF(prioqueue3, prioqueue_t, PRIOQUEUE_OPLIST(prioqueue2, M_DEFAULT_OP RBTREE_DEF(rbtree, int) RBTREE_DEF(rbtree2, int) -RBTREE_DEF(rbtree3, rbtree_t, RBTREE_OPLIST(rbtree2, M_DEFAULT_OPLIST)) +RBTREE_DEF(rbtree3, rbtree_t, RBTREE_OPLIST(rbtree2, M_BASIC_OPLIST)) #elif TEST == 16 @@ -168,7 +168,7 @@ RBTREE_DEF(rbtree3, rbtree_t, RBTREE_OPLIST(rbtree2, M_DEFAULT_OPLIST)) SHARED_PTR_DEF(shared, int) SHARED_PTR_DEF(shared2, int) -SHARED_PTR_DEF(shared3, shared_t, SHARED_PTR_OPLIST(shared2, M_DEFAULT_OPLIST)) +SHARED_PTR_DEF(shared3, shared_t, SHARED_PTR_OPLIST(shared2, M_BASIC_OPLIST)) #elif TEST == 17 @@ -176,7 +176,7 @@ SHARED_PTR_DEF(shared3, shared_t, SHARED_PTR_OPLIST(shared2, M_DEFAULT_OPLIST)) SNAPSHOT_SPSC_DEF(shared, int) SNAPSHOT_SPSC_DEF(shared2, int) -SNAPSHOT_SPSC_DEF(shared3, shared_t, SNAPSHOT_OPLIST(shared2, M_DEFAULT_OPLIST)) +SNAPSHOT_SPSC_DEF(shared3, shared_t, SNAPSHOT_OPLIST(shared2, M_BASIC_OPLIST)) #elif TEST == 18 @@ -184,7 +184,7 @@ SNAPSHOT_SPSC_DEF(shared3, shared_t, SNAPSHOT_OPLIST(shared2, M_DEFAULT_OPLIST)) SNAPSHOT_SPMC_DEF(shared, int) SNAPSHOT_SPMC_DEF(shared2, int) -SNAPSHOT_SPMC_DEF(shared3, shared_t, SNAPSHOT_OPLIST(shared2, M_DEFAULT_OPLIST)) +SNAPSHOT_SPMC_DEF(shared3, shared_t, SNAPSHOT_OPLIST(shared2, M_BASIC_OPLIST)) #elif TEST == 19 @@ -192,7 +192,7 @@ SNAPSHOT_SPMC_DEF(shared3, shared_t, SNAPSHOT_OPLIST(shared2, M_DEFAULT_OPLIST)) SNAPSHOT_MPMC_DEF(shared, int) SNAPSHOT_MPMC_DEF(shared2, int) -SNAPSHOT_MPMC_DEF(shared3, shared_t, SNAPSHOT_OPLIST(shared2, M_DEFAULT_OPLIST)) +SNAPSHOT_MPMC_DEF(shared3, shared_t, SNAPSHOT_OPLIST(shared2, M_BASIC_OPLIST)) #elif TEST == 20 @@ -201,8 +201,8 @@ SNAPSHOT_MPMC_DEF(shared3, shared_t, SNAPSHOT_OPLIST(shared2, M_DEFAULT_OPLIST)) TUPLE_DEF2(aggregate, (x, int), (z, float)) TUPLE_DEF2(aggregate2, (x, int), (z, float)) TUPLE_DEF2(struct2, - (a, aggregate_t, TUPLE_OPLIST(aggregate, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST)), - (b, aggregate_t, TUPLE_OPLIST(aggregate2, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST)) + (a, aggregate_t, TUPLE_OPLIST(aggregate, M_BASIC_OPLIST, M_BASIC_OPLIST)), + (b, aggregate_t, TUPLE_OPLIST(aggregate2, M_BASIC_OPLIST, M_BASIC_OPLIST)) ) #elif TEST == 21 @@ -212,8 +212,8 @@ TUPLE_DEF2(struct2, TUPLE_DEF2(aggregate, (x, int), (z, float)) TUPLE_DEF2(aggregate2, (x, int), (z, float)) TUPLE_DEF2(struct2, - (a, aggregate_t, TUPLE_OPLIST(aggregate2, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST)), - (b, aggregate_t, TUPLE_OPLIST(aggregate, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST)) + (a, aggregate_t, TUPLE_OPLIST(aggregate2, M_BASIC_OPLIST, M_BASIC_OPLIST)), + (b, aggregate_t, TUPLE_OPLIST(aggregate, M_BASIC_OPLIST, M_BASIC_OPLIST)) ) #elif TEST == 22 @@ -223,8 +223,8 @@ TUPLE_DEF2(struct2, VARIANT_DEF2(aggregate, (x, int), (z, float)) VARIANT_DEF2(aggregate2, (x, int), (z, float)) VARIANT_DEF2(struct2, - (a, aggregate_t, VARIANT_OPLIST(aggregate, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST)), - (b, aggregate_t, VARIANT_OPLIST(aggregate2, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST)) + (a, aggregate_t, VARIANT_OPLIST(aggregate, M_BASIC_OPLIST, M_BASIC_OPLIST)), + (b, aggregate_t, VARIANT_OPLIST(aggregate2, M_BASIC_OPLIST, M_BASIC_OPLIST)) ) #elif TEST == 23 @@ -234,8 +234,8 @@ VARIANT_DEF2(struct2, VARIANT_DEF2(aggregate, (x, int), (z, float)) VARIANT_DEF2(aggregate2, (x, int), (z, float)) VARIANT_DEF2(struct2, - (a, aggregate_t, VARIANT_OPLIST(aggregate2, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST)), - (b, aggregate_t, VARIANT_OPLIST(aggregate, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST)) + (a, aggregate_t, VARIANT_OPLIST(aggregate2, M_BASIC_OPLIST, M_BASIC_OPLIST)), + (b, aggregate_t, VARIANT_OPLIST(aggregate, M_BASIC_OPLIST, M_BASIC_OPLIST)) ) #elif TEST == 24 diff --git a/tests/fail-no-oplist.c b/tests/fail-no-oplist.c index 9b00c3ec..53fcb994 100644 --- a/tests/fail-no-oplist.c +++ b/tests/fail-no-oplist.c @@ -123,13 +123,13 @@ ALGO_DEF(array, (OPLIST(array))) #include "m-bptree.h" -BPTREE_DEF2(tree, 4, int, M_DEFAULT_OPLIST, int, DEFAULT_OPLIST) +BPTREE_DEF2(tree, 4, int, M_BASIC_OPLIST, int, DEFAULT_OPLIST) #elif TEST == 14 #include "m-bptree.h" -BPTREE_DEF2(tree, 4, int, DEFAULT_OPLIST, int, M_DEFAULT_OPLIST) +BPTREE_DEF2(tree, 4, int, DEFAULT_OPLIST, int, M_BASIC_OPLIST) #elif TEST == 15 @@ -141,7 +141,7 @@ BPTREE_DEF(tree, 4, int, DEFAULT_OPLIST) #include "m-bptree.h" -BPTREE_MULTI_DEF2(tree, 4, int, DEFAULT_OPLIST, int, M_DEFAULT_OPLIST) +BPTREE_MULTI_DEF2(tree, 4, int, DEFAULT_OPLIST, int, M_BASIC_OPLIST) #elif TEST == 17 @@ -187,37 +187,37 @@ CONCURRENT_RP_DEF(lock_array, array_t, MARRAY_OPLIST(array)) #include "m-dict.h" -DICT_DEF2(array, int, M_DEFAULT_OPLIST, int, DEFAULT_OPLIST) +DICT_DEF2(array, int, M_BASIC_OPLIST, int, DEFAULT_OPLIST) #elif TEST == 24 #include "m-dict.h" -DICT_DEF2(array, int, DEFAULT_OPLIST, int, M_DEFAULT_OPLIST) +DICT_DEF2(array, int, DEFAULT_OPLIST, int, M_BASIC_OPLIST) #elif TEST == 25 #include "m-dict.h" -DICT_STOREHASH_DEF2(array, int, DEFAULT_OPLIST, int, M_DEFAULT_OPLIST) +DICT_STOREHASH_DEF2(array, int, DEFAULT_OPLIST, int, M_BASIC_OPLIST) #elif TEST == 26 #include "m-dict.h" -DICT_STOREHASH_DEF2(array, int, M_DEFAULT_OPLIST, int, DEFAULT_OPLIST) +DICT_STOREHASH_DEF2(array, int, M_BASIC_OPLIST, int, DEFAULT_OPLIST) #elif TEST == 27 #include "m-dict.h" -DICT_OA_DEF2(array, int, DEFAULT_OPLIST, int, M_DEFAULT_OPLIST) +DICT_OA_DEF2(array, int, DEFAULT_OPLIST, int, M_BASIC_OPLIST) #elif TEST == 28 #include "m-dict.h" -DICT_OA_DEF2(array, int, M_DEFAULT_OPLIST, int, DEFAULT_OPLIST) +DICT_OA_DEF2(array, int, M_BASIC_OPLIST, int, DEFAULT_OPLIST) #elif TEST == 29 @@ -252,43 +252,43 @@ PRIOQUEUE_DEF(prio, int, DEFAULT_OPLIST) #include "m-rbtree.h" -RBTREE_DEF(tree, int, M_DEFAULT_OPLIST() ) +RBTREE_DEF(tree, int, M_BASIC_OPLIST() ) #elif TEST == 34 #include "m-shared.h" -SHARED_PTR_DEF(shared, int, M_DEFAULT_OPLIST2 ) +SHARED_PTR_DEF(shared, int, M_BASIC_OPLIST2 ) #elif TEST == 35 #include "m-shared.h" -SHARED_RESOURCE_DEF(shared, int, M_DEFAULT_OPLIST3 ) +SHARED_RESOURCE_DEF(shared, int, M_BASIC_OPLIST3 ) #elif TEST == 36 #include "m-snapshot.h" -SNAPSHOT_SPSC_DEF(snap, int, M_DEFAULT_OPLIST2 ) +SNAPSHOT_SPSC_DEF(snap, int, M_BASIC_OPLIST2 ) #elif TEST == 37 #include "m-snapshot.h" -SNAPSHOT_SPMC_DEF(snap, int, M_DEFAULT_OPLIST2 ) +SNAPSHOT_SPMC_DEF(snap, int, M_BASIC_OPLIST2 ) #elif TEST == 38 #include "m-snapshot.h" -SNAPSHOT_MPMC_DEF(snap, int, M_DEFAULT_OPLIST8 ) +SNAPSHOT_MPMC_DEF(snap, int, M_BASIC_OPLIST8 ) #elif TEST == 39 #include "m-tuple.h" -TUPLE_DEF2(agregate, (x, int, M_DEFAULT_OPLIST), (y, float, DEFAULT_OPLIST) ) +TUPLE_DEF2(agregate, (x, int, M_BASIC_OPLIST), (y, float, DEFAULT_OPLIST) ) #elif TEST == 40 @@ -300,7 +300,7 @@ TUPLE_DEF2(agregate, (x, int, DEFAULT_OPLIST), (y, float) ) #include "m-variant.h" -VARIANT_DEF2(agregate, (x, int, M_DEFAULT_OPLIST), (y, float, DEFAULT_OPLIST) ) +VARIANT_DEF2(agregate, (x, int, M_BASIC_OPLIST), (y, float, DEFAULT_OPLIST) ) #elif TEST == 42 @@ -314,7 +314,7 @@ VARIANT_DEF2(agregate, (x, int, DEFAULT_OPLIST), (y, float) ) FUNC_OBJ_ITF_DEF(itf, int, int) -FUNC_OBJ_INS_DEF(ins, itf, (x), { return x * self->a + self->b; }, (a, int, DEFAULT_OPLIST), (b, int, M_DEFAULT_OPLIST)) +FUNC_OBJ_INS_DEF(ins, itf, (x), { return x * self->a + self->b; }, (a, int, DEFAULT_OPLIST), (b, int, M_BASIC_OPLIST)) #elif TEST == 44 @@ -322,7 +322,7 @@ FUNC_OBJ_INS_DEF(ins, itf, (x), { return x * self->a + self->b; }, (a, int, DEFA FUNC_OBJ_ITF_DEF(itf, int, int) -FUNC_OBJ_INS_DEF(ins, itf, (x), { return x * self->a + self->b; }, (a, int), (b, int, M_DEFAULT_OPLIST() )) +FUNC_OBJ_INS_DEF(ins, itf, (x), { return x * self->a + self->b; }, (a, int), (b, int, M_BASIC_OPLIST() )) #else diff --git a/tests/test-malgo.c b/tests/test-malgo.c index b3271a91..a983bbc0 100644 --- a/tests/test-malgo.c +++ b/tests/test-malgo.c @@ -48,12 +48,12 @@ DEQUE_DEF(deque_obj, testobj_t, TESTOBJ_CMP_OPLIST) DICT_DEF2(dict_obj, string_t, STRING_OPLIST, testobj_t, TESTOBJ_OPLIST) LIST_DUAL_PUSH_DEF(dlist_int, int) DICT_DEF2(dict_int, string_t, int) -#define M_OPL_dict_int_t() DICT_OPLIST(dict_int, STRING_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_dict_int_t() DICT_OPLIST(dict_int, STRING_OPLIST, M_BASIC_OPLIST) ARRAY_DEF(array_uint, unsigned int) #define M_OPL_array_uint_t() ARRAY_OPLIST(array_uint) TUPLE_DEF2(person, (age, int), (name, string_t) ) -#define M_OPL_person_t() TUPLE_OPLIST(person, M_DEFAULT_OPLIST, STRING_OPLIST) +#define M_OPL_person_t() TUPLE_OPLIST(person, M_BASIC_OPLIST, STRING_OPLIST) ARRAY_DEF(array_person, person_t) #define M_OPL_array_person_t() ARRAY_OPLIST(array_person, M_OPL_person_t() ) @@ -225,32 +225,32 @@ static void test_list(void) list_int_clear(l); - M_LET( (l1, 1, 3, 5), (l2, 1, 2, 4), (l3, 1, 2, 3, 4, 5), LIST_OPLIST(list_int, M_DEFAULT_OPLIST)) { + M_LET( (l1, 1, 3, 5), (l2, 1, 2, 4), (l3, 1, 2, 3, 4, 5), LIST_OPLIST(list_int, M_BASIC_OPLIST)) { algo_list_sort_union(l1, l2); assert(list_int_equal_p (l1, l3)); } - M_LET( (l1, 1, 30, 31), (l2, 2, 4, 31, 32), (l3, 1, 2, 4, 30, 31, 32), LIST_OPLIST(list_int, M_DEFAULT_OPLIST)) { + M_LET( (l1, 1, 30, 31), (l2, 2, 4, 31, 32), (l3, 1, 2, 4, 30, 31, 32), LIST_OPLIST(list_int, M_BASIC_OPLIST)) { algo_list_sort_union(l1, l2); assert(list_int_equal_p (l1, l3)); } - M_LET( (l1, 4, 28, 29, 30, 34), (l2, 1, 3, 31, 32, 33), (l3, 1, 3, 4, 28, 29, 30, 31, 32, 33, 34), LIST_OPLIST(list_int, M_DEFAULT_OPLIST)) { + M_LET( (l1, 4, 28, 29, 30, 34), (l2, 1, 3, 31, 32, 33), (l3, 1, 3, 4, 28, 29, 30, 31, 32, 33, 34), LIST_OPLIST(list_int, M_BASIC_OPLIST)) { algo_list_sort_union(l1, l2); assert(list_int_equal_p (l1, l3)); } - M_LET( (l1, 1, 4, 28, 29, 31, 34), (l2, 1, 3, 31, 32, 33), (l3, 1, 31), LIST_OPLIST(list_int, M_DEFAULT_OPLIST)) { + M_LET( (l1, 1, 4, 28, 29, 31, 34), (l2, 1, 3, 31, 32, 33), (l3, 1, 31), LIST_OPLIST(list_int, M_BASIC_OPLIST)) { algo_list_sort_intersect(l1, l2); assert(list_int_equal_p (l1, l3)); } - M_LET( (l1, 4, 28, 29, 31, 34), (l2, 1, 3, 31, 32, 33), (l3, (31)), LIST_OPLIST(list_int, M_DEFAULT_OPLIST)) { + M_LET( (l1, 4, 28, 29, 31, 34), (l2, 1, 3, 31, 32, 33), (l3, (31)), LIST_OPLIST(list_int, M_BASIC_OPLIST)) { algo_list_sort_intersect(l1, l2); assert(list_int_equal_p (l1, l3)); } - M_LET( (l1, 1, 4, 28, 29, 31, 34), (l2, 3, 32, 33), l3, LIST_OPLIST(list_int, M_DEFAULT_OPLIST)) { + M_LET( (l1, 1, 4, 28, 29, 31, 34), (l2, 3, 32, 33), l3, LIST_OPLIST(list_int, M_BASIC_OPLIST)) { algo_list_sort_intersect(l1, l2); assert(list_int_equal_p (l1, l3)); } @@ -646,25 +646,25 @@ FUNC_OBJ_INS_DEF(fo_test, algo_array_fo_test_obj, (a), { return a == self->x; }, (x, int)) -#define M_OPL_fo_test_t() FUNC_OBJ_INS_OPLIST(fo_test, M_DEFAULT_OPLIST) +#define M_OPL_fo_test_t() FUNC_OBJ_INS_OPLIST(fo_test, M_BASIC_OPLIST) FUNC_OBJ_INS_DEF(fo_eq, algo_array_fo_eq_obj, (a, b), { return a == b && self->x != a; }, (x, int)) -#define M_OPL_fo_eq_t() FUNC_OBJ_INS_OPLIST(fo_eq, M_DEFAULT_OPLIST) +#define M_OPL_fo_eq_t() FUNC_OBJ_INS_OPLIST(fo_eq, M_BASIC_OPLIST) FUNC_OBJ_INS_DEF(fo_cmp, algo_array_fo_cmp_obj, (a, b), { return a < b ? -self->x : a > b ? self->x : 0; }, (x, int)) -#define M_OPL_fo_cmp_t() FUNC_OBJ_INS_OPLIST(fo_cmp, M_DEFAULT_OPLIST) +#define M_OPL_fo_cmp_t() FUNC_OBJ_INS_OPLIST(fo_cmp, M_BASIC_OPLIST) FUNC_OBJ_INS_DEF(fol_cmp, algo_list_fo_cmp_obj, (a, b), { return a < b ? -self->x : a > b ? self->x : 0; }, (x, int)) -#define M_OPL_fol_cmp_t() FUNC_OBJ_INS_OPLIST(fol_cmp, M_DEFAULT_OPLIST) +#define M_OPL_fol_cmp_t() FUNC_OBJ_INS_OPLIST(fol_cmp, M_BASIC_OPLIST) static void test_fo(void) { diff --git a/tests/test-marray.c b/tests/test-marray.c index 71895aff..708621a0 100644 --- a/tests/test-marray.c +++ b/tests/test-marray.c @@ -39,7 +39,7 @@ ARRAY_DEF(array_min3_z, testobj_t, (CLEAR(testobj_clear))) ARRAY_DEF(array_ulong, uint64_t) ARRAY_DEF_AS(array_double, ArrayDouble, ArrayDoubleIt, double) -#define M_OPL_ArrayDouble() ARRAY_OPLIST(array_double, M_DEFAULT_OPLIST) +#define M_OPL_ArrayDouble() ARRAY_OPLIST(array_double, M_BASIC_OPLIST) ArrayDouble g_array = ARRAY_INIT_VALUE(); diff --git a/tests/test-mbptree.c b/tests/test-mbptree.c index 03def1f2..598987a9 100644 --- a/tests/test-mbptree.c +++ b/tests/test-mbptree.c @@ -28,7 +28,7 @@ #include "coverage.h" START_COVERAGE -BPTREE_DEF2(btree, 3, int, M_DEFAULT_OPLIST, int, M_DEFAULT_OPLIST) +BPTREE_DEF2(btree, 3, int, M_BASIC_OPLIST, int, M_BASIC_OPLIST) END_COVERAGE BPTREE_DEF2(btree_my, 3, testobj_t, TESTOBJ_CMP_OPLIST, testobj_t, TESTOBJ_CMP_OPLIST) @@ -38,17 +38,17 @@ BPTREE_DEF2(btree_int, 17, int, int) BPTREE_DEF(btree_intset, 13, int) BPTREE_DEF(btree_myset, 15, testobj_t, TESTOBJ_CMP_OPLIST) -BPTREE_MULTI_DEF2(multimap, 3, int, M_DEFAULT_OPLIST, int, M_DEFAULT_OPLIST) -BPTREE_MULTI_DEF(multiset, 6, int, M_DEFAULT_OPLIST) +BPTREE_MULTI_DEF2(multimap, 3, int, M_BASIC_OPLIST, int, M_BASIC_OPLIST) +BPTREE_MULTI_DEF(multiset, 6, int, M_BASIC_OPLIST) BPTREE_DEF2_AS(MapDouble, MapDouble, MapDoubleIt, MapDoubleItRef, 4, double, double) -#define M_OPL_MapDouble() BPTREE_OPLIST2(MapDouble, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_MapDouble() BPTREE_OPLIST2(MapDouble, M_BASIC_OPLIST, M_BASIC_OPLIST) BPTREE_DEF_AS(SetDouble, SetDouble, SetDoubleIt, 7, double) -#define M_OPL_SetDouble() BPTREE_OPLIST(SetDouble, M_DEFAULT_OPLIST) +#define M_OPL_SetDouble() BPTREE_OPLIST(SetDouble, M_BASIC_OPLIST) BPTREE_MULTI_DEF2_AS(MultiMapDouble, MultiMapDouble, MultiMapDoubleIt, MultiMapDoubleItRef, 8, double, double) -#define M_OPL_MultiMapDouble() BPTREE_OPLIST2(MultiMapDouble, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_MultiMapDouble() BPTREE_OPLIST2(MultiMapDouble, M_BASIC_OPLIST, M_BASIC_OPLIST) BPTREE_MULTI_DEF_AS(MultiSetDouble, MultiSetDouble, MultiSetDoubleIt, 9, double) -#define M_OPL_MultiSetDouble() BPTREE_OPLIST(MultiSetDouble, M_DEFAULT_OPLIST) +#define M_OPL_MultiSetDouble() BPTREE_OPLIST(MultiSetDouble, M_BASIC_OPLIST) static void test1(void) { diff --git a/tests/test-mbuffer.c b/tests/test-mbuffer.c index d545521a..492a670c 100644 --- a/tests/test-mbuffer.c +++ b/tests/test-mbuffer.c @@ -49,9 +49,9 @@ QUEUE_SPSC_DEF(squeue_a, testobj_t, BUFFER_QUEUE, TESTOBJ_OPLIST) BUFFER_DEF_AS(BufferDouble1, BufferDouble1, double, 4, BUFFER_QUEUE) QUEUE_MPMC_DEF_AS(BufferDouble2, BufferDouble2, double, BUFFER_QUEUE) QUEUE_SPSC_DEF_AS(BufferDouble3, BufferDouble3, double, BUFFER_QUEUE) -#define M_OPL_BufferDouble1() BUFFER_OPLIST(BufferDouble1, M_DEFAULT_OPLIST) -#define M_OPL_BufferDouble2() BUFFER_OPLIST(BufferDouble2, M_DEFAULT_OPLIST) -#define M_OPL_BufferDouble3() BUFFER_OPLIST(BufferDouble3, M_DEFAULT_OPLIST) +#define M_OPL_BufferDouble1() BUFFER_OPLIST(BufferDouble1, M_BASIC_OPLIST) +#define M_OPL_BufferDouble2() BUFFER_OPLIST(BufferDouble2, M_BASIC_OPLIST) +#define M_OPL_BufferDouble3() BUFFER_OPLIST(BufferDouble3, M_BASIC_OPLIST) buffer_uint_t g_buff; buffer_uint_t g_buffB; diff --git a/tests/test-mconcurrent.c b/tests/test-mconcurrent.c index 622517d6..835b752c 100644 --- a/tests/test-mconcurrent.c +++ b/tests/test-mconcurrent.c @@ -37,13 +37,13 @@ #include "m-concurrent.h" TUPLE_DEF2(point, (x, int), (y, int)) -#define M_OPL_point_t() TUPLE_OPLIST(point, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_point_t() TUPLE_OPLIST(point, M_BASIC_OPLIST, M_BASIC_OPLIST) START_COVERAGE CONCURRENT_DEF(ppoint, point_t) END_COVERAGE VARIANT_DEF2(dimension, (x, int), (y, float)) -#define M_OPL_dimension_t() VARIANT_OPLIST(dimension, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_dimension_t() VARIANT_OPLIST(dimension, M_BASIC_OPLIST, M_BASIC_OPLIST) CONCURRENT_DEF(pdimension, dimension_t) ARRAY_DEF(array1, int) @@ -68,7 +68,7 @@ PRIOQUEUE_DEF(prio1, int) CONCURRENT_DEF(pprio1, prio1_t, PRIOQUEUE_OPLIST(prio1)) BPTREE_DEF2(bptree1, 10, int, int) -CONCURRENT_DEF(pbtree1, bptree1_t, BPTREE_OPLIST2(bptree1, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST)) +CONCURRENT_DEF(pbtree1, bptree1_t, BPTREE_OPLIST2(bptree1, M_BASIC_OPLIST, M_BASIC_OPLIST)) BPTREE_DEF(bptree2, 10, int) CONCURRENT_DEF(pbtree2, bptree2_t, BPTREE_OPLIST(bptree2)) @@ -110,8 +110,8 @@ static inline void int_oor_set(int *s, unsigned char n) *s = -n; } #define INT_OA_OPLIST \ - M_OPEXTEND(M_DEFAULT_OPLIST, OOR_EQUAL(int_oor_equal_p), OOR_SET(API_2(int_oor_set))) -DICT_OA_DEF2(dict3, int, INT_OA_OPLIST, int, M_DEFAULT_OPLIST) + M_OPEXTEND(M_BASIC_OPLIST, OOR_EQUAL(int_oor_equal_p), OOR_SET(API_2(int_oor_set))) +DICT_OA_DEF2(dict3, int, INT_OA_OPLIST, int, M_BASIC_OPLIST) CONCURRENT_DEF(pdict3, dict3_t, DICT_OPLIST(dict3)) /********************************/ diff --git a/tests/test-mcore.c b/tests/test-mcore.c index fc7193eb..7b115d2e 100644 --- a/tests/test-mcore.c +++ b/tests/test-mcore.c @@ -439,11 +439,11 @@ static void test_oplist(void) #define CHECK_OPLIST(op, oplist) \ M_IF_METHOD(op, oplist) (true, false) - assert (CHECK_OPLIST (INIT, M_DEFAULT_OPLIST)); - assert (CHECK_OPLIST (INIT_SET, M_DEFAULT_OPLIST)); - assert (CHECK_OPLIST (SET, M_DEFAULT_OPLIST)); - assert (CHECK_OPLIST (CLEAR, M_DEFAULT_OPLIST)); - assert (!CHECK_OPLIST (CLEAR_TOOT, M_DEFAULT_OPLIST)); + assert (CHECK_OPLIST (INIT, M_BASIC_OPLIST)); + assert (CHECK_OPLIST (INIT_SET, M_BASIC_OPLIST)); + assert (CHECK_OPLIST (SET, M_BASIC_OPLIST)); + assert (CHECK_OPLIST (CLEAR, M_BASIC_OPLIST)); + assert (!CHECK_OPLIST (CLEAR_TOOT, M_BASIC_OPLIST)); assert (M_OPLIST_P(())); assert (M_OPLIST_P((INIT(init)))); diff --git a/tests/test-mdeque.c b/tests/test-mdeque.c index cc796722..8c2708c8 100644 --- a/tests/test-mdeque.c +++ b/tests/test-mdeque.c @@ -46,7 +46,7 @@ DEQUE_DEF(deque_retcode, ReturnCode_t, M_ENUM_OPLIST(ReturnCode_t, SUCCESS)) #define OPL DEQUE_OPLIST(deque) DEQUE_DEF_AS(DequeDouble, DequeDouble, DequeDoubleIt, double) -#define M_OPL_DequeDouble() DEQUE_OPLIST(DequeDouble, M_DEFAULT_OPLIST) +#define M_OPL_DequeDouble() DEQUE_OPLIST(DequeDouble, M_BASIC_OPLIST) ARRAY_DEF(array, int) diff --git a/tests/test-mdict.c b/tests/test-mdict.c index a44627f4..02cb74cb 100644 --- a/tests/test-mdict.c +++ b/tests/test-mdict.c @@ -34,25 +34,25 @@ static inline void update_value (int *p, const int p1, const int p2) { *p = p1 + #include "coverage.h" START_COVERAGE DICT_DEF2(dict_str, string_t, STRING_OPLIST, string_t, STRING_OPLIST) -DICT_OA_DEF2(dict_oa_int, int, M_OPEXTEND(M_DEFAULT_OPLIST, OOR_EQUAL(oor_equal_p), OOR_SET(oor_set M_IPTR)), int, M_OPEXTEND(M_DEFAULT_OPLIST, ADD(update_value M_IPTR))) +DICT_OA_DEF2(dict_oa_int, int, M_OPEXTEND(M_BASIC_OPLIST, OOR_EQUAL(oor_equal_p), OOR_SET(oor_set M_IPTR)), int, M_OPEXTEND(M_BASIC_OPLIST, ADD(update_value M_IPTR))) END_COVERAGE DICT_STOREHASH_DEF2(dict_str2, string_t, STRING_OPLIST, string_t, STRING_OPLIST) DICT_SET_DEF(dict_setstr, string_t, STRING_OPLIST) -DICT_DEF2(dict_int, int, M_DEFAULT_OPLIST, int, M_DEFAULT_OPLIST) +DICT_DEF2(dict_int, int, M_BASIC_OPLIST, int, M_BASIC_OPLIST) DICT_DEF2(dict_mpz, string_t, STRING_OPLIST, testobj_t, TESTOBJ_OPLIST) BOUNDED_STRING_DEF(symbol, 15) -DICT_OA_DEF2(dict_oa_str, symbol_t, BOUNDED_STRING_OPLIST(symbol), int, M_DEFAULT_OPLIST) +DICT_OA_DEF2(dict_oa_str, symbol_t, BOUNDED_STRING_OPLIST(symbol), int, M_BASIC_OPLIST) -DICT_OA_DEF2(dict_oa_bstr, string_t, STRING_OPLIST, int, M_DEFAULT_OPLIST) +DICT_OA_DEF2(dict_oa_bstr, string_t, STRING_OPLIST, int, M_BASIC_OPLIST) DICT_OASET_DEF(dict_oa_setstr, string_t, STRING_OPLIST) -DICT_DEF2_AS(dictas_int, DictInt, DictIntIt, DictIntItRef, int, M_DEFAULT_OPLIST, int, M_DEFAULT_OPLIST) +DICT_DEF2_AS(dictas_int, DictInt, DictIntIt, DictIntItRef, int, M_BASIC_OPLIST, int, M_BASIC_OPLIST) DICT_STOREHASH_DEF2_AS(dictas_str2, DictSInt, DictSIntIt, DictSIntItRef, string_t, STRING_OPLIST, string_t, STRING_OPLIST) DICT_SET_DEF_AS(dictas_setstr, DictStr, DictStrIt, string_t, STRING_OPLIST) -DICT_OA_DEF2_AS(dictas_oa_bstr, DictOAStr, DictOAStrIt, DictOAStrItRef, string_t, STRING_OPLIST, int, M_DEFAULT_OPLIST) +DICT_OA_DEF2_AS(dictas_oa_bstr, DictOAStr, DictOAStrIt, DictOAStrItRef, string_t, STRING_OPLIST, int, M_BASIC_OPLIST) DICT_OASET_DEF_AS(dictas_oa_setstr, DictOASStr, DictOASStrIt, string_t, STRING_OPLIST) @@ -374,7 +374,7 @@ static void test_oa(void) static void test_init_oa(void) { - M_LET(d1, d2, DICT_OPLIST(dict_oa_int, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST)){ + M_LET(d1, d2, DICT_OPLIST(dict_oa_int, M_BASIC_OPLIST, M_BASIC_OPLIST)){ for(int i = 0; i < 100; i++) { dict_oa_int_set_at (d1, 2*i, 2*i+1); } @@ -430,7 +430,7 @@ static void test_init_oa(void) //assert (dict_oa_int_hash (d2) != 0); } - M_LET( (d1, (1, 2), (2, 3), (4, 5)), (d2, (1, 3), (4, 7), (10, 14)), (r1, (1, 5), (2, 3), (4, 12), (10, 14) ), DICT_OPLIST(dict_oa_int, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST)) { + M_LET( (d1, (1, 2), (2, 3), (4, 5)), (d2, (1, 3), (4, 7), (10, 14)), (r1, (1, 5), (2, 3), (4, 12), (10, 14) ), DICT_OPLIST(dict_oa_int, M_BASIC_OPLIST, M_BASIC_OPLIST)) { dict_oa_int_splice(d1, d2); assert(dict_oa_int_equal_p(d1, r1)); assert(dict_oa_int_empty_p(d2)); @@ -439,7 +439,7 @@ static void test_init_oa(void) static void test_it_oa(void) { - M_LET(d1, DICT_OPLIST(dict_oa_int, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST)){ + M_LET(d1, DICT_OPLIST(dict_oa_int, M_BASIC_OPLIST, M_BASIC_OPLIST)){ dict_oa_int_it_t it0; dict_oa_int_it(it0, d1); diff --git a/tests/test-mfuncobj.c b/tests/test-mfuncobj.c index 5195832b..701d2446 100644 --- a/tests/test-mfuncobj.c +++ b/tests/test-mfuncobj.c @@ -67,7 +67,7 @@ FUNC_OBJ_INS_DEF(instance22, END_COVERAGE -#define M_OPL_instance22_t() FUNC_OBJ_INS_OPLIST(instance22, M_DEFAULT_OPLIST) +#define M_OPL_instance22_t() FUNC_OBJ_INS_OPLIST(instance22, M_BASIC_OPLIST) FUNC_OBJ_ITF_DEF_AS(Interface, Interface, double, double) @@ -78,7 +78,7 @@ FUNC_OBJ_INS_DEF_AS(Instance, Instance, }, (a, double), (b, double) ) -#define M_OPL_Instance() FUNC_OBJ_INS_OPLIST(Instance, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_Instance() FUNC_OBJ_INS_OPLIST(Instance, M_BASIC_OPLIST, M_BASIC_OPLIST) static void test_instance11(void) { diff --git a/tests/test-mlist.c b/tests/test-mlist.c index 50133852..59ee0b59 100644 --- a/tests/test-mlist.c +++ b/tests/test-mlist.c @@ -43,10 +43,10 @@ LIST_DEF(list_string, string_t) #define M_OPL_list_string_t() LIST_OPLIST(list_string, STRING_OPLIST) LIST_DEF_AS(list_double, ListDouble, ListDoubleIt, double) -#define M_OPL_ListDouble() LIST_OPLIST(list_double, M_DEFAULT_OPLIST) +#define M_OPL_ListDouble() LIST_OPLIST(list_double, M_BASIC_OPLIST) LIST_DUAL_PUSH_DEF_AS(list_doubleDP, ListDoubleDP, ListDoubleDPIt, double) -#define M_OPL_ListDoubleDP() LIST_OPLIST(list_doubleDP, M_DEFAULT_OPLIST) +#define M_OPL_ListDoubleDP() LIST_OPLIST(list_doubleDP, M_BASIC_OPLIST) ListDouble g_array1 = LIST_INIT_VALUE(); ListDoubleDP g_array2 = LIST_DUAL_PUSH_INIT_VALUE(); diff --git a/tests/test-mprioqueue.c b/tests/test-mprioqueue.c index 8df1ac48..70e4af7d 100644 --- a/tests/test-mprioqueue.c +++ b/tests/test-mprioqueue.c @@ -38,7 +38,7 @@ static inline bool testobj_equal2_p(const testobj_t z1, const testobj_t z2) PRIOQUEUE_DEF(obj_pqueue, testobj_t, M_OPEXTEND(TESTOBJ_CMP_OPLIST, EQUAL(testobj_equal2_p) )) PRIOQUEUE_DEF_AS(PrioDouble, PrioDouble, PrioDoubleIt, double) -#define M_OPL_PrioDouble() PRIOQUEUE_OPLIST(PrioDouble, M_DEFAULT_OPLIST) +#define M_OPL_PrioDouble() PRIOQUEUE_OPLIST(PrioDouble, M_BASIC_OPLIST) static void test1(void) { diff --git a/tests/test-mrbtree.c b/tests/test-mrbtree.c index 7880ba84..463548e9 100644 --- a/tests/test-mrbtree.c +++ b/tests/test-mrbtree.c @@ -51,7 +51,7 @@ static void uint_get_str(string_t str, unsigned int u, bool append) #include "coverage.h" START_COVERAGE -RBTREE_DEF(rbtree_uint, unsigned int, M_OPEXTEND(M_DEFAULT_OPLIST, IN_STR(uint_in_str M_IPTR), OUT_STR(uint_out_str), GET_STR(uint_get_str), PARSE_STR(uint_parse_str M_IPTR)) ) +RBTREE_DEF(rbtree_uint, unsigned int, M_OPEXTEND(M_BASIC_OPLIST, IN_STR(uint_in_str M_IPTR), OUT_STR(uint_out_str), GET_STR(uint_get_str), PARSE_STR(uint_parse_str M_IPTR)) ) END_COVERAGE RBTREE_DEF(rbtree_float, float) @@ -60,8 +60,8 @@ RBTREE_DEF(rbtree_mpz, testobj_t, TESTOBJ_OPLIST) #define UINT_OPLIST RBTREE_OPLIST(rbtree_uint) #define FLOAT_OP RBTREE_OPLIST(rbtree_float) -RBTREE_DEF_AS(TreeDouble, TreeDouble, TreeDoubleIt, double, M_DEFAULT_OPLIST) -#define M_OPL_TreeDouble() RBTREE_OPLIST(TreeDouble, M_DEFAULT_OPLIST) +RBTREE_DEF_AS(TreeDouble, TreeDouble, TreeDoubleIt, double, M_BASIC_OPLIST) +#define M_OPL_TreeDouble() RBTREE_OPLIST(TreeDouble, M_BASIC_OPLIST) static void test_uint(void) { diff --git a/tests/test-mserial-bin.c b/tests/test-mserial-bin.c index 5778f5bd..4f8d56ea 100644 --- a/tests/test-mserial-bin.c +++ b/tests/test-mserial-bin.c @@ -31,18 +31,18 @@ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L ARRAY_DEF(a2, int) -#define M_OPL_a2_t() ARRAY_OPLIST(a2, M_DEFAULT_OPLIST) +#define M_OPL_a2_t() ARRAY_OPLIST(a2, M_BASIC_OPLIST) ARRAY_DEF(l2, int) -#define M_OPL_l2_t() ARRAY_OPLIST(l2, M_DEFAULT_OPLIST) +#define M_OPL_l2_t() ARRAY_OPLIST(l2, M_BASIC_OPLIST) -DICT_DEF2(d2, string_t, STRING_OPLIST, int, M_DEFAULT_OPLIST ) -#define M_OPL_d2_t() DICT_OPLIST(d2, STRING_OPLIST, M_DEFAULT_OPLIST) +DICT_DEF2(d2, string_t, STRING_OPLIST, int, M_BASIC_OPLIST ) +#define M_OPL_d2_t() DICT_OPLIST(d2, STRING_OPLIST, M_BASIC_OPLIST) VARIANT_DEF2(v2, (is_int, int), (is_bool, bool) ) -#define M_OPL_v2_t() VARIANT_OPLIST(v2, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_v2_t() VARIANT_OPLIST(v2, M_BASIC_OPLIST, M_BASIC_OPLIST) TUPLE_DEF2(my, (vala, int), @@ -54,7 +54,7 @@ TUPLE_DEF2(my, (valg, l2_t), (valh, d2_t) ) -#define M_OPL_my_t() TUPLE_OPLIST(my, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST, STRING_OPLIST, M_OPL_a2_t(), M_OPL_v2_t(), M_OPL_l2_t(), M_OPL_d2_t() ) +#define M_OPL_my_t() TUPLE_OPLIST(my, M_BASIC_OPLIST, M_BASIC_OPLIST, M_BASIC_OPLIST, STRING_OPLIST, M_OPL_a2_t(), M_OPL_v2_t(), M_OPL_l2_t(), M_OPL_d2_t() ) TUPLE_DEF2(my2, (activated, bool), diff --git a/tests/test-mserial-json.c b/tests/test-mserial-json.c index 14aa717c..29f78ad5 100644 --- a/tests/test-mserial-json.c +++ b/tests/test-mserial-json.c @@ -31,18 +31,18 @@ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L ARRAY_DEF(a2, int) -#define M_OPL_a2_t() ARRAY_OPLIST(a2, M_DEFAULT_OPLIST) +#define M_OPL_a2_t() ARRAY_OPLIST(a2, M_BASIC_OPLIST) ARRAY_DEF(l2, int) -#define M_OPL_l2_t() ARRAY_OPLIST(l2, M_DEFAULT_OPLIST) +#define M_OPL_l2_t() ARRAY_OPLIST(l2, M_BASIC_OPLIST) -DICT_DEF2(d2, string_t, STRING_OPLIST, int, M_DEFAULT_OPLIST ) -#define M_OPL_d2_t() DICT_OPLIST(d2, STRING_OPLIST, M_DEFAULT_OPLIST) +DICT_DEF2(d2, string_t, STRING_OPLIST, int, M_BASIC_OPLIST ) +#define M_OPL_d2_t() DICT_OPLIST(d2, STRING_OPLIST, M_BASIC_OPLIST) VARIANT_DEF2(v2, (is_int, int), (is_bool, bool) ) -#define M_OPL_v2_t() VARIANT_OPLIST(v2, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_v2_t() VARIANT_OPLIST(v2, M_BASIC_OPLIST, M_BASIC_OPLIST) typedef enum { SUCCESS = 0, NULL_PARAM, INVALID_PARAM @@ -60,7 +60,7 @@ TUPLE_DEF2(my, (valh, d2_t), (vali, my_return_code_t) ) -#define M_OPL_my_t() TUPLE_OPLIST(my, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST, M_DEFAULT_OPLIST, STRING_OPLIST, M_OPL_a2_t(), M_OPL_v2_t(), M_OPL_l2_t(), M_OPL_d2_t(), M_OPL_my_return_code_t() ) +#define M_OPL_my_t() TUPLE_OPLIST(my, M_BASIC_OPLIST, M_BASIC_OPLIST, M_BASIC_OPLIST, STRING_OPLIST, M_OPL_a2_t(), M_OPL_v2_t(), M_OPL_l2_t(), M_OPL_d2_t(), M_OPL_my_return_code_t() ) TUPLE_DEF2(my2, (activated, bool), diff --git a/tests/test-mshared.c b/tests/test-mshared.c index c4ea127c..06d397ec 100644 --- a/tests/test-mshared.c +++ b/tests/test-mshared.c @@ -35,7 +35,7 @@ SHARED_PTR_DEF(shared_mpz, testobj_t, TESTOBJ_OPLIST) SHARED_PTR_RELAXED_DEF(shared_relaxed_int, int) SHARED_PTR_DEF_AS(SharedDouble, SharedDouble, double) -SHARED_PTR_RELAXED_DEF_AS(SharedDouble2, SharedDouble2, double, M_DEFAULT_OPLIST) +SHARED_PTR_RELAXED_DEF_AS(SharedDouble2, SharedDouble2, double, M_BASIC_OPLIST) SHARED_RESOURCE_DEF_AS(SharedRessource, SharedRessource, SharedRessourceIt, double) static int f(const shared_int_t p) diff --git a/tests/test-mtuple.c b/tests/test-mtuple.c index a1044e91..edb8afb5 100644 --- a/tests/test-mtuple.c +++ b/tests/test-mtuple.c @@ -71,7 +71,7 @@ TUPLE_DEF2(rtuple, #define M_OPL_rtuple_t() TUPLE_OPLIST(rtuple, M_OPL_pair_str_t(), STRING_OPLIST) TUPLE_DEF2(rtuple2, (name, string_t), (value, int)) -#define M_OPL_rtuple2_t() TUPLE_OPLIST(rtuple2, STRING_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_rtuple2_t() TUPLE_OPLIST(rtuple2, STRING_OPLIST, M_BASIC_OPLIST) /* Chain of tuple on top of tuple to check if it works */ TUPLE_DEF2(rtuple3, (name, string_t), (ituple2, rtuple2_t), (ituple, rtuple_t) ) @@ -82,7 +82,7 @@ TUPLE_DEF2(rtuple4, (value, rtuple3_t) ) #define M_OPL_rtuple4_t() TUPLE_OPLIST(rtuple4, M_OPL_rtuple4_t() ) TUPLE_DEF2_AS(vector, Vector, (x, double), (y, double), (z, double) ) -#define M_OPL_Vector() TUPLE_OPLIST(vector, M_DEFAULT_OPLIST ) +#define M_OPL_Vector() TUPLE_OPLIST(vector, M_BASIC_OPLIST ) TUPLE_DEF2(rtuple5, (x, int, M_OPL_int()), (priority, int, M_OPEXTEND( M_OPL_int(), CMP(0), HASH(0), EQUAL(0) ) ) ) @@ -121,7 +121,7 @@ static void check_reset(void) assert(string_equal_str_p (r->name, "")); } - M_LET( (r, ("Hello"), 4), TUPLE_OPLIST(pair2_str, STRING_OPLIST, M_DEFAULT_OPLIST) ) { + M_LET( (r, ("Hello"), 4), TUPLE_OPLIST(pair2_str, STRING_OPLIST, M_BASIC_OPLIST) ) { assert(string_equal_str_p (r->str, "Hello")); assert(r->value == 4); pair2_str_reset(r); @@ -129,8 +129,8 @@ static void check_reset(void) } M_LET( (s, ("Goldy") ), STRING_OPLIST) - M_LET( (r, s, 46), TUPLE_OPLIST(pair2_str, STRING_OPLIST, M_DEFAULT_OPLIST) ) - M_LET( (q, r), TUPLE_OPLIST(pair2_str, STRING_OPLIST, M_DEFAULT_OPLIST) ) { + M_LET( (r, s, 46), TUPLE_OPLIST(pair2_str, STRING_OPLIST, M_BASIC_OPLIST) ) + M_LET( (q, r), TUPLE_OPLIST(pair2_str, STRING_OPLIST, M_BASIC_OPLIST) ) { assert(string_equal_str_p (q->str, "Goldy")); assert(q->value == 46); pair2_str_reset(q); diff --git a/tests/test-mvariant.c b/tests/test-mvariant.c index 67c253f4..2ec90b51 100644 --- a/tests/test-mvariant.c +++ b/tests/test-mvariant.c @@ -29,13 +29,13 @@ #include "coverage.h" START_COVERAGE VARIANT_DEF2(pair, - (key, int, M_DEFAULT_OPLIST), - (value, float, M_DEFAULT_OPLIST) ) + (key, int, M_BASIC_OPLIST), + (value, float, M_BASIC_OPLIST) ) END_COVERAGE VARIANT_DEF2(flux, (z, int), - (f, float, M_DEFAULT_OPLIST), + (f, float, M_BASIC_OPLIST), (s, string_t) ) // Minimal oplist definition. @@ -54,12 +54,12 @@ VARIANT_DEF2(rvariant, #define M_OPL_rvariant_t() VARIANT_OPLIST(rvariant, M_OPL_pair_str_t(), STRING_OPLIST) VARIANT_DEF2(rvariant2, (name, string_t), (value, int)) -#define M_OPL_rvariant2_t() VARIANT_OPLIST(rvariant2, STRING_OPLIST, M_DEFAULT_OPLIST) +#define M_OPL_rvariant2_t() VARIANT_OPLIST(rvariant2, STRING_OPLIST, M_BASIC_OPLIST) VARIANT_DEF2(rvariant3, (name, string_t), (ivariant2, rvariant2_t), (ivariant, rvariant_t) ) VARIANT_DEF2_AS(vector, Vector, (x, double), (y, double) ) -#define M_OPL_Vector() VARIANT_OPLIST(vector, M_DEFAULT_OPLIST) +#define M_OPL_Vector() VARIANT_OPLIST(vector, M_BASIC_OPLIST) static void test_pair(void) { @@ -191,7 +191,7 @@ static void test_pair(void) VARIANT_DEF2(triple, (s, string_t, STRING_OPLIST), (z, testobj_t, (INIT(testobj_init), INIT_SET(testobj_init_set), SET(testobj_set), CLEAR(testobj_clear) )), - (i, int, M_DEFAULT_OPLIST) ) + (i, int, M_BASIC_OPLIST) ) static void test_triple(void) diff --git a/tests/tgen-mdict.c b/tests/tgen-mdict.c index 68560a60..b550569e 100644 --- a/tests/tgen-mdict.c +++ b/tests/tgen-mdict.c @@ -32,8 +32,8 @@ static inline void my_oor_set(uint64_t *k, unsigned char n) *k = ~(uint64_t)n; } DICT_OA_DEF2(dict, - uint64_t, M_OPEXTEND(M_DEFAULT_OPLIST, OOR_EQUAL(my_oor_equal_p), OOR_SET(my_oor_set M_IPTR)), - uint32_t, M_DEFAULT_OPLIST) + uint64_t, M_OPEXTEND(M_BASIC_OPLIST, OOR_EQUAL(my_oor_equal_p), OOR_SET(my_oor_set M_IPTR)), + uint32_t, M_BASIC_OPLIST) extern void set_at(dict_t d, uint64_t key, uint32_t value); void set_at(dict_t d, uint64_t key, uint32_t value)