change type to char of ascii2petscii[128] and ptr - this will fix warning with signedness.
remove casts which are not needed anymore.