Update comments
This commit is contained in:
1 parent
3f0e8956b8
commit
93229c61f2
3 files changed
+13
-6
No files matched your search
@@ -28,7 +28,7 @@
|
|||||||
#include "m-core.h"
|
#include "m-core.h"
|
||||||
|
|
||||||
/* Define different kind of basic algorithms named 'name' over the container
|
/* Define different kind of basic algorithms named 'name' over the container
|
||||||
which oplist is 'contOp', as static inline functions.
|
which oplist is 'cont_oplist', as static inline functions.
|
||||||
USAGE:
|
USAGE:
|
||||||
ALGO_DEF(algogName, containerOplist|type if oplist has been registered) */
|
ALGO_DEF(algogName, containerOplist|type if oplist has been registered) */
|
||||||
#define M_ALGO_DEF(name, cont_oplist) \
|
#define M_ALGO_DEF(name, cont_oplist) \
|
||||||
@@ -45,8 +45,9 @@
|
|||||||
(M_ALG0_FOR_EACH, M_ALG0_FOR_EACH_ARG) \
|
(M_ALG0_FOR_EACH, M_ALG0_FOR_EACH_ARG) \
|
||||||
(container, M_GLOBAL_OPLIST(cont_oplist), __VA_ARGS__)
|
(container, M_GLOBAL_OPLIST(cont_oplist), __VA_ARGS__)
|
||||||
|
|
||||||
|
|
||||||
/* Map a function (or a macro) to all elements of a container
|
/* Map a function (or a macro) to all elements of a container
|
||||||
into another container.
|
and store it into another container.
|
||||||
USAGE:
|
USAGE:
|
||||||
ALGO_TRANSFORM(contDst, contDOplist|type_if_registered_oplist, contSrc, contSrcOplist|type_if_registered_oplist,
|
ALGO_TRANSFORM(contDst, contDOplist|type_if_registered_oplist, contSrc, contSrcOplist|type_if_registered_oplist,
|
||||||
function[, extra arguments of function]) */
|
function[, extra arguments of function]) */
|
||||||
@@ -55,6 +56,7 @@
|
|||||||
(M_ALG0_TRANSFORM, M_ALG0_TRANSFORM_ARG) \
|
(M_ALG0_TRANSFORM, M_ALG0_TRANSFORM_ARG) \
|
||||||
(contD, M_GLOBAL_OPLIST(contDop), contS, M_GLOBAL_OPLIST(contSop), __VA_ARGS__)
|
(contD, M_GLOBAL_OPLIST(contDop), contS, M_GLOBAL_OPLIST(contSop), __VA_ARGS__)
|
||||||
|
|
||||||
|
|
||||||
/* Extract a subset of a container to copy into another container.
|
/* Extract a subset of a container to copy into another container.
|
||||||
USAGE:
|
USAGE:
|
||||||
ALGO_EXTRACT(contDst, contDstOplist|type_if_registered_oplist, contSrc, contSrcOplist|type_if_registered_oplist
|
ALGO_EXTRACT(contDst, contDstOplist|type_if_registered_oplist, contSrc, contSrcOplist|type_if_registered_oplist
|
||||||
@@ -65,6 +67,7 @@
|
|||||||
M_IF_NARGS_EQ2(__VA_ARGS__)(M_ALG0_EXTRACT_FUNC, M_ALG0_EXTRACT_ARG)) \
|
M_IF_NARGS_EQ2(__VA_ARGS__)(M_ALG0_EXTRACT_FUNC, M_ALG0_EXTRACT_ARG)) \
|
||||||
(contD, contDop, contS, __VA_ARGS__)
|
(contD, contDop, contS, __VA_ARGS__)
|
||||||
|
|
||||||
|
|
||||||
/* Perform a Reduce operation over a container.
|
/* Perform a Reduce operation over a container.
|
||||||
USAGE:
|
USAGE:
|
||||||
ALGO_REDUCE(dstVar, container, contOplist|type_if_registered_oplist, reduceFunc
|
ALGO_REDUCE(dstVar, container, contOplist|type_if_registered_oplist, reduceFunc
|
||||||
|
|||||||
+2
-2
@@ -64,7 +64,7 @@ typedef uint64_t m_b1tset_limb_ct;
|
|||||||
typedef struct m_bitset_s {
|
typedef struct m_bitset_s {
|
||||||
size_t size; // Size is the number of bits
|
size_t size; // Size is the number of bits
|
||||||
size_t alloc; // Alloc is the number of allocated limbs
|
size_t alloc; // Alloc is the number of allocated limbs
|
||||||
m_b1tset_limb_ct *ptr; // Pointer to the allocated limbs
|
m_b1tset_limb_ct *ptr; // Pointer to the allocated limbs
|
||||||
} m_bitset_t[1];
|
} m_bitset_t[1];
|
||||||
|
|
||||||
/* Pointer to a m_bitset_t */
|
/* Pointer to a m_bitset_t */
|
||||||
@@ -77,7 +77,7 @@ typedef const struct m_bitset_s *m_bitset_srcptr;
|
|||||||
typedef struct m_bitset_it_s {
|
typedef struct m_bitset_it_s {
|
||||||
size_t index; // index to the array of bit
|
size_t index; // index to the array of bit
|
||||||
bool value; // value used for _ref & _cref to store the value
|
bool value; // value used for _ref & _cref to store the value
|
||||||
struct m_bitset_s *set; // the associated bitset
|
struct m_bitset_s *set; // the associated bitset
|
||||||
} m_bitset_it_t[1];
|
} m_bitset_it_t[1];
|
||||||
|
|
||||||
/* Initialize a bitset (CONSTRUCTOR) */
|
/* Initialize a bitset (CONSTRUCTOR) */
|
||||||
|
|||||||
@@ -4444,7 +4444,7 @@ m_core_parse2_enum (const char str[], const char **endptr)
|
|||||||
M_EMPLACE_ASS_ARRAY_DEF_EXPAND_KEY(name, name_t, function_name, key_oplist, val_oplist, macro_both, macro_key, macro_val, key_emp_type, val_emp_type) \
|
M_EMPLACE_ASS_ARRAY_DEF_EXPAND_KEY(name, name_t, function_name, key_oplist, val_oplist, macro_both, macro_key, macro_val, key_emp_type, val_emp_type) \
|
||||||
M_EMPLACE_ASS_ARRAY_DEF_EXPAND_VAL(name, name_t, function_name, key_oplist, val_oplist, macro_both, macro_key, macro_val, key_emp_type, val_emp_type) \
|
M_EMPLACE_ASS_ARRAY_DEF_EXPAND_VAL(name, name_t, function_name, key_oplist, val_oplist, macro_both, macro_key, macro_val, key_emp_type, val_emp_type) \
|
||||||
M_EMPLACE_ASS_ARRAY_DEF_EXPAND_BOTH_B(name, name_t, function_name, key_oplist, val_oplist, macro_both, macro_key, macro_val, M_EMPLACE_ASS_ARRAY_DEF_EXPAND_BOTH_EMP_TYPE(key_emp_type), M_EMPLACE_ASS_ARRAY_DEF_EXPAND_BOTH_EMP_TYPE(val_emp_type) )
|
M_EMPLACE_ASS_ARRAY_DEF_EXPAND_BOTH_B(name, name_t, function_name, key_oplist, val_oplist, macro_both, macro_key, macro_val, M_EMPLACE_ASS_ARRAY_DEF_EXPAND_BOTH_EMP_TYPE(key_emp_type), M_EMPLACE_ASS_ARRAY_DEF_EXPAND_BOTH_EMP_TYPE(val_emp_type) )
|
||||||
/* Transform all forms to the generic LIST form */
|
/* Transform all supported user forms to the generic LIST form */
|
||||||
#define M_EMPLACE_ASS_ARRAY_DEF_EXPAND_BOTH_EMP_TYPE(val_emp) \
|
#define M_EMPLACE_ASS_ARRAY_DEF_EXPAND_BOTH_EMP_TYPE(val_emp) \
|
||||||
M_IF(M_PARENTHESIS_P(val_emp))(M_EMPLACE_ASS_ARRAY_DEF_EXPAND_BOTH_EMP_TYPE_PARENTHESIS, M_EMPLACE_ASS_ARRAY_DEF_EXPAND_BOTH_EMP_TYPE_B)(val_emp)
|
M_IF(M_PARENTHESIS_P(val_emp))(M_EMPLACE_ASS_ARRAY_DEF_EXPAND_BOTH_EMP_TYPE_PARENTHESIS, M_EMPLACE_ASS_ARRAY_DEF_EXPAND_BOTH_EMP_TYPE_B)(val_emp)
|
||||||
#define M_EMPLACE_ASS_ARRAY_DEF_EXPAND_BOTH_EMP_TYPE_B(val_emp) \
|
#define M_EMPLACE_ASS_ARRAY_DEF_EXPAND_BOTH_EMP_TYPE_B(val_emp) \
|
||||||
@@ -4516,7 +4516,11 @@ m_core_parse2_enum (const char str[], const char **endptr)
|
|||||||
M_EMPLACE_CALL_FUNC(aval, val_init_func, val_oplist, *val, val_emplace_type); \
|
M_EMPLACE_CALL_FUNC(aval, val_init_func, val_oplist, *val, val_emplace_type); \
|
||||||
} \
|
} \
|
||||||
|
|
||||||
/* Generic emplace for a queue like container */
|
/* Definition of the emplace_back function for queue.
|
||||||
|
It is defined here so that this definition is shared accross different
|
||||||
|
kind of kind of queue.
|
||||||
|
This definition is far from being efficient but works for the current interface.
|
||||||
|
*/
|
||||||
#define M_EMPLACE_QUEUE_GENE(name, name_t, function_name, oplist, init_func, exp_emplace_type) \
|
#define M_EMPLACE_QUEUE_GENE(name, name_t, function_name, oplist, init_func, exp_emplace_type) \
|
||||||
static inline void \
|
static inline void \
|
||||||
function_name(name_t v \
|
function_name(name_t v \
|
||||||
|
|||||||
Reference in new issue
Block a user