X-Git-Url: http://git.draconx.ca/gitweb/liblbx.git/blobdiff_plain/31861aea5508509f3c98d6fb26aefc0d79d29e10..dd472b62830e4d349169778d1f8ae4e985d78953:/src/pnm.c diff --git a/src/pnm.c b/src/pnm.c index 5359ac2..d70d8b5 100644 --- a/src/pnm.c +++ b/src/pnm.c @@ -322,8 +322,7 @@ int img_output_pam(FILE *f, const char *filename, struct lbx_colour *palette) { bool masked = img_is_masked(mask, width, height); - unsigned x, y; - size_t depth; + unsigned x, y, depth; if (fprintf_ascii(f, "P7\nWIDTH %u\nHEIGHT %u\n", width, height) < 0) goto err; @@ -331,7 +330,7 @@ int img_output_pam(FILE *f, const char *filename, if (palette) { depth = masked ? 4 : 3; - if (fprintf_ascii(f, "DEPTH %zu\nMAXVAL 63\n" + if (fprintf_ascii(f, "DEPTH %u\nMAXVAL 63\n" "TUPLTYPE RGB%s\nENDHDR\n", depth, masked ? "_ALPHA" : "") < 0) goto err; @@ -354,7 +353,7 @@ int img_output_pam(FILE *f, const char *filename, } else { depth = masked ? 2 : 1; - if (fprintf_ascii(f, "DEPTH %zu\nMAXVAL 255\n" + if (fprintf_ascii(f, "DEPTH %u\nMAXVAL 255\n" "TUPLTYPE GRAYSCALE%s\nENDHDR\n", depth, masked ? "_ALPHA" : "") < 0) goto err;