get rid of more UB casts of function pointers to void*