Code

utils llist: Made lookup's user-data a constant pointer.
authorSebastian Harl <sh@tokkee.org>
Wed, 2 Oct 2013 09:04:42 +0000 (11:04 +0200)
committerSebastian Harl <sh@tokkee.org>
Wed, 2 Oct 2013 09:04:42 +0000 (11:04 +0200)
src/include/utils/llist.h
src/utils/llist.c

index af8285f6a3367fdc026f81bf0387243ff143c20f..104c9e45ab94c2e08a8aca2feb5e84ba57a2e1db 100644 (file)
@@ -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:
index 3f54786074941d368bc88da4ca475b8cd2559e7c..0d61769b26b8daea103c73e6bb3d8d31e1886be3 100644 (file)
@@ -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;