From: Pavel Pisa Date: Sun, 19 Feb 2012 16:09:02 +0000 (+0100) Subject: uLUt: Get rid of compiler warnings in custom GAVL delete functions. X-Git-Tag: ul_drv-1.0.0-release~12 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/ulut.git/commitdiff_plain/2ad0da3c8e0dfe99e0737b08993dcf24899f827a uLUt: Get rid of compiler warnings in custom GAVL delete functions. 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 --- diff --git a/ulut/ul_gavlcust.h b/ulut/ul_gavlcust.h index 2a46a6c..7761454 100644 --- a/ulut/ul_gavlcust.h +++ b/ulut/ul_gavlcust.h @@ -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)\ diff --git a/ulut/ul_gavlrepcust.h b/ulut/ul_gavlrepcust.h index 158da3d..f138470 100644 --- a/ulut/ul_gavlrepcust.h +++ b/ulut/ul_gavlrepcust.h @@ -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)\