From 0622f045cf8abbd470515b6ce7449324ffb05538 Mon Sep 17 00:00:00 2001 From: Hayaki Saito Date: Sat, 7 Mar 2015 21:08:17 +0900 Subject: [PATCH] Resolve confliction of parameter declarations of load_pnm(), reported by @tautschnig. (for Issue #40) --- converters/frompnm.c | 6 +++--- converters/frompnm.h | 2 +- converters/loader.c | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/converters/frompnm.c b/converters/frompnm.c index 8e8b758c..2253ffad 100644 --- a/converters/frompnm.c +++ b/converters/frompnm.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include static unsigned char * @@ -55,7 +55,7 @@ unsigned char * load_pnm(unsigned char *p, int length, int *psx, int *psy, int *pcomp, unsigned char **ppalette, int *pncolors, - int *pixelformat) + int *ppixelformat) { int n, i, b, x, y, component[3]; int ascii, maps; @@ -65,7 +65,6 @@ load_pnm(unsigned char *p, int length, (void) ppalette; (void) pncolors; - (void) pixelformat; width = height = 0; deps = 1; @@ -213,6 +212,7 @@ load_pnm(unsigned char *p, int length, *psx = width; *psy = height; + *ppixelformat = PIXELFORMAT_RGB888; return result; } diff --git a/converters/frompnm.h b/converters/frompnm.h index 9464f32d..ff85a35a 100644 --- a/converters/frompnm.h +++ b/converters/frompnm.h @@ -34,7 +34,7 @@ unsigned char * load_pnm(unsigned char *p, int len, int *psx, int *psy, int *pcomp, unsigned char **ppalette, int *pncolors, - int pixelformat); + int *ppixelformat); #ifdef __cplusplus } diff --git a/converters/loader.c b/converters/loader.c index 73107854..eb0cd982 100644 --- a/converters/loader.c +++ b/converters/loader.c @@ -643,7 +643,6 @@ load_with_builtin(chunk_t const *pchunk, int *psx, int *psy, static stbi__gif g; chunk_t frames; chunk_t delays; - int pixelformat = PIXELFORMAT_RGB888; if (chunk_is_sixel(pchunk)) { pixels = load_sixel(pchunk->buffer, pchunk->size, @@ -658,7 +657,7 @@ load_with_builtin(chunk_t const *pchunk, int *psx, int *psy, } else if (chunk_is_pnm(pchunk)) { /* pnm */ pixels = load_pnm(pchunk->buffer, pchunk->size, - psx, psy, pcomp, ppalette, pncolors, pixelformat); + psx, psy, pcomp, ppalette, pncolors, ppixelformat); if (!pixels) { #if HAVE_ERRNO_H fprintf(stderr, "load_pnm failed.\n" "reason: %s.\n",