diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-03-21 22:56:03 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-03-24 07:33:13 -0400 | 
| commit | 1a4189d4a1d2170f2fc3929b4e422e9c3b75a60a (patch) | |
| tree | 62807bdcfbe5c8ee681fdeb623b5fe02aeab414e /lib/skiplist.h | |
| parent | cb9f254c01a79c15dfa21f719396ca0d02e1c4c2 (diff) | |
bgpd, isisd, lib: Make key values const for skiplist
Make some key values const for the skiplist code.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/skiplist.h')
| -rw-r--r-- | lib/skiplist.h | 13 | 
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/skiplist.h b/lib/skiplist.h index 2ab37331c9..a106a455d6 100644 --- a/lib/skiplist.h +++ b/lib/skiplist.h @@ -68,7 +68,7 @@ struct skiplist {  	 * Returns -1 if val1 < val2, 0 if equal?, 1 if val1 > val2.  	 * Used as definition of sorted for listnode_add_sort  	 */ -	int (*cmp)(void *val1, void *val2); +	int (*cmp)(const void *val1, const void *val2);  	/* callback to free user-owned data when listnode is deleted. supplying  	 * this callback is very much encouraged! @@ -81,8 +81,9 @@ struct skiplist {  extern struct skiplist *  skiplist_new(/* encouraged: set list.del callback on new lists */  	     int flags, -	     int (*cmp)(void *key1, void *key2), /* NULL => default cmp */ -	     void (*del)(void *val));		 /* NULL => no auto val free */ +	     int (*cmp)(const void *key1, +			const void *key2), /* NULL => default cmp */ +	     void (*del)(void *val));	   /* NULL => no auto val free */  extern void skiplist_free(struct skiplist *); @@ -96,12 +97,12 @@ extern int skiplist_search(register struct skiplist *l, register void *key,  			   void **valuePointer);  extern int skiplist_first_value(register struct skiplist *l, /* in */ -				register void *key,	  /* in */ -				void **valuePointer,	 /* in/out */ +				register const void *key,    /* in */ +				void **valuePointer,	     /* in/out */  				void **cursor);		     /* out */  extern int skiplist_next_value(register struct skiplist *l, /* in */ -			       register void *key,	  /* in */ +			       register const void *key,	  /* in */  			       void **valuePointer,	 /* in/out */  			       void **cursor);		    /* in/out */  | 
