Some porting items. The typecasts are due to void* having an undefined size
(on some compilerrs).   error C2036: 'void *' : unknown size

Simply typecast to a char for size 1