API breakage:
Rename _pop method into _pop_at method as the provided function is a _pop_at method, not a _pop method. Remove _pop from the oplist as it doesn't follow _pop convention.
This commit is contained in:
1 parent
2167931e3f
commit
5915208dee
3 files changed
+6
-6
No files matched your search
+2
-1
@@ -6,4 +6,5 @@ V0.1.*: * First formal version of API
|
||||
V0.2.*: * worker_sync takes a 'worker_t' as an additional parameter
|
||||
(This allows to perform a wait-on-event instead of a busy waiting).
|
||||
* worker_init takes an int as numWorker instead of an unsingned int.
|
||||
|
||||
* RBTREE pop method has been renamed into _pop_at
|
||||
|
||||
+1
-2
@@ -72,7 +72,6 @@
|
||||
IT_CREF(M_C(name,_cref)), \
|
||||
CLEAN(M_C(name,_clean)), \
|
||||
PUSH(M_C(name,_push)), \
|
||||
POP(M_C(name,_pop)) \
|
||||
GET_MIN(M_C(name,_min)), \
|
||||
GET_MAX(M_C(name,_max)), \
|
||||
M_IF_METHOD(GET_STR, oplist)(GET_STR(M_C(name, _get_str)),), \
|
||||
@@ -685,7 +684,7 @@ typedef enum {
|
||||
) \
|
||||
\
|
||||
static inline bool \
|
||||
M_C(name, _pop)(type *data_ptr, tree_t tree, type const key) \
|
||||
M_C(name, _pop_at)(type *data_ptr, tree_t tree, type const key) \
|
||||
{ \
|
||||
RBTREEI_CONTRACT (tree); \
|
||||
node_t *tab[RBTREEI_MAX_STACK]; \
|
||||
|
||||
@@ -135,16 +135,16 @@ static void test_uint(void)
|
||||
assert (*cptr == num/2);
|
||||
rbtree_uint_clear(tree);
|
||||
|
||||
bool b = rbtree_uint_pop(NULL, tree2, num+1);
|
||||
bool b = rbtree_uint_pop_at(NULL, tree2, num+1);
|
||||
assert (b == false);
|
||||
for(unsigned int i = 0; i < num; i+=3) {
|
||||
b = rbtree_uint_pop(NULL, tree2, i);
|
||||
b = rbtree_uint_pop_at(NULL, tree2, i);
|
||||
assert(b);
|
||||
ptr = rbtree_uint_get(tree2, i);
|
||||
assert (ptr == NULL);
|
||||
}
|
||||
for(unsigned int i = 1; i < num; i+=3) {
|
||||
b = rbtree_uint_pop(NULL, tree2, i);
|
||||
b = rbtree_uint_pop_at(NULL, tree2, i);
|
||||
assert(b);
|
||||
ptr = rbtree_uint_get(tree2, i);
|
||||
assert (ptr == NULL);
|
||||
|
||||
Reference in new issue
Block a user