c++ compat fix: rename 'this' and 'new' variables,
cast void* malloc. leaving the rest to -Wno-write-strings.