* Add control than the type and the oplist are compatible

This commit is contained in:
Patrick Pelissier committed 2020-05-17 10:27:30 +02:00
1 parent 9c58e73c37
commit d1ae26f0fd
13 files changed
+38

No files matched your search

+3
View File
@@ -128,6 +128,9 @@
#define ALGOI_DEF_P4(name, container_t, cont_oplist, type_t, type_oplist, it_t) \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, container_t, cont_oplist) \
M_CHECK_COMPATIBLE_OPLIST(name, 2, type_t, type_oplist) \
\
ALGOI_CALLBACK_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t) \
M_IF_FUNCOBJ(ALGOI_FUNCOBJ_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t)) \
\
+2
View File
@@ -162,6 +162,8 @@
const struct M_C(name, _s) *array; /* Reference of the array */ \
} it_t[1]; \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
\
static inline void \
M_C(name, _init)(array_t v) \
{ \
+3
View File
@@ -318,6 +318,9 @@
int idx; \
} it_t[1]; \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, key_t, key_oplist) \
M_CHECK_COMPATIBLE_OPLIST(name, 2, value_t, value_oplist) \
\
/* TODO: Can be optimized to alloc for leaf or for node */ \
static inline node_t M_C(name, _new_node)(void) \
{ \
+2
View File
@@ -137,6 +137,8 @@ typedef enum {
typedef union { M_C(name, _srcptr) cptr; M_C(name, _ptr) ptr; } M_C(name, _uptr); \
typedef type M_C(name, _type_t); \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
\
static inline void \
M_C(name, _init)(buffer_t v, size_t size) \
{ \
+2
View File
@@ -151,6 +151,8 @@
\
typedef type M_C(name, _type_t); \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
\
/* Define the lock strategy (global & shared lock) */ \
static inline void \
M_C(name, _internal_init)(concurrent_t out) \
+2
View File
@@ -139,6 +139,8 @@
\
typedef type M_C(name, _type_t); \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
\
static inline M_C(name, _node_t)* \
M_C(name, _int_new_node)(deque_t d) \
{ \
+6
View File
@@ -250,6 +250,9 @@
typedef key_type M_C(name, _key_type_t); \
typedef value_type M_C(name, _value_type_t); \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, key_type, key_oplist) \
M_CHECK_COMPATIBLE_OPLIST(name, 2, value_type, value_oplist) \
\
typedef struct M_C(name, _it_s) { \
M_C(name, _array_list_pair_it_t) array_it; \
M_C(name, _list_pair_it_t) list_it; \
@@ -1187,6 +1190,9 @@ typedef enum {
size_t index; \
} dict_it_t[1]; \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, key_type, key_oplist) \
M_CHECK_COMPATIBLE_OPLIST(name, 2, value_type, value_oplist) \
\
static inline void \
M_C(name,_int_limit)(dict_t dict, size_t size) \
{ \
+2
View File
@@ -161,6 +161,8 @@ typedef struct ilist_head_s {
struct ilist_head_s *next; \
} it_t[1]; \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
\
static inline void M_C(name, _init)(list_t list) \
{ \
assert (list != NULL); \
+4
View File
@@ -172,6 +172,8 @@
struct M_C(name, _s) *current; \
} it_t[1]; \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
\
LISTI_MEMPOOL_DEF(name, type, oplist, list_t, it_t) \
LISTI_DEF_P4(name, type, oplist, list_t, it_t) \
LISTI_ITBASE_DEF(name, type, oplist, list_t, it_t)
@@ -871,6 +873,8 @@
struct M_C(name, _s) *current; \
} it_t[1]; \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
\
LISTI_MEMPOOL_DEF(name, type, oplist, list_t, it_t) \
LISTI_DUAL_PUSH_DEF_P4(name, type, oplist, list_t, it_t) \
LISTI_ITBASE_DEF(name, type, oplist, list_t, it_t)
+2
View File
@@ -114,6 +114,8 @@
\
typedef M_C(name, _array_it_t) it_t; \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
\
static inline void \
M_C(name, _init)(prioqueue_t p) \
{ \
+2
View File
@@ -204,6 +204,8 @@ typedef enum {
M_CALL_DEL(oplist, ptr); \
} ) \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
\
RBTREEI_DEF_P4(name, type, oplist, tree_t, node_t, it_t)
#define RBTREEI_DEF_P4(name, type, oplist, tree_t, node_t, it_t) \
+2
View File
@@ -143,6 +143,8 @@ static inline int sharedi_integer_cref(int *p) { return *p; }
struct M_C(name, _s) ptr; \
} M_C(name, combine_t)[1]; \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
\
static inline void \
M_C(name, _init)(M_C(name, _t) shared) \
{ \
+6
View File
@@ -152,6 +152,8 @@
\
typedef type M_C(name, _type_t); \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
\
static inline void M_C(name, _init)(M_C(name, _t) snap) \
{ \
assert(snap != NULL); \
@@ -532,6 +534,8 @@ static inline void snapshot_mrsw_int_read_end(snapshot_mrsw_int_t s, unsigned in
\
typedef type M_C(name, _type_t); \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
\
static inline void M_C(name, _init)(M_C(name, _t) snap, size_t nReader) \
{ \
assert (snap != NULL); \
@@ -624,6 +628,8 @@ static inline void snapshot_mrsw_int_read_end(snapshot_mrsw_int_t s, unsigned in
\
typedef type M_C(name, _type_t); \
\
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
\
static inline void M_C(name, _init)(M_C(name, _t) snap, size_t nReader, size_t nWriter) \
{ \
M_C(name, _mrsw_init)(snap->core, nReader + nWriter -1 ); \