Don't cast function pointers of incompatible types, this resulted in gcc 8 -Wcast-function-type warnings and could hide real errors. Use normal, taking elements by value, sort function for in wxBaseArray methods used by the sorted arrays only and provide Sort() overloads for both this sort function variant and the compatible with qsort() one taking pointers to the elements.