From 3c3d56bb4a6a9499ab543de8e6917c60be36d7dd Mon Sep 17 00:00:00 2001 From: Ray San Date: Fri, 3 Nov 2017 12:40:46 +0100 Subject: [PATCH] Renamed data types to standard names --- src/external/rgif.h | 46 ++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/external/rgif.h b/src/external/rgif.h index f26f67d1..e524b375 100644 --- a/src/external/rgif.h +++ b/src/external/rgif.h @@ -150,7 +150,7 @@ typedef struct GifBitStatus { // The LZW dictionary is a 256-ary tree constructed // as the file is encoded, this is one node typedef struct GifLzwNode { - uint16_t m_next[256]; + unsigned short m_next[256]; } GifLzwNode; //---------------------------------------------------------------------------------- @@ -299,9 +299,9 @@ static void GifGetClosestPaletteColor(GifPalette *pPal, int r, int g, int b, int if (ind == gifTransparentIndex) return; // check whether this color is better than the current winner - int r_err = r - ((int32_t)pPal->r[ind]); - int g_err = g - ((int32_t)pPal->g[ind]); - int b_err = b - ((int32_t)pPal->b[ind]); + int r_err = r - ((int)pPal->r[ind]); + int g_err = g - ((int)pPal->g[ind]); + int b_err = b - ((int)pPal->b[ind]); int diff = GIFABS(r_err)+GIFABS(g_err)+GIFABS(b_err); if (diff < *bestDiff) @@ -463,7 +463,7 @@ static void GifSplitPalette(unsigned char *image, int numPixels, int firstElt, i } // otherwise, take the average of all colors in this subcube - uint64_t r=0, g=0, b=0; + unsigned long long r=0, g=0, b=0; for (int ii=0; iir[bestInd])*256; - int32_t g_err = nextPix[1] - (int32_t)(pPal->g[bestInd])*256; - int32_t b_err = nextPix[2] - (int32_t)(pPal->b[bestInd])*256; + int r_err = nextPix[0] - (int)(pPal->r[bestInd])*256; + int g_err = nextPix[1] - (int)(pPal->g[bestInd])*256; + int b_err = nextPix[2] - (int)(pPal->b[bestInd])*256; nextPix[0] = pPal->r[bestInd]; nextPix[1] = pPal->g[bestInd]; @@ -654,7 +654,7 @@ static void GifDitherImage(const unsigned char *lastFrame, const unsigned char * if (quantloc_7 < numPixels) { - int32_t *pix7 = quantPixels+4*quantloc_7; + int *pix7 = quantPixels+4*quantloc_7; pix7[0] += GIFMAX(-pix7[0], r_err*7 / 16); pix7[1] += GIFMAX(-pix7[1], g_err*7 / 16); pix7[2] += GIFMAX(-pix7[2], b_err*7 / 16); @@ -662,7 +662,7 @@ static void GifDitherImage(const unsigned char *lastFrame, const unsigned char * if (quantloc_3 < numPixels) { - int32_t *pix3 = quantPixels+4*quantloc_3; + int *pix3 = quantPixels+4*quantloc_3; pix3[0] += GIFMAX(-pix3[0], r_err*3 / 16); pix3[1] += GIFMAX(-pix3[1], g_err*3 / 16); pix3[2] += GIFMAX(-pix3[2], b_err*3 / 16); @@ -670,7 +670,7 @@ static void GifDitherImage(const unsigned char *lastFrame, const unsigned char * if (quantloc_5 < numPixels) { - int32_t *pix5 = quantPixels+4*quantloc_5; + int *pix5 = quantPixels+4*quantloc_5; pix5[0] += GIFMAX(-pix5[0], r_err*5 / 16); pix5[1] += GIFMAX(-pix5[1], g_err*5 / 16); pix5[2] += GIFMAX(-pix5[2], b_err*5 / 16); @@ -678,7 +678,7 @@ static void GifDitherImage(const unsigned char *lastFrame, const unsigned char * if (quantloc_1 < numPixels) { - int32_t *pix1 = quantPixels+4*quantloc_1; + int *pix1 = quantPixels+4*quantloc_1; pix1[0] += GIFMAX(-pix1[0], r_err / 16); pix1[1] += GIFMAX(-pix1[1], g_err / 16); pix1[2] += GIFMAX(-pix1[2], b_err / 16); @@ -716,8 +716,8 @@ static void GifThresholdImage(const unsigned char *lastFrame, const unsigned cha else { // palettize the pixel - int32_t bestDiff = 1000000; - int32_t bestInd = 1; + int bestDiff = 1000000; + int bestInd = 1; GifGetClosestPaletteColor(pPal, nextFrame[0], nextFrame[1], nextFrame[2], &bestInd, &bestDiff, 1); // Write the resulting color to the output buffer @@ -835,7 +835,7 @@ static void GifWriteLzwImage(FILE *f, unsigned char *image, unsigned int left, u GifLzwNode *codetree = (GifLzwNode *)GIF_TEMP_MALLOC(sizeof(GifLzwNode)*4096); memset(codetree, 0, sizeof(GifLzwNode)*4096); - int32_t curCode = -1; + int curCode = -1; unsigned int codeSize = minCodeSize + 1; unsigned int maxCode = clearCode + 1;