Make the for loops C89 compatible.
Silence warnings from ppm - thanks @jucor
Rename to be consistent with ppm.c and png.c etc.