make casts from void * explicit to avoid C++ warnings (patch by Arthur Davis)