lib: const a couple linklist apis

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
Quentin Young 2019-05-22 16:27:16 +00:00
parent 692f6582cc
commit 396cd6366d
2 changed files with 4 additions and 4 deletions

View File

@ -246,7 +246,7 @@ void listnode_move_to_tail(struct list *l, struct listnode *n)
LISTNODE_ATTACH(l, n); LISTNODE_ATTACH(l, n);
} }
void listnode_delete(struct list *list, void *val) void listnode_delete(struct list *list, const void *val)
{ {
struct listnode *node = listnode_lookup(list, val); struct listnode *node = listnode_lookup(list, val);
@ -307,7 +307,7 @@ void list_delete(struct list **list)
*list = NULL; *list = NULL;
} }
struct listnode *listnode_lookup(struct list *list, void *data) struct listnode *listnode_lookup(struct list *list, const void *data)
{ {
struct listnode *node; struct listnode *node;

View File

@ -180,7 +180,7 @@ extern void listnode_move_to_tail(struct list *list, struct listnode *node);
* data * data
* data to insert into list * data to insert into list
*/ */
extern void listnode_delete(struct list *list, void *data); extern void listnode_delete(struct list *list, const void *data);
/* /*
* Find the listnode corresponding to an element in a list. * Find the listnode corresponding to an element in a list.
@ -194,7 +194,7 @@ extern void listnode_delete(struct list *list, void *data);
* Returns: * Returns:
* pointer to listnode storing the given data if found, NULL otherwise * pointer to listnode storing the given data if found, NULL otherwise
*/ */
extern struct listnode *listnode_lookup(struct list *list, void *data); extern struct listnode *listnode_lookup(struct list *list, const void *data);
/* /*
* Retrieve the element at the head of a list. * Retrieve the element at the head of a list.