Remove void casting, add define, control scope

patch from repetier:
Remove void casting, add define, control scope, set string as const,
this should help to avoid bad memory management.