Win32: Adjust type casting to meet VC++ reqs

VC++ doesn't allow pointer arithmetic on void*. Instead, we cast to
char* so it does the arithmetic in terms of byte units.

This commit also fixes a few other places where char* needs to be cast
to void*, or vice-versa, as well as the integer types use for some
loops.