Fix build for Visual Studio on Windows.

void * arithmetic is a gcc extension. Cast the pointer to avoid compilation errors.