diff --git a/m-algo.h b/m-algo.h index 11c7939d..67d2d68c 100644 --- a/m-algo.h +++ b/m-algo.h @@ -139,7 +139,7 @@ M_IF_FUNCOBJ(ALGOI_FUNCOBJ_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t)) \ \ M_IF_METHOD(EQUAL, type_oplist)( \ - ALGOI_FIND_DEF_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t) \ + ALGOI_FIND_DEF_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t) \ , /* NO EQUAL */) \ \ ALGOI_FIND_IF_DEF_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t, if, M_C(name, _test_cb_ct), M_C(name, _eq_cb_ct), M_APPLY, M_APPLY) \ @@ -150,10 +150,10 @@ ALGOI_ALL_OF_DEF_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t, _, M_C(name, _test_cb_ct), M_APPLY) \ M_IF_FUNCOBJ(ALGOI_ALL_OF_DEF_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t, _fo_, M_C(name, _test_obj_t), M_C(name, _test_obj_call)) ) \ \ - /* If there is a IT_REF method, we consider the container as modifiable through iterator */ \ + /* If there is a IT_REF method, we consider the container as modifiable through iterator */ \ M_IF_METHOD(IT_REF, cont_oplist)( \ - ALGOI_FILL_DEF_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t) \ - ALGOI_VECTOR_DEF_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t) \ + ALGOI_FILL_DEF_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t) \ + ALGOI_VECTOR_DEF_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t) \ \ M_IF_METHOD(CMP, type_oplist)( \ ALGOI_MINMAX_DEF_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t) \ @@ -174,7 +174,7 @@ /* Define the types of the callbacks associated to the algorithms. * Types remain internal */ -#define ALGOI_CALLBACK_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t)\ +#define ALGOI_CALLBACK_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t) \ \ typedef bool (*M_C(name, _test_cb_ct))(type_t const); \ typedef bool (*M_C(name, _eq_cb_ct))(type_t const, type_t const); \ @@ -443,7 +443,7 @@ /* Compute the union of two ***sorted*** containers */ \ M_IF_METHOD(IT_INSERT, cont_oplist)( \ static inline void \ - M_C3(name,sort_name,_union)(container_t dst, const container_t src cmp_param(name)) \ + M_C3(name,sort_name,_union)(container_t dst, const container_t src cmp_param(name)) \ { \ it_t itSrc; \ it_t itDst; \ diff --git a/m-bptree.h b/m-bptree.h index bd96b0f6..4084e184 100644 --- a/m-bptree.h +++ b/m-bptree.h @@ -647,7 +647,7 @@ } \ ) \ /* Move tables to make space for insertion */ \ - memmove(&n->key[i+1], &n->key[i], sizeof(key_t)*(unsigned int)(num-i)); \ + memmove(&n->key[i+1], &n->key[i], sizeof(key_t)*(unsigned int)(num-i)); \ M_IF(isMap)(memmove(&n->kind.value[i+1], &n->kind.value[i], sizeof(value_t)*(unsigned int)(num-i));,) \ break; \ } \ @@ -670,7 +670,7 @@ for(i = 0; i < num; i++) { \ if (n->kind.node[i] == l) { \ /* Move tables to make space for insertion */ \ - memmove(&n->key[i+1], &n->key[i], sizeof(key_t)*(unsigned int)(num-i)); \ + memmove(&n->key[i+1], &n->key[i], sizeof(key_t)*(unsigned int)(num-i)); \ memmove(&n->kind.node[i+1], &n->kind.node[i], sizeof(node_t)*(unsigned int)(num-i+1)); \ break; \ } \ @@ -716,7 +716,7 @@ num = N + 1 - nnum; \ node_t nleaf = M_C(name, _new_node)(); \ /* Move half objects to the new node */ \ - memmove(&nleaf->key[0], &leaf->key[num], sizeof(key_t)*(unsigned int)nnum); \ + memmove(&nleaf->key[0], &leaf->key[num], sizeof(key_t)*(unsigned int)nnum); \ M_IF(isMap)(memmove(&nleaf->kind.value[0], &leaf->kind.value[num], sizeof(value_t)*(unsigned int)nnum);,) \ leaf->num = -num; \ nleaf->num = -nnum; \ @@ -784,7 +784,7 @@ /* found key ==> delete it */ \ M_CALL_CLEAR(key_oplist, n->key[i]); \ M_IF(isMap)(M_CALL_CLEAR(value_oplist, n->kind.value[i]);,) \ - memmove(&n->key[i], &n->key[i+1], sizeof(key_t)*(unsigned int)(num-1-i)); \ + memmove(&n->key[i], &n->key[i+1], sizeof(key_t)*(unsigned int)(num-1-i)); \ M_IF(isMap)(memmove(&n->kind.value[i], &n->kind.value[i+1], sizeof(value_t)*(unsigned int)(num-1-i));,) \ n->num -= -1; /* decrease number as num is < 0 */ \ return i; \ @@ -806,7 +806,7 @@ assert (num_right < N/2); \ \ /* Move one item from the left node to the right node */ \ - memmove(&right->key[1], &right->key[0], sizeof(key_t)*(unsigned int)num_right); \ + memmove(&right->key[1], &right->key[0], sizeof(key_t)*(unsigned int)num_right); \ if (M_C(name, _is_leaf)(left)) { \ M_IF(isMap)(memmove (&right->kind.value[1], &right->kind.value[0], sizeof(value_t)*(unsigned int)num_right);,) \ memmove (&right->key[0], &left->key[num_left-1], sizeof (key_t)); \ diff --git a/m-concurrent.h b/m-concurrent.h index ecb05130..83f602d1 100644 --- a/m-concurrent.h +++ b/m-concurrent.h @@ -91,7 +91,7 @@ #define CONCURRENTI_OPLIST_P1(arg) CONCURRENTI_OPLIST_P2 arg /* Validation of the given oplist */ -#define CONCURRENTI_OPLIST_P2(name, oplist) \ +#define CONCURRENTI_OPLIST_P2(name, oplist) \ M_IF_OPLIST(oplist)(CONCURRENTI_OPLIST_P3, CONCURRENTI_OPLIST_FAILURE)(name, oplist) /* Prepare a clean compilation failure */ diff --git a/m-core.h b/m-core.h index 7f9b6e42..2b68aedc 100644 --- a/m-core.h +++ b/m-core.h @@ -2748,7 +2748,7 @@ m_core_parse2_enum (const char str[], const char **endptr) /* Perform a preprocessing M_IF if at least one method exists in the oplist. Example: M_IF_AT_LEAST_METHOD(HASH, CMP, oplist) (define function with HASH or CMP method, ) */ -#define M_IF_AT_LEAST_METHOD(method1, method2, oplist) \ +#define M_IF_AT_LEAST_METHOD(method1, method2, oplist) \ M_IF(M_OR(M_TEST_METHOD_P(method1, oplist), M_TEST_METHOD_P(method2, oplist))) /* Perform a preprocessing M_IF if both methods exists in both oplist. diff --git a/m-dict.h b/m-dict.h index be8a41e3..4964f2f3 100644 --- a/m-dict.h +++ b/m-dict.h @@ -40,7 +40,7 @@ M_BEGIN_PROTECTED_CODE \ DICTI_DEF2_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ ((name, key_type, M_GLOBAL_OPLIST_OR_DEF(key_type)(), __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__)(),M_C(name, _t), M_C(name, _it_t), M_C(name, _itref_t) ), \ - (name, key_type, __VA_ARGS__,M_C(name, _t), M_C(name, _it_t), M_C(name, _itref_t) ))) \ + (name, key_type, __VA_ARGS__,M_C(name, _t), M_C(name, _it_t), M_C(name, _itref_t) ))) \ M_END_PROTECTED_CODE @@ -51,11 +51,11 @@ OR DICT_DEF2_AS(name, name_t, it_t, itref_t, key_type, value_type) */ -#define DICT_DEF2_AS(name, name_it, it_t, itref_t, key_type, ...) \ +#define DICT_DEF2_AS(name, name_it, it_t, itref_t, key_type, ...) \ M_BEGIN_PROTECTED_CODE \ DICTI_DEF2_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ ((name, key_type, M_GLOBAL_OPLIST_OR_DEF(key_type)(), __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__)(), name_t, it_t, itref_t ), \ - (name, key_type, __VA_ARGS__, name_t, it_t, itref_t ) )) \ + (name, key_type, __VA_ARGS__, name_t, it_t, itref_t ) )) \ M_END_PROTECTED_CODE @@ -71,7 +71,7 @@ M_BEGIN_PROTECTED_CODE \ DICTI_SHASH_DEF2_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ ((name, key_type, M_GLOBAL_OPLIST_OR_DEF(key_type)(), __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__)(),M_C(name, _t), M_C(name, _it_t), M_C(name, _itref_t) ), \ - (name, key_type, __VA_ARGS__,M_C(name, _t), M_C(name, _it_t), M_C(name, _itref_t) ))) \ + (name, key_type, __VA_ARGS__,M_C(name, _t), M_C(name, _it_t), M_C(name, _itref_t) ))) \ M_END_PROTECTED_CODE @@ -84,11 +84,11 @@ OR DICT_STOREHASH_DEF2_AS(name, name_it, it_t, itref_t, key_type[, key_oplist], value_type[, value_oplist]) */ -#define DICT_STOREHASH_DEF2_AS(name, name_it, it_t, itref_t, key_type, ...) \ +#define DICT_STOREHASH_DEF2_AS(name, name_it, it_t, itref_t, key_type, ...) \ M_BEGIN_PROTECTED_CODE \ DICTI_SHASH_DEF2_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ ((name, key_type, M_GLOBAL_OPLIST_OR_DEF(key_type)(), __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__)(), name_it, it_t, itref_t ), \ - (name, key_type, __VA_ARGS__, name_it, it_t, itref_t ))) \ + (name, key_type, __VA_ARGS__, name_it, it_t, itref_t ))) \ M_END_PROTECTED_CODE @@ -133,7 +133,7 @@ M_BEGIN_PROTECTED_CODE \ DICTI_SET_DEF_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ ((name, __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__)(),M_C(name, _t), M_C(name, _it_t), M_C(name, _itref_t)), \ - (name, __VA_ARGS__,M_C(name, _t), M_C(name, _it_t), M_C(name, _itref_t)))) \ + (name, __VA_ARGS__,M_C(name, _t), M_C(name, _it_t), M_C(name, _itref_t)))) \ M_END_PROTECTED_CODE @@ -146,7 +146,7 @@ M_BEGIN_PROTECTED_CODE \ DICTI_SET_DEF_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ ((name, __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__)(), name_it, it_t, M_C(name, _itref_ct) ), \ - (name, __VA_ARGS__, name_it, it_t, M_C(name, _itref_ct) ))) \ + (name, __VA_ARGS__, name_it, it_t, M_C(name, _itref_ct) ))) \ M_END_PROTECTED_CODE @@ -159,7 +159,7 @@ M_BEGIN_PROTECTED_CODE \ DICTI_OASET_DEF_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ ((name, __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__)(), M_C(name, _t), M_C(name, _it_t), M_C(name, _itref_t) ), \ - (name, __VA_ARGS__,M_C(name, _t), M_C(name, _it_t), M_C(name, _itref_t) ))) \ + (name, __VA_ARGS__,M_C(name, _t), M_C(name, _it_t), M_C(name, _itref_t) ))) \ M_END_PROTECTED_CODE @@ -173,7 +173,7 @@ M_BEGIN_PROTECTED_CODE \ DICTI_OASET_DEF_P1(M_IF_NARGS_EQ1(__VA_ARGS__) \ ((name, __VA_ARGS__, M_GLOBAL_OPLIST_OR_DEF(__VA_ARGS__)(), name_it, it_t, M_C(name, _itref_ct) ), \ - (name, __VA_ARGS__, name_it, it_t, M_C(name, _itref_ct) ))) \ + (name, __VA_ARGS__, name_it, it_t, M_C(name, _itref_ct) ))) \ M_END_PROTECTED_CODE @@ -271,11 +271,11 @@ #define DICTI_SET_DEF_P1(arg) DICTI_SET_DEF_P2 arg /* Validate the key oplist before going further */ -#define DICTI_SET_DEF_P2(name, key_type, key_oplist, dict_t, dict_it_t, it_deref_t) \ +#define DICTI_SET_DEF_P2(name, key_type, key_oplist, dict_t, dict_it_t, it_deref_t) \ M_IF_OPLIST(key_oplist)(DICTI_SET_DEF_P4, DICTI_SET_DEF_FAILURE)(name, key_type, key_oplist, dict_t, dict_it_t, it_deref_t) /* Stop processing with a compilation failure */ -#define DICTI_SET_DEF_FAILURE(name, key_type, key_oplist, dict_t, dict_it_t, it_deref_t) \ +#define DICTI_SET_DEF_FAILURE(name, key_type, key_oplist, dict_t, dict_it_t, it_deref_t) \ M_STATIC_FAILURE(M_LIB_NOT_AN_OPLIST, "(DICT_SET_DEF): the given argument is not a valid oplist: " M_AS_STR(key_oplist) ) #define DICTI_SET_DEF_P4(name, key_type, key_oplist, dict_t, dict_it_t, it_deref_t) \ @@ -1005,7 +1005,7 @@ /* NOTE: Despite using set_at, the accessing of the item in d1 \ is not as random as other uses of the HASH table as d2 \ uses the same order than d1 */ \ - for (M_C(name, _it)(it, d2); !M_C(name, _end_p)(it); M_C(name, _next)(it)){ \ + for (M_C(name, _it)(it, d2); !M_C(name, _end_p)(it); M_C(name, _next)(it)){ \ const it_deref_t *item = M_C(name, _cref)(it); \ M_C(name, _push)(d1, *item); \ } \ @@ -1241,14 +1241,14 @@ enum dicti_oa_element_e { #define DICTI_OASET_DEF_P1(args) DICTI_OASET_DEF_P2 args /* Validate the value oplist before going further */ -#define DICTI_OASET_DEF_P2(name, key_type, key_oplist, dict_t, dict_it_t, it_deref_t) \ +#define DICTI_OASET_DEF_P2(name, key_type, key_oplist, dict_t, dict_it_t, it_deref_t) \ M_IF_OPLIST(key_oplist)(DICTI_OASET_DEF_P4, DICTI_OASET_DEF_FAILURE)(name, key_type, key_oplist, dict_t, dict_it_t, it_deref_t) /* Stop processing with a compilation failure */ -#define DICTI_OASET_DEF_FAILURE(name, key_type, key_oplist, dict_t, dict_it_t, it_deref_t) \ +#define DICTI_OASET_DEF_FAILURE(name, key_type, key_oplist, dict_t, dict_it_t, it_deref_t) \ M_STATIC_FAILURE(M_LIB_NOT_AN_OPLIST, "(DICT_OASET_DEF): the given argument is not a valid oplist: " M_AS_STR(key_oplist) ) -#define DICTI_OASET_DEF_P4(name, key_type, key_oplist, dict_t, dict_it_t, it_deref_t) \ +#define DICTI_OASET_DEF_P4(name, key_type, key_oplist, dict_t, dict_it_t, it_deref_t) \ DICTI_OA_DEF_P5(name, key_type, key_oplist, key_type, M_EMPTY_OPLIST, 1, \ DICTI_OA_LOWER_BOUND, DICTI_OA_UPPER_BOUND, dict_t, dict_it_t, it_deref_t ) diff --git a/m-funcobj.h b/m-funcobj.h index a9ff6f23..44611db7 100644 --- a/m-funcobj.h +++ b/m-funcobj.h @@ -223,7 +223,7 @@ M_C(name, _callback)(M_C(base_name, _ct) _self \ M_IF_EMPTY(M_OPFLAT param_list)( \ /* No param */, \ - M_MAP3(FUNCOBJI_INS_ARGLIST, base_name, M_OPFLAT param_list)\ + M_MAP3(FUNCOBJI_INS_ARGLIST, base_name, M_OPFLAT param_list) \ ) \ ) \ { \ @@ -309,7 +309,7 @@ M_C(name, _callback)(M_C(base_name, _ct) _self \ M_IF_EMPTY(M_OPFLAT param_list)( \ /* No param */, \ - M_MAP3(FUNCOBJI_INS_ARGLIST, base_name, M_OPFLAT param_list)\ + M_MAP3(FUNCOBJI_INS_ARGLIST, base_name, M_OPFLAT param_list) \ ) \ ) \ { \ diff --git a/m-rbtree.h b/m-rbtree.h index effe54e3..473d2ee8 100644 --- a/m-rbtree.h +++ b/m-rbtree.h @@ -150,7 +150,7 @@ typedef enum { assert((node) != NULL); \ assert(RBTREEI_IS_BLACK(node) || RBTREEI_IS_RED(node)); \ assert(RBTREEI_IS_BLACK(node) \ - || (((node)->child[0] == NULL || RBTREEI_IS_BLACK(node->child[0])) \ + || (((node)->child[0] == NULL || RBTREEI_IS_BLACK(node->child[0])) \ && ((node)->child[1] == NULL || RBTREEI_IS_BLACK(node->child[1])))); \ } while (0) @@ -996,7 +996,7 @@ typedef enum { \ M_IF_METHOD(GET_STR, oplist)( \ static inline void M_C(name, _get_str)(string_t str, \ - tree_t const t1, bool append) { \ + tree_t const t1, bool append) { \ RBTREEI_CONTRACT(t1); \ assert(str != NULL); \ (append ? string_cat_str : string_set_str) (str, "["); \ diff --git a/m-serial-bin.h b/m-serial-bin.h index 3c551424..a691b84f 100644 --- a/m-serial-bin.h +++ b/m-serial-bin.h @@ -344,7 +344,7 @@ static inline void m_serial_bin_write_clear(m_serial_write_t serial) /* Define a synonym of m_serial_read_t to the BIN serializer with its proper OPLIST */ typedef m_serial_write_t m_serial_bin_write_t; -#define M_OPL_m_serial_bin_write_t() \ +#define M_OPL_m_serial_bin_write_t() \ (INIT_WITH(m_serial_bin_write_init), CLEAR(m_serial_bin_write_clear), TYPE(m_serial_bin_write_t) ) @@ -585,7 +585,7 @@ static inline void m_serial_bin_read_clear(m_serial_read_t serial) /* Define a synonym of m_serial_read_t to the BIN serializer with its proper OPLIST */ typedef m_serial_read_t m_serial_bin_read_t; -#define M_OPL_m_serial_bin_read_t() \ +#define M_OPL_m_serial_bin_read_t() \ (INIT_WITH(m_serial_bin_read_init), CLEAR(m_serial_bin_read_clear), TYPE(m_serial_bin_read_t) ) M_END_PROTECTED_CODE diff --git a/m-tuple.h b/m-tuple.h index 4d12f4c9..20ede370 100644 --- a/m-tuple.h +++ b/m-tuple.h @@ -665,7 +665,7 @@ namespace m_tuple { M_IF_METHOD_ALL(PARSE_STR, __VA_ARGS__)(PARSE_STR(M_C(name, _parse_str)),), \ M_IF_METHOD_ALL(IN_STR, __VA_ARGS__)(IN_STR(M_C(name, _in_str)),), \ M_IF_METHOD_ALL(OUT_STR, __VA_ARGS__)(OUT_STR(M_C(name, _out_str)),), \ - M_IF_METHOD_ALL(IN_SERIAL, __VA_ARGS__)(IN_SERIAL(M_C(name, _in_serial)),), \ + M_IF_METHOD_ALL(IN_SERIAL, __VA_ARGS__)(IN_SERIAL(M_C(name, _in_serial)),), \ M_IF_METHOD_ALL(OUT_SERIAL, __VA_ARGS__)(OUT_SERIAL(M_C(name, _out_serial)),), \ M_IF_METHOD_ALL(INIT_MOVE, __VA_ARGS__)(INIT_MOVE(M_C(name, _init_move)),), \ M_IF_METHOD_ALL(MOVE, __VA_ARGS__)(MOVE(M_C(name, _move)),), \