summaryrefslogtreecommitdiffstats
path: root/hl/tools/gif2h5/decompress.c
diff options
context:
space:
mode:
Diffstat (limited to 'hl/tools/gif2h5/decompress.c')
-rw-r--r--hl/tools/gif2h5/decompress.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/hl/tools/gif2h5/decompress.c b/hl/tools/gif2h5/decompress.c
index 6668c22..55081c3 100644
--- a/hl/tools/gif2h5/decompress.c
+++ b/hl/tools/gif2h5/decompress.c
@@ -15,13 +15,13 @@
#include "gif.h"
-WORD iWIDE, iHIGH, eWIDE, eHIGH, expand, numcols, strip, nostrip;
+GIFWORD iWIDE, iHIGH, eWIDE, eHIGH, expand, numcols, strip, nostrip;
unsigned long cols[256];
char *cmd;
FILE *fp;
-static WORD
+static GIFWORD
XC = 0, YC = 0, /* Output X and Y coords of current pixel */
InitCodeSize, /* Starting code size, used during Clear */
CodeSize, /* Code size, read from GIF header */
@@ -29,7 +29,7 @@ static WORD
IWidth, IHeight; /* image dimensions */
static int
BitOffset = 0, /* Bit Offset of next code */
- Pass = 0, /* Used by output routine if WORDerlaced pic */
+ Pass = 0, /* Used by output routine if GIFWORDerlaced pic */
OutCount = 0, /* Decompressor output 'stack count' */
Code, /* Value returned by ReadCode */
MaxCode, /* limiting value for current code size */
@@ -43,17 +43,17 @@ static int
ReadMask; /* Code AND mask for current code size */
/*MODIFICATIONS*/
-BYTE tempbyte[10];
-BYTE * tempBYTEptr[10];
-WORD tempint[10];
-WORD ImageCount = 0;
+GIFBYTE tempbyte[10];
+GIFBYTE * tempGIFBYTEptr[10];
+GIFWORD tempint[10];
+GIFWORD ImageCount = 0;
/*END MODIFICATION*/
boolean Interlace, HasColormap;
-BYTE *Image; /* The result array */
-BYTE *RawGIF; /* The heap array to hold it, raw */
-BYTE *Raster; /* The raster data stream, unblocked */
+GIFBYTE *Image; /* The result array */
+GIFBYTE *RawGIF; /* The heap array to hold it, raw */
+GIFBYTE *Raster; /* The raster data stream, unblocked */
/* The hash table used by the decompressor */
@@ -70,10 +70,10 @@ int numused;
/*
* Fetch the next code from the raster data stream. The codes can be any
- * length from 3 to 12 bits, packed WORDo 8-bit BYTEs, so we have to maWORDain
- * our location in the Raster array as a BIT Offset. We compute the BYTE
- * Offset WORDo the raster array by dividing this by 8, pick up three BYTEs,
- * compute the bit Offset WORDo our 24-bit chunk, shift to bring the desired
+ * length from 3 to 12 bits, packed into 8-bit GIFBYTEs, so we have to maintain
+ * our location in the Raster array as a BIT Offset. We compute the GIFBYTE
+ * Offset into the raster array by dividing this by 8, pick up three GIFBYTEs,
+ * compute the bit Offset into our 24-bit chunk, shift to bring the desired
* code to the bottom, then mask it off and return it.
*/
static int
@@ -93,7 +93,7 @@ ReadCode(void)
}
static void
-AddToPixel(BYTE Index)
+AddToPixel(GIFBYTE Index)
{
if (YC<IHeight)
*(Image + YC * BytesPerScanline + XC) = Index;
@@ -104,8 +104,8 @@ AddToPixel(BYTE Index)
* Y-coordinate */
if (++XC == IWidth) {
/*
- * If a non-WORDerlaced picture, just increment YC to the next scan
- * line. If it's WORDerlaced, deal with the WORDerlace as described
+ * If a non-interlaced picture, just increment YC to the next scan
+ * line. If it's interlaced, deal with the interlace as described
* in the GIF spec. Put the decoded scan line out to the screen if we
* haven't gone past the bottom of it.
*/
@@ -154,7 +154,7 @@ AddToPixel(BYTE Index)
/* Main routine. Convert a GIF image to an HDF image */
-BYTE *
+GIFBYTE *
Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead)
{
int i;
@@ -183,7 +183,7 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead)
*/
/*
- * Start reading the raster data. First we get the WORDial code size and
+ * Start reading the raster data. First we get the intial code size and
* compute decompressor constant values, based on this code size.
*/
@@ -206,13 +206,13 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead)
/*
* Read the raster data. Here we just transpose it from the GIF array to
- * the Raster array, turning it from a series of blocks WORDo one long
+ * the Raster array, turning it from a series of blocks into one long
* data stream, which makes life much easier for ReadCode().
*/
/* Allocate the Image */
- if (!(Image = (BYTE *)malloc((size_t)IWidth*(size_t)IHeight))) {
+ if (!(Image = (GIFBYTE *)malloc((size_t)IWidth*(size_t)IHeight))) {
printf("Out of memory");
exit(EXIT_FAILURE);
}
@@ -238,7 +238,7 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead)
FreeCode = FirstFree;
CurCode = OldCode = Code = ReadCode();
FinChar = CurCode & DataMask;
- AddToPixel((BYTE)FinChar);
+ AddToPixel((GIFBYTE)FinChar);
} else {
/*
* If not a clear code, then must be data: save same as CurCode
@@ -256,7 +256,7 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead)
}
/*
- * Unless this code is raw data, pursue the chain poWORDed to by
+ * Unless this code is raw data, pursue the chain pointed to by
* CurCode through the hash table to its end; each code in the
* chain puts its associated output code on the output queue.
*/
@@ -278,7 +278,7 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead)
* stacked LIFO, so deal with it that way...
*/
for (i = OutCount - 1; i >= 0; i--)
- AddToPixel((BYTE)OutCode[i]);
+ AddToPixel((GIFBYTE)OutCode[i]);
OutCount = 0;
@@ -291,7 +291,7 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead)
OldCode = InCode;
/*
- * PoWORD to the next slot in the table. If we exceed the current
+ * Point to the next slot in the table. If we exceed the current
* MaxCode value, increment the code size unless it's already 12.
* If it is, do nothing: the next code decompressed better be
* CLEAR