]> rtime.felk.cvut.cz Git - ulut.git/commitdiff
uLUt: Get rid of compiler warnings in custom GAVL delete functions.
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Sun, 19 Feb 2012 16:09:02 +0000 (17:09 +0100)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Sun, 19 Feb 2012 16:09:02 +0000 (17:09 +0100)
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>
ulut/ul_gavlcust.h
ulut/ul_gavlrepcust.h

index 2a46a6cfc2fde1b2bb9afbca4a9fe0fbfbba3b4d..7761454e3a35a0c2e112099c6b168d2af2d67cb8 100644 (file)
@@ -121,7 +121,6 @@ int cust_prefix##_delete_node(cust_root_t *root, gavl_node_t *node)\
 \
 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))*/\
@@ -130,8 +129,7 @@ int cust_prefix##_delete(cust_root_t *root, cust_item_t *item)\
   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)\
index 158da3d2201f15bf190a70c9e1108d795cec2c9c..f1384705cbf9fb28b4a63fce6066ff60f36ea462 100644 (file)
@@ -147,7 +147,6 @@ int cust_prefix##_delete_node(cust_root_t *root, gavl_node_t *node)\
 \
 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;\
@@ -155,8 +154,7 @@ int cust_prefix##_delete(cust_root_t *root, cust_item_t *item)\
   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)\