From 3544ba830efc6d63edebdb46656a52bccd8117cf Mon Sep 17 00:00:00 2001 From: Jean-Roland Date: Fri, 20 Dec 2024 10:29:57 +0100 Subject: [PATCH] fix: windows doesn't have ssize_t --- src/collections/lru_cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/collections/lru_cache.c b/src/collections/lru_cache.c index aa0f62bd9..3a464e437 100644 --- a/src/collections/lru_cache.c +++ b/src/collections/lru_cache.c @@ -105,10 +105,10 @@ static void _z_lru_cache_update_list(_z_lru_cache_t *cache, _z_lru_cache_node_t // Sorted list function static _z_lru_cache_node_t *_z_lru_cache_search_slist(_z_lru_cache_t *cache, void *value, _z_lru_val_cmp_f compare, size_t *idx) { - ssize_t l_idx = 0; - ssize_t h_idx = (ssize_t)cache->len - 1; + int l_idx = 0; + int h_idx = (int)cache->len - 1; while (l_idx <= h_idx) { - ssize_t curr_idx = (l_idx + h_idx) / 2; + int curr_idx = (l_idx + h_idx) / 2; int res = compare(_z_lru_cache_node_value(cache->slist[curr_idx]), value); if (res == 0) { *idx = (size_t)curr_idx;