void * casts for c++ compat