fix a const-related compilation failure in sort.c