summaryrefslogtreecommitdiffstats
path: root/lib/vector.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vector.c')
-rw-r--r--lib/vector.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/vector.c b/lib/vector.c
index 646f19a5..83f289fe 100644
--- a/lib/vector.c
+++ b/lib/vector.c
@@ -987,7 +987,8 @@ vector_bsearch(vector v, vector_bsearch_cmp* cmp, const void* p_val,
if (v->end <= 1)
{
- *result = (v->end == 0) ? -1 : cmp(&p_val, (const void**)&v->p_items[0]) ;
+ *result = (v->end == 0) ? -1 :
+ cmp(&p_val, (const void* const*)&v->p_items[0]) ;
return 0 ; /* Stop dead if 0 or 1 items */
} ;
@@ -996,12 +997,12 @@ vector_bsearch(vector v, vector_bsearch_cmp* cmp, const void* p_val,
ih = v->end - 1 ;
/* Pick off the edge cases: >= last and <= first. */
- if ((c = cmp(&p_val, (const void**)&v->p_items[ih])) >= 0)
+ if ((c = cmp(&p_val, (const void* const*)&v->p_items[ih])) >= 0)
{
*result = c ; /* 0 => found. +1 => val > last */
return ih ; /* return high index. */
} ;
- if ((c = cmp(&p_val, (const void**)&v->p_items[il])) <= 0)
+ if ((c = cmp(&p_val, (const void* const*)&v->p_items[il])) <= 0)
{
*result = c ; /* 0 => found. -1 => val < first */
return il ; /* return low index. */
@@ -1018,7 +1019,7 @@ vector_bsearch(vector v, vector_bsearch_cmp* cmp, const void* p_val,
return il ; /* return il: item[il] < val < item[il+1] */
} ;
/* We now know that il < iv < ih */
- c = cmp(&p_val, (const void**)&v->p_items[iv]) ;
+ c = cmp(&p_val, (const void* const*)&v->p_items[iv]) ;
if (c == 0)
{
*result = 0 ;