Skip to content

Commit

Permalink
Resolve confliction of parameter declarations of load_pnm(), reported…
Browse files Browse the repository at this point in the history
… by @tautschnig. (for Issue #40)
  • Loading branch information
saitoha committed Mar 7, 2015
1 parent 7f73585 commit 0622f04
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions converters/frompnm.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <sixel.h>


static unsigned char *
Expand Down Expand Up @@ -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;
Expand All @@ -65,7 +65,6 @@ load_pnm(unsigned char *p, int length,

(void) ppalette;
(void) pncolors;
(void) pixelformat;

width = height = 0;
deps = 1;
Expand Down Expand Up @@ -213,6 +212,7 @@ load_pnm(unsigned char *p, int length,

*psx = width;
*psy = height;
*ppixelformat = PIXELFORMAT_RGB888;
return result;
}

Expand Down
2 changes: 1 addition & 1 deletion converters/frompnm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 1 addition & 2 deletions converters/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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",
Expand Down

0 comments on commit 0622f04

Please sign in to comment.