Fixed Warning related to casting converting void pointer and function pointer

Assigning a void pointer to a function pointer is an undefined behaviour.
If more strict warnings are enabled and warnings are treated as errors, this can prevent the project from compiling.