ffmpeg-6: fix COMPONENT_REVISION
[oi-userland.git] / components / cluster / libqb / patches / skiplist.patch
blobca355d1e4b566aed963a8a8295abce1139de0ba9
1 diff --git a/lib/skiplist.c b/lib/skiplist.c
2 index a20fa23..3c13583 100644
3 --- a/lib/skiplist.c
4 +++ b/lib/skiplist.c
5 @@ -166,7 +166,7 @@ skiplist_lookup(struct skiplist *list, const char *key)
6 int8_t level = list->level;
8 while (level >= SKIPLIST_LEVEL_MIN) {
9 - struct skiplist_node *fwd_node = cur_node->forward[level];
10 + struct skiplist_node *fwd_node = cur_node->forward[(size_t)level];
12 switch (op_search(list, fwd_node, key)) {
13 case OP_FINISH:
14 @@ -376,7 +376,7 @@ skiplist_put(struct qb_map *map, const char *key, const void *value)
15 char *old_v;
17 while ((update_level = level) >= SKIPLIST_LEVEL_MIN) {
18 - struct skiplist_node *fwd_node = cur_node->forward[level];
19 + struct skiplist_node *fwd_node = cur_node->forward[(size_t)level];
21 switch (op_search(list, fwd_node, key)) {
22 case OP_FINISH:
23 @@ -396,14 +396,14 @@ skiplist_put(struct qb_map *map, const char *key, const void *value)
24 level--;
27 - update[update_level] = cur_node;
28 + update[(size_t)update_level] = cur_node;
31 new_node_level = skiplist_level_generate();
33 if (new_node_level > list->level) {
34 for (level = list->level + 1; level <= new_node_level; level++)
35 - update[level] = list->header;
36 + update[(size_t)level] = list->header;
38 list->level = new_node_level;
40 @@ -417,8 +417,8 @@ skiplist_put(struct qb_map *map, const char *key, const void *value)
42 /* Drop @new_node into @list. */
43 for (level = SKIPLIST_LEVEL_MIN; level <= new_node_level; level++) {
44 - new_node->forward[level] = update[level]->forward[level];
45 - update[level]->forward[level] = new_node;
46 + new_node->forward[(size_t)level] = update[(size_t)level]->forward[(size_t)level];
47 + update[(size_t)level]->forward[(size_t)level] = new_node;
50 list->length++;
51 @@ -435,7 +435,7 @@ skiplist_rm(struct qb_map *map, const char *key)
52 skiplist_update_t update;
54 while ((update_level = level) >= SKIPLIST_LEVEL_MIN) {
55 - struct skiplist_node *fwd_node = cur_node->forward[level];
56 + struct skiplist_node *fwd_node = cur_node->forward[(size_t)level];
58 switch (op_search(list, fwd_node, key)) {
59 case OP_GOTO_NEXT_NODE:
60 @@ -447,7 +447,7 @@ skiplist_rm(struct qb_map *map, const char *key)
61 break;
64 - update[update_level] = cur_node;
65 + update[(size_t)update_level] = cur_node;
68 /* The immediate forward node should be the matching node... */
69 @@ -460,9 +460,9 @@ skiplist_rm(struct qb_map *map, const char *key)
71 /* Splice found_node out of list. */
72 for (level = SKIPLIST_LEVEL_MIN; level <= list->level; level++)
73 - if (update[level]->forward[level] == found_node)
74 - update[level]->forward[level] =
75 - found_node->forward[level];
76 + if (update[(size_t)level]->forward[(size_t)level] == found_node)
77 + update[(size_t)level]->forward[(size_t)level] =
78 + found_node->forward[(size_t)level];
80 skiplist_node_deref(found_node, list);
82 @@ -471,7 +471,7 @@ skiplist_rm(struct qb_map *map, const char *key)
83 * highest level.
85 for (level = list->level; level >= SKIPLIST_LEVEL_MIN; level--) {
86 - if (list->header->forward[level])
87 + if (list->header->forward[(size_t)level])
88 break;
90 list->level--;