C99 compliant function pointer casting