Commit 3b7ce8b5 authored by François Grisez's avatar François Grisez

bctbx_list_find(): declare the element to search as const void *

parent 91f4645f
......@@ -62,7 +62,7 @@ BCTBX_PUBLIC bctbx_list_t * bctbx_list_unlink(bctbx_list_t * list, bctbx_list_t
* Delete the element pointed by 'elem' from the list.
**/
BCTBX_PUBLIC bctbx_list_t * bctbx_list_erase_link(bctbx_list_t * list, bctbx_list_t * elem);
BCTBX_PUBLIC bctbx_list_t * bctbx_list_find(bctbx_list_t * list, void *data);
BCTBX_PUBLIC bctbx_list_t * bctbx_list_find(bctbx_list_t *list, const void *data);
BCTBX_PUBLIC bctbx_list_t * bctbx_list_free(bctbx_list_t *list);
/*frees list elements and associated data, using the supplied function pointer*/
BCTBX_PUBLIC bctbx_list_t * bctbx_list_free_with_data(bctbx_list_t *list, bctbx_list_free_func freefunc);
......
......@@ -212,7 +212,7 @@ bctbx_list_t * bctbx_list_erase_link(bctbx_list_t* list, bctbx_list_t* elem){
return ret;
}
bctbx_list_t* bctbx_list_find(bctbx_list_t* list, void *data){
bctbx_list_t* bctbx_list_find(bctbx_list_t* list, const void *data){
for(;list!=NULL;list=list->next){
if (list->data==data) return list;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment