From 9e179c027cdb7485e1e6b3730e12ffc9348805f3 Mon Sep 17 00:00:00 2001 From: Mickael B Date: Sat, 29 Jul 2017 13:35:07 -0400 Subject: [PATCH] change uint32_t to UINT32 since stdint.h is not defined in old Visual C++ versions --- libImaging/Sgi.h | 9 ++++----- libImaging/SgiRleDecode.c | 12 ++++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/libImaging/Sgi.h b/libImaging/Sgi.h index f75ea9225..8015d6661 100644 --- a/libImaging/Sgi.h +++ b/libImaging/Sgi.h @@ -1,5 +1,4 @@ /* Sgi.h */ -#include typedef struct { @@ -9,16 +8,16 @@ typedef struct { int bpc; /* RLE offsets table */ - uint32_t *starttab; + UINT32 *starttab; /* RLE lengths table */ - uint32_t *lengthtab; + UINT32 *lengthtab; /* current row offset */ - uint32_t rleoffset; + UINT32 rleoffset; /* current row length */ - uint32_t rlelength; + UINT32 rlelength; /* RLE table size */ int tablen; diff --git a/libImaging/SgiRleDecode.c b/libImaging/SgiRleDecode.c index 2055759cc..3c5e2f2ae 100644 --- a/libImaging/SgiRleDecode.c +++ b/libImaging/SgiRleDecode.c @@ -20,9 +20,9 @@ #define RLE_COPY_FLAG 0x80 #define RLE_MAX_RUN 0x7f -static void read4B(uint32_t* dest, UINT8* buf) +static void read4B(UINT32* dest, UINT8* buf) { - *dest = (uint32_t)((buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]); + *dest = (UINT32)((buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]); } static int expandrow(UINT8* dest, UINT8* src, int n, int z) @@ -117,17 +117,17 @@ ImagingSgiRleDecode(Imaging im, ImagingCodecState state, free(state->buffer); state->buffer = malloc(sizeof(UINT8) * 2 * im->xsize * im->bands); c->tablen = im->bands * im->ysize; - c->starttab = calloc(c->tablen, sizeof(uint32_t)); - c->lengthtab = calloc(c->tablen, sizeof(uint32_t)); + c->starttab = calloc(c->tablen, sizeof(UINT32)); + c->lengthtab = calloc(c->tablen, sizeof(UINT32)); /* populate offsets table */ for (c->tabindex = 0, c->bufindex = 0; c->tabindex < c->tablen; c->tabindex++, c->bufindex+=4) read4B(&c->starttab[c->tabindex], &ptr[c->bufindex]); /* populate lengths table */ - for (c->tabindex = 0, c->bufindex = c->tablen * sizeof(uint32_t); c->tabindex < c->tablen; c->tabindex++, c->bufindex+=4) + for (c->tabindex = 0, c->bufindex = c->tablen * sizeof(UINT32); c->tabindex < c->tablen; c->tabindex++, c->bufindex+=4) read4B(&c->lengthtab[c->tabindex], &ptr[c->bufindex]); - state->count += c->tablen * sizeof(uint32_t) * 2; + state->count += c->tablen * sizeof(UINT32) * 2; /* read compressed rows */ for (c->rowno = 0; c->rowno < im->ysize; c->rowno++, state->y += state->ystep)