summaryrefslogtreecommitdiffstats
path: root/zix
diff options
context:
space:
mode:
Diffstat (limited to 'zix')
-rw-r--r--zix/sorted_array.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/zix/sorted_array.c b/zix/sorted_array.c
index b2096b2..0f08e89 100644
--- a/zix/sorted_array.c
+++ b/zix/sorted_array.c
@@ -148,12 +148,12 @@ zix_sorted_array_find(const ZixSortedArray* a,
const void* e,
ZixSortedArrayIter* ai)
{
- uintptr_t lower = 0;
- uintptr_t upper = (uintptr_t)a->num_elems - 1;
+ intptr_t lower = 0;
+ intptr_t upper = a->num_elems - 1;
while (upper >= lower) {
- const uintptr_t i = lower + ((upper - lower) / 2);
- void* const elem_i = zix_sorted_array_index_unchecked(a, i);
- const int cmp = a->cmp(elem_i, e, a->cmp_data);
+ const intptr_t i = lower + ((upper - lower) / 2);
+ void* const elem_i = zix_sorted_array_index_unchecked(a, i);
+ const int cmp = a->cmp(elem_i, e, a->cmp_data);
if (cmp == 0) {
*ai = elem_i;