From: Sebastian Harl Date: Wed, 2 Oct 2013 09:04:42 +0000 (+0200) Subject: utils llist: Made lookup's user-data a constant pointer. X-Git-Tag: sysdb-0.1.0~336^2~65 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ed06d81139bc1a55f64793dea85dd59a58736ad8;p=sysdb.git utils llist: Made lookup's user-data a constant pointer. --- diff --git a/src/include/utils/llist.h b/src/include/utils/llist.h index af8285f..104c9e4 100644 --- a/src/include/utils/llist.h +++ b/src/include/utils/llist.h @@ -41,7 +41,7 @@ struct sdb_llist_iter; typedef struct sdb_llist_iter sdb_llist_iter_t; typedef int (*sdb_llist_cmp_cb)(const sdb_object_t *, const sdb_object_t *); -typedef int (*sdb_llist_lookup_cb)(const sdb_object_t *, void *user_data); +typedef int (*sdb_llist_lookup_cb)(const sdb_object_t *, const void *user_data); /* * sdb_llist_create, sdb_llist_destroy: @@ -131,7 +131,7 @@ sdb_llist_insert_sorted(sdb_llist_t *list, */ sdb_object_t * sdb_llist_search(sdb_llist_t *list, - sdb_llist_lookup_cb lookup, void *user_data); + sdb_llist_lookup_cb lookup, const void *user_data); /* * sdb_llist_search_by_name: @@ -158,7 +158,7 @@ sdb_llist_search_by_name(sdb_llist_t *list, const char *key); */ sdb_object_t * sdb_llist_remove(sdb_llist_t *list, - sdb_llist_lookup_cb lookup, void *user_data); + sdb_llist_lookup_cb lookup, const void *user_data); /* * sdb_llist_shift: diff --git a/src/utils/llist.c b/src/utils/llist.c index 3f54786..0d61769 100644 --- a/src/utils/llist.c +++ b/src/utils/llist.c @@ -117,7 +117,7 @@ sdb_llist_insert_after(sdb_llist_t *list, sdb_llist_elem_t *elem, static sdb_llist_elem_t * llist_search(sdb_llist_t *list, - sdb_llist_lookup_cb lookup, void *user_data) + sdb_llist_lookup_cb lookup, const void *user_data) { sdb_llist_elem_t *elem; @@ -307,7 +307,7 @@ sdb_llist_insert_sorted(sdb_llist_t *list, sdb_object_t * sdb_llist_search(sdb_llist_t *list, - sdb_llist_lookup_cb lookup, void *user_data) + sdb_llist_lookup_cb lookup, const void *user_data) { sdb_llist_elem_t *elem; @@ -343,7 +343,7 @@ sdb_llist_search_by_name(sdb_llist_t *list, const char *key) sdb_object_t * sdb_llist_remove(sdb_llist_t *list, - sdb_llist_lookup_cb lookup, void *user_data) + sdb_llist_lookup_cb lookup, const void *user_data) { sdb_llist_elem_t *elem; sdb_object_t *obj = NULL;