avoid comparison between signed and unsigned
remove useless cast
fix 'unused parameter warning' by a reset of the printer
remove trailing white space