Skip to content

Commit

Permalink
fix: windows doesn't have ssize_t
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland committed Dec 20, 2024
1 parent b5cac05 commit 3544ba8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/collections/lru_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3544ba8

Please sign in to comment.