replace all instances of %i with %d to match OpenBSD standards
more %i -> %d
remove useless cast