change uint32_t to UINT32 since stdint.h is not defined in old Visual C++ versions

This commit is contained in:
Mickael B 2017-07-29 13:35:07 -04:00 committed by Eric Soroos
parent e308adb9d6
commit 9e179c027c
2 changed files with 10 additions and 11 deletions

View File

@ -1,5 +1,4 @@
/* Sgi.h */ /* Sgi.h */
#include <stdint.h>
typedef struct { typedef struct {
@ -9,16 +8,16 @@ typedef struct {
int bpc; int bpc;
/* RLE offsets table */ /* RLE offsets table */
uint32_t *starttab; UINT32 *starttab;
/* RLE lengths table */ /* RLE lengths table */
uint32_t *lengthtab; UINT32 *lengthtab;
/* current row offset */ /* current row offset */
uint32_t rleoffset; UINT32 rleoffset;
/* current row length */ /* current row length */
uint32_t rlelength; UINT32 rlelength;
/* RLE table size */ /* RLE table size */
int tablen; int tablen;

View File

@ -20,9 +20,9 @@
#define RLE_COPY_FLAG 0x80 #define RLE_COPY_FLAG 0x80
#define RLE_MAX_RUN 0x7f #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) static int expandrow(UINT8* dest, UINT8* src, int n, int z)
@ -117,17 +117,17 @@ ImagingSgiRleDecode(Imaging im, ImagingCodecState state,
free(state->buffer); free(state->buffer);
state->buffer = malloc(sizeof(UINT8) * 2 * im->xsize * im->bands); state->buffer = malloc(sizeof(UINT8) * 2 * im->xsize * im->bands);
c->tablen = im->bands * im->ysize; c->tablen = im->bands * im->ysize;
c->starttab = calloc(c->tablen, sizeof(uint32_t)); c->starttab = calloc(c->tablen, sizeof(UINT32));
c->lengthtab = calloc(c->tablen, sizeof(uint32_t)); c->lengthtab = calloc(c->tablen, sizeof(UINT32));
/* populate offsets table */ /* populate offsets table */
for (c->tabindex = 0, c->bufindex = 0; c->tabindex < c->tablen; c->tabindex++, c->bufindex+=4) for (c->tabindex = 0, c->bufindex = 0; c->tabindex < c->tablen; c->tabindex++, c->bufindex+=4)
read4B(&c->starttab[c->tabindex], &ptr[c->bufindex]); read4B(&c->starttab[c->tabindex], &ptr[c->bufindex]);
/* populate lengths table */ /* 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]); 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 */ /* read compressed rows */
for (c->rowno = 0; c->rowno < im->ysize; c->rowno++, state->y += state->ystep) for (c->rowno = 0; c->rowno < im->ysize; c->rowno++, state->y += state->ystep)