Merge branch 'rs/mergesort'
Bitop fix for platforms whose "long" is 32-bit. * rs/mergesort: mergesort: avoid left shift overflow
This commit is contained in:
commit
fc0e3e02c9
@ -63,7 +63,7 @@ void *llist_mergesort(void *list,
|
||||
void *next = get_next_fn(list);
|
||||
if (next)
|
||||
set_next_fn(list, NULL);
|
||||
for (i = 0; n & (1 << i); i++)
|
||||
for (i = 0; n & ((size_t)1 << i); i++)
|
||||
list = llist_merge(ranks[i], list, get_next_fn,
|
||||
set_next_fn, compare_fn);
|
||||
n++;
|
||||
|
Loading…
Reference in New Issue
Block a user