Based on Michal Sojka's request but this solution is consistent
with other functions and allows to propagate errors
form gavl_delete_primitive if they would be detected
even there in future.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
\
int cust_prefix##_delete(cust_root_t *root, cust_item_t *item)\
{\
- int ret;\
gavl_node_t *n, *p;\
if(!item) return -1;\
/*if(cust_prefix##_search_node(root, &item->cust_item_key, &n))*/\
for(p=n; p->parent; p=p->parent);\
if(p!=root->cust_root_node)\
return -1;\
- ret=gavl_delete_primitive(&root->cust_root_node, n);\
- return 1;\
+ return gavl_delete_primitive(&root->cust_root_node, n);\
}\
\
gavl_node_t *cust_prefix##_first_node(const cust_root_t *root)\
\
int cust_prefix##_delete(cust_root_t *root, cust_item_t *item)\
{\
- int ret;\
gavl_node_t *n, *p;\
if(!item) return -1;\
n=&item->cust_item_node;\
for(p=n; p->parent; p=p->parent);\
if(p!=root->cust_root_node)\
return -1;\
- ret=gavl_delete_primitive(&root->cust_root_node, n);\
- return 1;\
+ return gavl_delete_primitive(&root->cust_root_node, n);\
}\
\
gavl_node_t *cust_prefix##_first_node(const cust_root_t *root)\