summaryrefslogtreecommitdiffstats
path: root/hl/tools/gif2h5/decompress.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2019-12-19 20:55:49 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2019-12-19 20:55:49 (GMT)
commitd11b347aa77cbcfa2bf782c8856bf559444ad880 (patch)
treedf43489411575f566e0475ad4bb040dc69f623e6 /hl/tools/gif2h5/decompress.c
parent4281d101c41f80a75143c0d40232383a81afc7f0 (diff)
parent817235bb60e1f79c4b22b4a6116a1594aa75b81d (diff)
downloadhdf5-d11b347aa77cbcfa2bf782c8856bf559444ad880.zip
hdf5-d11b347aa77cbcfa2bf782c8856bf559444ad880.tar.gz
hdf5-d11b347aa77cbcfa2bf782c8856bf559444ad880.tar.bz2
Merging in latest from upstream (HDFFV/hdf5:refs/heads/develop)
* commit '817235bb60e1f79c4b22b4a6116a1594aa75b81d': (145 commits) Remove const Fix compile error - declaration after executable statement Adjust cache.c only variables. Fix include to correct memory calls - big-endian issue. Update h5debug to retrieve file pointer through VOL framework Minor whitespace Remove duplicate instance Revert and move declaration Correct struct access Fix duplicate and varname Fix compile and test issues from DT Modify H5VL initialization routines to initialize all VOL-managed object types. Modify H5VLwrap_register() to reject non-VOL-managed object types. Also fix overisights in h5trace.c from previous changes. Add release note for sanitizer support HDFFV-10979 cleanup globals TRILABS-135 Add clang analyzers HDFFV-10979 fix global name clash Fix issues found with ONLY_SHARED_LIBS option Fix 2010 compile issues Change from using H5Dcreate to H5Dcreate2 Latest date first in RELEASE.txt ...
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