[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/release-0.3.4] Mark smartlist_bsearch as taking a const list.
commit dac7d929185e5f2643a29fc046ee439a826239eb
Author: Mike Perry <mikeperry-git@xxxxxxxxxxxxxx>
Date: Sat Aug 25 00:26:42 2018 +0000
Mark smartlist_bsearch as taking a const list.
It does not modify the actual list.
---
src/common/container.c | 2 +-
src/common/container.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/container.c b/src/common/container.c
index 5386e6458..72ad3a925 100644
--- a/src/common/container.c
+++ b/src/common/container.c
@@ -628,7 +628,7 @@ smartlist_uniq(smartlist_t *sl,
* less than member, and greater than 0 if key is greater then member.
*/
void *
-smartlist_bsearch(smartlist_t *sl, const void *key,
+smartlist_bsearch(const smartlist_t *sl, const void *key,
int (*compare)(const void *key, const void **member))
{
int found, idx;
diff --git a/src/common/container.h b/src/common/container.h
index 5d2dce541..7457c1e91 100644
--- a/src/common/container.h
+++ b/src/common/container.h
@@ -120,7 +120,7 @@ const uint8_t *smartlist_get_most_frequent_digest256(smartlist_t *sl);
void smartlist_uniq_strings(smartlist_t *sl);
void smartlist_uniq_digests(smartlist_t *sl);
void smartlist_uniq_digests256(smartlist_t *sl);
-void *smartlist_bsearch(smartlist_t *sl, const void *key,
+void *smartlist_bsearch(const smartlist_t *sl, const void *key,
int (*compare)(const void *key, const void **member));
int smartlist_bsearch_idx(const smartlist_t *sl, const void *key,
int (*compare)(const void *key, const void **member),
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits