summaryrefslogtreecommitdiffstats
path: root/hl/tools
diff options
context:
space:
mode:
Diffstat (limited to 'hl/tools')
-rw-r--r--hl/tools/gif2h5/decompress.c50
-rw-r--r--hl/tools/gif2h5/gif.h131
-rw-r--r--hl/tools/gif2h5/gif2hdf.c6
-rw-r--r--hl/tools/gif2h5/gif2mem.c46
-rw-r--r--hl/tools/gif2h5/gifread.c92
-rw-r--r--hl/tools/gif2h5/hdf2gif.c34
-rw-r--r--hl/tools/gif2h5/hdfgifwr.c2
-rw-r--r--hl/tools/gif2h5/writehdf.c6
-rw-r--r--hl/tools/h5watch/h5watch.c121
-rw-r--r--hl/tools/h5watch/testh5watch.sh.in2
10 files changed, 249 insertions, 241 deletions
diff --git a/hl/tools/gif2h5/decompress.c b/hl/tools/gif2h5/decompress.c
index bd9a37d..8cd8a8e 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
diff --git a/hl/tools/gif2h5/gif.h b/hl/tools/gif2h5/gif.h
index ed1cc81..0c0f963 100644
--- a/hl/tools/gif2h5/gif.h
+++ b/hl/tools/gif2h5/gif.h
@@ -26,17 +26,24 @@
#define MAX_PAL 768
-/* typedef H5T_NATIVE_UINT8 BYTE; */
-typedef unsigned char BYTE;
+/* typedef H5T_NATIVE_UINT8 GIFBYTE; */
+typedef unsigned char GIFBYTE;
-/* typedef H5T_NATIVE_UINT16 WORD; */
-typedef unsigned long WORD;
+/* typedef H5T_NATIVE_UINT16 GIFWORD; */
+typedef unsigned long GIFWORD;
-typedef char CHAR;
+typedef char GIFCHAR;
+
+#ifndef boolean
typedef unsigned char boolean;
+#endif
+#ifndef false
#define false 0
+#endif
+#ifndef true
#define true 1
+#endif
/* Set the EndianOrder.
** The GIF Reader file should do this.
@@ -52,15 +59,15 @@ extern int EndianOrder;
** descriptor, and the global color table for the GIF image.
*/
typedef struct _GifHeader { /* Offset Description */
- BYTE PackedField; /* 0Ah Color Information */
- WORD TableSize;
- BYTE ImageCount; /* Keep a count of the number of images */
- BYTE CommentCount;
- BYTE ApplicationCount;
- BYTE PlainTextCount;
- BYTE HDFPalette[256][3];
- BYTE HeaderDump[6]; /* BYTE array to dump header contents */
- BYTE LSDDump[7]; /* Logical Screen Descriptor dump */
+ GIFBYTE PackedField; /* 0Ah Color Information */
+ GIFWORD TableSize;
+ GIFBYTE ImageCount; /* Keep a count of the number of images */
+ GIFBYTE CommentCount;
+ GIFBYTE ApplicationCount;
+ GIFBYTE PlainTextCount;
+ GIFBYTE HDFPalette[256][3];
+ GIFBYTE HeaderDump[6]; /* GIFBYTE array to dump header contents */
+ GIFBYTE LSDDump[7]; /* Logical Screen Descriptor dump */
} GIFHEAD;
@@ -68,32 +75,32 @@ typedef struct _GifHeader { /* Offset Description */
** The GIF Image Descriptor.
*/
typedef struct _GifImageDescriptor {
- WORD ImageWidth; /* Width of the image in pixels */
- WORD ImageHeight; /* Height of the image in pixels */
- BYTE PackedField; /* Image and Color Table Data Information */
- WORD TableSize;
- WORD CodeSize; /* Minimum LZW CodeSize for image data */
- BYTE HDFPalette[256][3];
- BYTE GIDDump[9]; /* GifImageDescriptor dump */
-
- BYTE *Image; /* Decompressed Raster Image */
- BYTE *GIFImage;
+ GIFWORD ImageWidth; /* Width of the image in pixels */
+ GIFWORD ImageHeight; /* Height of the image in pixels */
+ GIFBYTE PackedField; /* Image and Color Table Data Information */
+ GIFWORD TableSize;
+ GIFWORD CodeSize; /* Minimum LZW CodeSize for image data */
+ GIFBYTE HDFPalette[256][3];
+ GIFBYTE GIDDump[9]; /* GifImageDescriptor dump */
+
+ GIFBYTE *Image; /* Decompressed Raster Image */
+ GIFBYTE *GIFImage;
} GIFIMAGEDESC;
/*
** GIF 89a Graphic Control Extension Block
*/
typedef struct _GifGraphicControlExtension {
- BYTE GCEDump[5]; /* Graphic Control Extension Dump */
+ GIFBYTE GCEDump[5]; /* Graphic Control Extension Dump */
} GIFGRAPHICCONTROL;
/*
** GIF 89a Plain Text Extension Block
*/
typedef struct _GifPlainTextExtension {
- BYTE PTEDump[15]; /* Plain Text Extension Dump */
- BYTE *PlainTextData; /* Plain Text data sub-blocks */
- WORD DataSize;
+ GIFBYTE PTEDump[15]; /* Plain Text Extension Dump */
+ GIFBYTE *PlainTextData; /* Plain Text data sub-blocks */
+ GIFWORD DataSize;
} GIFPLAINTEXT;
@@ -101,19 +108,19 @@ typedef struct _GifPlainTextExtension {
** GIF 89a Application Extension Block
*/
typedef struct _GifApplicationExtension {
- BYTE AEDump[14]; /* Application Extension Dump */
- BYTE *ApplicationData; /* Application data sub-blocks */
- WORD DataSize;
+ GIFBYTE AEDump[14]; /* Application Extension Dump */
+ GIFBYTE *ApplicationData; /* Application data sub-blocks */
+ GIFWORD DataSize;
} GIFAPPLICATION;
/*
** GIF 89a Comment Extension Block
*/
typedef struct _GifCommentExtension {
- BYTE CEDump[2]; /* Comment Extension Dump */
- BYTE *CommentData; /* Comment data sub-blocks */
- WORD DataSize;
- BYTE Terminator; /* Block Terminator (always 0) */
+ GIFBYTE CEDump[2]; /* Comment Extension Dump */
+ GIFBYTE *CommentData; /* Comment data sub-blocks */
+ GIFWORD DataSize;
+ GIFBYTE Terminator; /* Block Terminator (always 0) */
} GIFCOMMENT;
/*
@@ -128,12 +135,12 @@ typedef struct _GifCommentExtension {
** extension.
*/
typedef struct _GifToMem {
- GIFHEAD *GifHeader;
- GIFIMAGEDESC **GifImageDesc;
- GIFGRAPHICCONTROL **GifGraphicControlExtension;
- GIFPLAINTEXT **GifPlainTextExtension;
- GIFAPPLICATION **GifApplicationExtension;
- GIFCOMMENT **GifCommentExtension;
+ GIFHEAD *GifHeader;
+ GIFIMAGEDESC **GifImageDesc;
+ GIFGRAPHICCONTROL **GifGraphicControlExtension;
+ GIFPLAINTEXT **GifPlainTextExtension;
+ GIFAPPLICATION **GifApplicationExtension;
+ GIFCOMMENT **GifCommentExtension;
} GIFTOMEM;
/*
@@ -141,40 +148,40 @@ typedef struct _GifToMem {
*/
/* GIF2MEM.C */
-int Gif2Mem(BYTE *, GIFTOMEM *);
+int Gif2Mem(GIFBYTE *, GIFTOMEM *);
/* GIFREAD.C */
-int ReadGifHeader(GIFHEAD *, BYTE **);
-int ReadGifImageDesc(GIFIMAGEDESC *, BYTE **);
-int ReadGifGraphicControl(GIFGRAPHICCONTROL *, BYTE **);
-int ReadGifPlainText(GIFPLAINTEXT *, BYTE **);
-int ReadGifApplication(GIFAPPLICATION *, BYTE **);
-int ReadGifComment(GIFCOMMENT *, BYTE **);
+int ReadGifHeader(GIFHEAD *, GIFBYTE **);
+int ReadGifImageDesc(GIFIMAGEDESC *, GIFBYTE **);
+int ReadGifGraphicControl(GIFGRAPHICCONTROL *, GIFBYTE **);
+int ReadGifPlainText(GIFPLAINTEXT *, GIFBYTE **);
+int ReadGifApplication(GIFAPPLICATION *, GIFBYTE **);
+int ReadGifComment(GIFCOMMENT *, GIFBYTE **);
/* HDFGIFWR.C */
-int hdfWriteGIF(FILE *fp, BYTE *pic, int ptype, int w, int h, BYTE *rmap,
- BYTE *gmap, BYTE *bmap, BYTE *pc2ncmap, int numcols,
+int hdfWriteGIF(FILE *fp, GIFBYTE *pic, int ptype, int w, int h, GIFBYTE *rmap,
+ GIFBYTE *gmap, GIFBYTE *bmap, GIFBYTE *pc2ncmap, int numcols,
int colorstyle, int BitsPerPixel);
/* WRITEHDF.C */
-int WriteHDF(GIFTOMEM , CHAR * );
+int WriteHDF(GIFTOMEM , GIFCHAR * );
/* Function: ReadHDF
** Return: 0 on completion without error, -1 on error
-** Input: CHAR *h5_file - HDF file name
-** CHAR *dset_name - Name of the HDF Image dataset
-** CHAR *pal_name - Name of the HDF palette
-** Output: BYTE* data - the HDF Image to be converted
-** BYTE palette[256][3] - the corresponding palette
+** Input: GIFCHAR *h5_file - HDF file name
+** GIFCHAR *dset_name - Name of the HDF Image dataset
+** GIFCHAR *pal_name - Name of the HDF palette
+** Output: GIFBYTE* data - the HDF Image to be converted
+** GIFBYTE palette[256][3] - the corresponding palette
** hsize_t* image_size - the size of each dimension of the image
*/
-int ReadHDF(BYTE** data, BYTE palette[256][3], hsize_t *image_size,
- CHAR *h5_file, CHAR *dset_name, CHAR *pal_name);
+int ReadHDF(GIFBYTE** data, GIFBYTE palette[256][3], hsize_t *image_size,
+ GIFCHAR *h5_file, GIFCHAR *dset_name, GIFCHAR *pal_name);
-BYTE *Decompress(GIFIMAGEDESC *, GIFHEAD *);
-BYTE GetByte(BYTE *);
-WORD GetWord(BYTE *);
+GIFBYTE *Decompress(GIFIMAGEDESC *, GIFHEAD *);
+GIFBYTE GetByte(GIFBYTE *);
+GIFWORD GetWord(GIFBYTE *);
-void cleanup(BYTE*);
+void cleanup(GIFBYTE*);
#endif /* GIF_H_ */
diff --git a/hl/tools/gif2h5/gif2hdf.c b/hl/tools/gif2h5/gif2hdf.c
index 2e06d34..051ff56 100644
--- a/hl/tools/gif2h5/gif2hdf.c
+++ b/hl/tools/gif2h5/gif2hdf.c
@@ -31,8 +31,8 @@ main(int argv , char *argc[])
long i, ImageCount;
long filesize;
- BYTE *MemGif;
- BYTE *StartPos;
+ GIFBYTE *MemGif;
+ GIFBYTE *StartPos;
char *GIFFileName;
char *HDFFileName;
@@ -81,7 +81,7 @@ main(int argv , char *argc[])
if (filesize == 0)
printf("File Size Zero");
- if (!(MemGif = StartPos = (BYTE *)malloc((size_t)filesize))) {
+ if (!(MemGif = StartPos = (GIFBYTE *)malloc((size_t)filesize))) {
printf("Out of memory");
exit(EXIT_FAILURE);
}
diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c
index 8fb575c..ae0a113 100644
--- a/hl/tools/gif2h5/gif2mem.c
+++ b/hl/tools/gif2h5/gif2mem.c
@@ -36,7 +36,7 @@
#include "gif.h"
int
-Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct)
+Gif2Mem(GIFBYTE *MemGif, GIFTOMEM *GifMemoryStruct)
{
/*
* The gif structure outline for passing data to memory is given in gif.h.
@@ -49,22 +49,22 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct)
GIFCOMMENT **gifComment; /* Comment Extension structure */
GIFGRAPHICCONTROL **gifGraphicControl; /* Graphic Control Extension strct */
- register WORD i; /* Loop counter */
- BYTE Identifier; /* Extension block identifier holder */
- BYTE Label; /* Extension block label holder */
- BYTE ImageCount; /* Count of the number of images in the file */
- BYTE ImageArray; /* Keep the size of the array to store Images */
- BYTE CommentCount;
- BYTE CommentArray;
- BYTE ApplicationCount;
- BYTE ApplicationArray;
- BYTE PlainTextCount;
- BYTE PlainTextArray;
- BYTE GCEflag;
- BYTE aTemp;
- BYTE j;
- BYTE w; /* Two more variables needed only while testing */
- BYTE *b; /* Endian Ordering */
+ register GIFWORD i; /* Loop counter */
+ GIFBYTE Identifier; /* Extension block identifier holder */
+ GIFBYTE Label; /* Extension block label holder */
+ GIFBYTE ImageCount; /* Count of the number of images in the file */
+ GIFBYTE ImageArray; /* Keep the size of the array to store Images */
+ GIFBYTE CommentCount;
+ GIFBYTE CommentArray;
+ GIFBYTE ApplicationCount;
+ GIFBYTE ApplicationArray;
+ GIFBYTE PlainTextCount;
+ GIFBYTE PlainTextArray;
+ GIFBYTE GCEflag;
+ GIFBYTE aTemp;
+ GIFBYTE j;
+ GIFBYTE w; /* Two more variables needed only while testing */
+ GIFBYTE *b; /* Endian Ordering */
/* Allocate memory for the GIF structures */
/* Plug the structs into GifMemoryStruct at the end */
@@ -90,7 +90,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct)
/* Carry out Endian Testing and set Endian Order */
w = 0x0001;
- b = (BYTE *) &w;
+ b = (GIFBYTE *) &w;
EndianOrder = (b[0] ? 1 : 0);
/* Read the GIF image file header information */
@@ -151,7 +151,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct)
if (ImageCount > ImageArray) {
aTemp = ImageArray;
- ImageArray = (BYTE)((ImageArray << 1) + 1);
+ ImageArray = (GIFBYTE)((ImageArray << 1) + 1);
if (!(gifImageDesc = (GIFIMAGEDESC **)realloc(gifImageDesc,
sizeof(GIFIMAGEDESC *) * ImageArray))) {
printf("Out of memory!");
@@ -218,7 +218,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct)
PlainTextCount++;
if (PlainTextCount > PlainTextArray)
- PlainTextArray = (BYTE)((PlainTextArray << 1) + 1);
+ PlainTextArray = (GIFBYTE)((PlainTextArray << 1) + 1);
if (!(gifPlainText = (GIFPLAINTEXT **)realloc(gifPlainText , sizeof(GIFPLAINTEXT *) * PlainTextArray))) {
printf("Out of memory!");
@@ -240,7 +240,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct)
CommentCount++;
if (CommentCount > CommentArray)
- CommentArray = (BYTE)((CommentArray << 1) + 1);
+ CommentArray = (GIFBYTE)((CommentArray << 1) + 1);
if (!(gifComment = (GIFCOMMENT **)realloc(gifComment , sizeof(GIFCOMMENT *) * CommentArray))) {
printf("Out of memory!");
@@ -267,7 +267,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct)
if (ImageCount > ImageArray) {
aTemp = ImageArray;
- ImageArray = (BYTE)((ImageArray << 1) + 1);
+ ImageArray = (GIFBYTE)((ImageArray << 1) + 1);
if (!(gifGraphicControl = (GIFGRAPHICCONTROL **)realloc(gifGraphicControl , sizeof(GIFGRAPHICCONTROL *) * ImageArray))) {
printf("Out of memory!");
@@ -306,7 +306,7 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct)
ApplicationCount++;
if (ApplicationCount > ApplicationArray)
- ApplicationArray = (BYTE)((ApplicationArray << 1) + 1);
+ ApplicationArray = (GIFBYTE)((ApplicationArray << 1) + 1);
if (!(gifApplication = (GIFAPPLICATION **)realloc(gifApplication , sizeof(GIFAPPLICATION *) * ApplicationArray))) {
printf("Out of memory!");
diff --git a/hl/tools/gif2h5/gifread.c b/hl/tools/gif2h5/gifread.c
index 948e112..79671aa 100644
--- a/hl/tools/gif2h5/gifread.c
+++ b/hl/tools/gif2h5/gifread.c
@@ -17,33 +17,33 @@
int EndianOrder;
-static BYTE *ReadDataSubBlocks(BYTE **MemGif2, WORD *DSize);
+static GIFBYTE *ReadDataSubBlocks(GIFBYTE **MemGif2, GIFWORD *DSize);
-WORD
-GetWord(BYTE *MemGif)
+GIFWORD
+GetWord(GIFBYTE *MemGif)
{
- WORD w;
+ GIFWORD w;
if (EndianOrder == 1) {
/* LittleEndian */
- w = (WORD) (*MemGif++ & 0xFF);
- w |= (WORD) ((*MemGif++ & 0xFF) << 0x08);
+ w = (GIFWORD) (*MemGif++ & 0xFF);
+ w |= (GIFWORD) ((*MemGif++ & 0xFF) << 0x08);
} else {
- w = (WORD) (*MemGif++ & 0xFF);
- w = ((WORD) (*MemGif++ & 0xFF)) | (w << 0x08);
+ w = (GIFWORD) (*MemGif++ & 0xFF);
+ w = ((GIFWORD) (*MemGif++ & 0xFF)) | (w << 0x08);
}
return w;
}
-BYTE
-GetByte(BYTE *MemGif)
+GIFBYTE
+GetByte(GIFBYTE *MemGif)
{
return *MemGif;
}
/*
- * Read a GIF image BYTE Header.
+ * Read a GIF image GIFBYTE Header.
*
* This function reads the Header, Logical Screen Descriptor, and
* Global Color Table (if any) from a GIF image file. The information
@@ -54,10 +54,10 @@ GetByte(BYTE *MemGif)
*/
int
ReadGifHeader(GIFHEAD *GifHead, /* Pointer to GIF header structure */
- BYTE **MemGif2) /* GIF image file input FILE stream */
+ GIFBYTE **MemGif2) /* GIF image file input FILE stream */
{
- WORD i; /* Loop counter */
- WORD tableSize; /* Number of entires in the Global Color Table */
+ GIFWORD i; /* Loop counter */
+ GIFWORD tableSize; /* Number of entires in the Global Color Table */
GifHead->TableSize = 0;
for (i = 0 ; i < 6 ; i++) {
@@ -78,7 +78,7 @@ ReadGifHeader(GIFHEAD *GifHead, /* Pointer to GIF header structure */
/* Check if a Global Color Table is present */
if (GifHead->PackedField & 0x80) {
/* Read number of color table entries */
- tableSize = (WORD) (1L << ((GifHead->PackedField & 0x07) + 1));
+ tableSize = (GIFWORD) (1L << ((GifHead->PackedField & 0x07) + 1));
GifHead->TableSize = tableSize;
/* Read the Global Color Table */
@@ -122,13 +122,13 @@ ReadGifHeader(GIFHEAD *GifHead, /* Pointer to GIF header structure */
int
ReadGifImageDesc(
GIFIMAGEDESC *GifImageDesc, /* Pointer to GIF image descriptor structure */
- BYTE **MemGif2 /* GIF image file input FILE stream */
+ GIFBYTE **MemGif2 /* GIF image file input FILE stream */
)
{
- WORD i; /* Loop counter */
- WORD tableSize; /* Number of entries in the Local Color Table */
- /* BYTE Interlace; */ /* PackedField & 0x20 gives information on interlacing */
- BYTE *TempPtr;
+ GIFWORD i; /* Loop counter */
+ GIFWORD tableSize; /* Number of entries in the Local Color Table */
+ /* GIFBYTE Interlace; */ /* PackedField & 0x20 gives information on interlacing */
+ GIFBYTE *TempPtr;
int ch , ch1;
GifImageDesc->TableSize = 0;
@@ -145,20 +145,20 @@ ReadGifImageDesc(
if (EndianOrder == 1) /* LittleEndian */
{
- GifImageDesc->ImageWidth = (WORD) (GifImageDesc->GIDDump[4] & 0xFF);
- GifImageDesc->ImageWidth |= (WORD) ((GifImageDesc->GIDDump[5] & 0xFF) << 0x08);
+ GifImageDesc->ImageWidth = (GIFWORD) (GifImageDesc->GIDDump[4] & 0xFF);
+ GifImageDesc->ImageWidth |= (GIFWORD) ((GifImageDesc->GIDDump[5] & 0xFF) << 0x08);
- GifImageDesc->ImageHeight = (WORD) (GifImageDesc->GIDDump[6] & 0xFF);
- GifImageDesc->ImageHeight |= (WORD) ((GifImageDesc->GIDDump[7] & 0xFF) << 0x08);
+ GifImageDesc->ImageHeight = (GIFWORD) (GifImageDesc->GIDDump[6] & 0xFF);
+ GifImageDesc->ImageHeight |= (GIFWORD) ((GifImageDesc->GIDDump[7] & 0xFF) << 0x08);
}
else
{
- GifImageDesc->ImageWidth = (WORD) (GifImageDesc->GIDDump[4] & 0xFF);
- GifImageDesc->ImageWidth = ((WORD) (GifImageDesc->GIDDump[5] & 0xFF)) | (GifImageDesc->ImageWidth << 0x08);
+ GifImageDesc->ImageWidth = (GIFWORD) (GifImageDesc->GIDDump[4] & 0xFF);
+ GifImageDesc->ImageWidth = ((GIFWORD) (GifImageDesc->GIDDump[5] & 0xFF)) | (GifImageDesc->ImageWidth << 0x08);
- GifImageDesc->ImageHeight = (WORD) (GifImageDesc->GIDDump[6] & 0xFF);
- GifImageDesc->ImageHeight = ((WORD) (GifImageDesc->GIDDump[7] & 0xFF)) | (GifImageDesc->ImageWidth << 0x08);
+ GifImageDesc->ImageHeight = (GIFWORD) (GifImageDesc->GIDDump[6] & 0xFF);
+ GifImageDesc->ImageHeight = ((GIFWORD) (GifImageDesc->GIDDump[7] & 0xFF)) | (GifImageDesc->ImageWidth << 0x08);
}
@@ -171,7 +171,7 @@ ReadGifImageDesc(
if (GifImageDesc->PackedField & 0x80)
{
/* Read number of color table entries */
- tableSize = (WORD) (1L << ((GifImageDesc->PackedField & 0x07) + 1));
+ tableSize = (GIFWORD) (1L << ((GifImageDesc->PackedField & 0x07) + 1));
GifImageDesc->TableSize = tableSize;
/* Read the Local Color Table */
for (i = 0; i < tableSize; i++)
@@ -185,10 +185,10 @@ ReadGifImageDesc(
/*
** Get LZW minimum Code Size
*/
- GifImageDesc->CodeSize = (WORD)*(*MemGif2)++;
+ GifImageDesc->CodeSize = (GIFWORD)*(*MemGif2)++;
/*GifImageDesc->GIFImage = ReadDataSubBlocks(FpGif);*/
- if (!(GifImageDesc->GIFImage = (BYTE *)malloc((GifImageDesc->ImageWidth) * (GifImageDesc->ImageHeight)))) {
+ if (!(GifImageDesc->GIFImage = (GIFBYTE *)malloc((GifImageDesc->ImageWidth) * (GifImageDesc->ImageHeight)))) {
printf("Out of memory");
exit(EXIT_FAILURE);
}
@@ -219,7 +219,7 @@ ReadGifImageDesc(
int
ReadGifGraphicControl(
GIFGRAPHICCONTROL *GifGraphicControl, /* Pointer to GC Extension structure */
- BYTE **MemGif2 /* GIF image file input FILE stream */
+ GIFBYTE **MemGif2 /* GIF image file input FILE stream */
)
{
int i;
@@ -244,7 +244,7 @@ ReadGifGraphicControl(
int
ReadGifPlainText(
GIFPLAINTEXT *GifPlainText, /* Pointer to Plain Text Extension structure */
- BYTE **MemGif2 /* GIF image file input FILE stream */
+ GIFBYTE **MemGif2 /* GIF image file input FILE stream */
)
{
int i;
@@ -283,7 +283,7 @@ ReadGifPlainText(
int
ReadGifApplication(
GIFAPPLICATION *GifApplication, /* Pointer to Application Extension structure */
- BYTE **MemGif2 /* GIF image file input FILE stream */
+ GIFBYTE **MemGif2 /* GIF image file input FILE stream */
)
{
int i;
@@ -321,7 +321,7 @@ ReadGifApplication(
int
ReadGifComment(
GIFCOMMENT *GifComment, /* Pointer to GIF Comment Extension structure */
- BYTE **MemGif2 /* GIF image file input FILE stream */
+ GIFBYTE **MemGif2 /* GIF image file input FILE stream */
)
{
@@ -345,14 +345,14 @@ ReadGifComment(
** Returns: A NULL pointer if a memory allocation error occured,
** otherwise a valid pointer if no error occured.
*/
-static BYTE *
-ReadDataSubBlocks(BYTE **MemGif2, /* GIF image file input FILE stream */
- WORD *DSize)
+static GIFBYTE *
+ReadDataSubBlocks(GIFBYTE **MemGif2, /* GIF image file input FILE stream */
+ GIFWORD *DSize)
{
- BYTE *ptr1; /* Pointer used to "walk the heap" */
- BYTE *ptr2; /* Pointer used to mark the top of the heap */
- BYTE dataSize; /* Size of the current data sub-block being read */
- WORD bufSize; /* Total size of the Plain Text data buffer */
+ GIFBYTE *ptr1; /* Pointer used to "walk the heap" */
+ GIFBYTE *ptr2; /* Pointer used to mark the top of the heap */
+ GIFBYTE dataSize; /* Size of the current data sub-block being read */
+ GIFWORD bufSize; /* Total size of the Plain Text data buffer */
int tempcount = 0;
bufSize = 0; /* The output buffer is empty */
@@ -360,9 +360,9 @@ ReadDataSubBlocks(BYTE **MemGif2, /* GIF image file input FILE stream
dataSize = *(*MemGif2)++; /* Get the size of the first sub-block */
/* Allocate initial data buffer */
- if (!(ptr1 = ptr2 = (BYTE *) malloc((size_t)dataSize + 1))) {
+ if (!(ptr1 = ptr2 = (GIFBYTE *) malloc((size_t)dataSize + 1))) {
printf("Out of memory. Allocation of memory for data sub-blocks for\neither Comment, Plain Text or Application Extensions failed");
- return((BYTE *) NULL);
+ return((GIFBYTE *) NULL);
}
for (;;)
{
@@ -381,8 +381,8 @@ ReadDataSubBlocks(BYTE **MemGif2, /* GIF image file input FILE stream
break; /* Block Terminator encountered */
/* Increase the buffer size to accomodate the next sub-block */
- if (!(ptr1 = ptr2 = (BYTE *) realloc(ptr2, bufSize + dataSize + 1)))
- return((BYTE *) NULL);
+ if (!(ptr1 = ptr2 = (GIFBYTE *) realloc(ptr2, bufSize + dataSize + 1)))
+ return((GIFBYTE *) NULL);
ptr1 += bufSize; /* Move pointer to the end of the data */
diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c
index ae63e92..e32facb 100644
--- a/hl/tools/gif2h5/hdf2gif.c
+++ b/hl/tools/gif2h5/hdf2gif.c
@@ -45,20 +45,20 @@ usage(void)
FILE *fpGif = NULL;
int main(int argc , char **argv)
{
- BYTE *Image;
+ GIFBYTE *Image;
void *edata;
H5E_auto2_t func;
/* compression structs */
- CHAR *HDFName = NULL;
- CHAR *GIFName = NULL;
+ GIFCHAR *HDFName = NULL;
+ GIFCHAR *GIFName = NULL;
- BYTE* b;
+ GIFBYTE* b;
- BYTE GlobalPalette[256][3];
- BYTE Red[256];
- BYTE Green[256];
- BYTE Blue[256];
+ GIFBYTE GlobalPalette[256][3];
+ GIFBYTE Red[256];
+ GIFBYTE Green[256];
+ GIFBYTE Blue[256];
int RWidth, RHeight;
int ColorMapSize, InitCodeSize, Background, BitsPerPixel;
@@ -66,7 +66,7 @@ int main(int argc , char **argv)
int i;
int numcols = 0;
- BYTE pc2nc[256] , r1[256] , g1[256] , b1[256];
+ GIFBYTE pc2nc[256] , r1[256] , g1[256] , b1[256];
int arg_index = 2;
int bool_is_image = 0; /* 0 = false , 1 = true */
@@ -110,7 +110,7 @@ int main(int argc , char **argv)
{
/* allocate space to store the image name */
size_t len = strlen(argv[arg_index]);
- image_name = (CHAR*) malloc( len + 1);
+ image_name = (GIFCHAR*) malloc( len + 1);
strcpy(image_name , argv[arg_index]);
bool_is_image = 0;
@@ -125,7 +125,7 @@ int main(int argc , char **argv)
/* Do Endian Order testing and set Endian Order */
idx = 0x0001;
- b = (BYTE *) &idx;
+ b = (GIFBYTE *) &idx;
EndianOrder = (b[0] ? 1:0);
if (!(fpGif = fopen(GIFName , "wb")))
@@ -164,7 +164,7 @@ int main(int argc , char **argv)
goto out;
}
- Image = (BYTE*) malloc( (size_t) width * (size_t) height );
+ Image = (GIFBYTE*) malloc( (size_t) width * (size_t) height );
if ( H5IMread_image( fid, image_name, Image ) < 0 )
goto out;
@@ -174,7 +174,7 @@ int main(int argc , char **argv)
if ( H5IMget_palette_info( fid, image_name, 0, pal_dims ) < 0 )
goto out;
- pal = (BYTE*) malloc( (size_t) pal_dims[0] * (size_t) pal_dims[1] );
+ pal = (GIFBYTE*) malloc( (size_t) pal_dims[0] * (size_t) pal_dims[1] );
if ( H5IMget_palette( fid, image_name, 0, pal ) < 0 )
goto out;
@@ -211,9 +211,9 @@ int main(int argc , char **argv)
numcols = 256;
for (i = 0 ; i < numcols ; i++)
{
- Red[i] = (BYTE)(255 - i);
- Green[i] = (BYTE)(255 - i);
- Blue[i] = (BYTE)(255 - i);
+ Red[i] = (GIFBYTE)(255 - i);
+ Green[i] = (GIFBYTE)(255 - i);
+ Blue[i] = (GIFBYTE)(255 - i);
}
}
else
@@ -246,7 +246,7 @@ int main(int argc , char **argv)
if (j==i)
{
/* wasn't found */
- pc2nc[i] = (BYTE)nc;
+ pc2nc[i] = (GIFBYTE)nc;
r1[nc] = Red[i];
g1[nc] = Green[i];
b1[nc] = Blue[i];
diff --git a/hl/tools/gif2h5/hdfgifwr.c b/hl/tools/gif2h5/hdfgifwr.c
index 6f5ab58..ed3e9e9 100644
--- a/hl/tools/gif2h5/hdfgifwr.c
+++ b/hl/tools/gif2h5/hdfgifwr.c
@@ -51,7 +51,7 @@
#include "gif.h"
-typedef BYTE byte;
+typedef GIFBYTE byte;
typedef long int count_int;
#ifdef __STDC__
diff --git a/hl/tools/gif2h5/writehdf.c b/hl/tools/gif2h5/writehdf.c
index b656c36..c2933c5 100644
--- a/hl/tools/gif2h5/writehdf.c
+++ b/hl/tools/gif2h5/writehdf.c
@@ -62,9 +62,9 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName)
/* get some data from gifHead */
ImageCount = gifHead.ImageCount;
#ifdef UNUSED
- CommentCount = (WORD)gifHead.CommentCount;
- ApplicationCount = (WORD)gifHead.ApplicationCount;
- PlainTextCount = (WORD)gifHead.PlainTextCount;
+ CommentCount = (GIFWORD)gifHead.CommentCount;
+ ApplicationCount = (GIFWORD)gifHead.ApplicationCount;
+ PlainTextCount = (GIFWORD)gifHead.PlainTextCount;
#endif /* UNUSED */
if ((file_id = H5Fcreate(HDFName , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT)) < 0) {
diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c
index d1f4e32..b7f583c 100644
--- a/hl/tools/h5watch/h5watch.c
+++ b/hl/tools/h5watch/h5watch.c
@@ -20,13 +20,13 @@
*/
#define PROGRAMNAME "h5watch" /* Name of tool */
#define FIELD_SEP "," /* nested field separator */
-#define DEFAULT_RETRY 50 /* number of times to try opening the file */
+#define DEFAULT_RETRY 50 /* number of times to try opening the file */
/*
* Note:(see comments in hl/src/H5LDprivate.h)
* This tool uses private routines H5LD_construct_vector()and H5LD_clean_vector()
- * This tool uses H5LD_memb_t data structure declared in H5LDprivate.h
+ * This tool uses H5LD_memb_t data structure declared in H5LDprivate.h
*/
const char *progname = "h5watch"; /* tool name */
@@ -35,7 +35,7 @@ static char *g_dup_fields = NULL; /* copy of "list_of_fields" */
static H5LD_memb_t **g_listv = NULL; /* vector info for "list_of_fields" */
static hbool_t g_monitor_size_only = FALSE; /* monitor changes in dataset dimension sizes */
-static unsigned g_polling_interval = 1; /* polling interval to check appended data */
+static unsigned g_polling_interval = 1; /* polling interval to check appended data */
static hbool_t g_label = FALSE; /* label compound values */
static int g_display_width = 80; /* output width in characters */
@@ -109,7 +109,7 @@ static struct long_options l_opts[] = {
*
* Purpose: Prepare to print the dataset's appended data.
* Call the tools library routine h5tools_dump_dset() to do the printing.
- * (This routine is mostly copied from dump_dataset_values() in tools/h5ls/h5ls.c
+ * (This routine is mostly copied from dump_dataset_values() in tools/h5ls/h5ls.c
* and modified accordingly).
*
* Return: 0 on success; negative on failure
@@ -121,15 +121,15 @@ static struct long_options l_opts[] = {
static herr_t
doprint(hid_t did, hsize_t *start, hsize_t *block, int rank)
{
- h5tools_context_t ctx; /* print context */
- h5tool_format_t info; /* Format info for the tools library */
- static char fmt_double[16], fmt_float[16]; /* Format info */
- struct subset_t subset; /* Subsetting info */
- hsize_t ss_start[H5S_MAX_RANK]; /* Info for hyperslab */
- hsize_t ss_stride[H5S_MAX_RANK]; /* Info for hyperslab */
- hsize_t ss_block[H5S_MAX_RANK]; /* Info for hyperslab */
- hsize_t ss_count[H5S_MAX_RANK]; /* Info for hyperslab */
- int i; /* Local index variable */
+ h5tools_context_t ctx; /* print context */
+ h5tool_format_t info; /* Format info for the tools library */
+ static char fmt_double[16], fmt_float[16]; /* Format info */
+ struct subset_t subset; /* Subsetting info */
+ hsize_t ss_start[H5S_MAX_RANK]; /* Info for hyperslab */
+ hsize_t ss_stride[H5S_MAX_RANK]; /* Info for hyperslab */
+ hsize_t ss_block[H5S_MAX_RANK]; /* Info for hyperslab */
+ hsize_t ss_count[H5S_MAX_RANK]; /* Info for hyperslab */
+ int i; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
/* Subsetting information for the tools library printing routines */
@@ -147,6 +147,7 @@ doprint(hid_t did, hsize_t *start, hsize_t *block, int rank)
} /* end for */
HDmemset(&ctx, 0, sizeof(ctx));
+ ctx.sset = &subset;
/* Set to all default values and then override */
HDmemset(&info, 0, sizeof info);
@@ -220,7 +221,7 @@ doprint(hid_t did, hsize_t *start, hsize_t *block, int rank)
} /* end if */
/* Print the values. */
- if((ret_value = h5tools_dump_dset(stdout, &info, &ctx, did, &subset)) < 0)
+ if((ret_value = h5tools_dump_dset(stdout, &info, &ctx, did)) < 0)
error_msg("unable to print data\n");
HDfprintf(stdout, "\n");
@@ -255,7 +256,7 @@ slicendump(hid_t did, hsize_t *prev_dims, hsize_t *cur_dims, hsize_t *start, hsi
int i; /* Local index variable */
int ind; /* Index for the current rank */
herr_t ret_value = SUCCEED; /* Return value */
-
+
ind = rank - subrank;
if((subrank - 1) > 0) {
@@ -288,7 +289,7 @@ done:
return ret_value;
} /* end slicendump() */
-
+
/*-------------------------------------------------------------------------
* Function: monitor_dataset
*
@@ -305,16 +306,16 @@ done:
*
*-------------------------------------------------------------------------
*/
-static herr_t
+static herr_t
monitor_dataset(hid_t fid, char *dsetname)
{
- hid_t did; /* dataset id */
- hid_t sid; /* dataspace id */
- int ndims; /* # of dimensions in the dataspace */
- int i, u; /* local index variable */
- hsize_t prev_dims[H5S_MAX_RANK]; /* current dataspace dimensions */
- hsize_t cur_dims[H5S_MAX_RANK]; /* previous dataspace dimensions */
- herr_t ret_value = SUCCEED; /* return value */
+ hid_t did; /* dataset id */
+ hid_t sid; /* dataspace id */
+ int ndims; /* # of dimensions in the dataspace */
+ int i, u; /* local index variable */
+ hsize_t prev_dims[H5S_MAX_RANK]; /* current dataspace dimensions */
+ hsize_t cur_dims[H5S_MAX_RANK]; /* previous dataspace dimensions */
+ herr_t ret_value = SUCCEED; /* return value */
HDfprintf(stdout, "Monitoring dataset %s...\n", dsetname);
@@ -323,7 +324,7 @@ monitor_dataset(hid_t fid, char *dsetname)
error_msg("error in opening dataset \"%s\"\n", dsetname);
ret_value = FAIL;
goto done;
- }
+ }
if((sid = H5Dget_space(did)) < 0) {
error_msg("error in getting dataspace id for dataset \"%s\"\n", dsetname);
ret_value = FAIL;
@@ -398,7 +399,7 @@ monitor_dataset(hid_t fid, char *dsetname)
}
HDfflush(stdout);
}
-
+
/* Save the current dimension sizes */
HDmemcpy(prev_dims, cur_dims, (size_t)ndims * sizeof(hsize_t));
@@ -438,7 +439,7 @@ process_cmpd_fields(hid_t fid, char *dsetname)
herr_t ret_value = SUCCEED; /* Return value */
HDassert(g_list_of_fields && *g_list_of_fields);
-
+
/* Open the dataset */
if((did = H5Dopen2(fid, dsetname, H5P_DEFAULT)) < 0) {
error_msg("error in opening dataset \"%s\"\n", dsetname);
@@ -457,14 +458,14 @@ process_cmpd_fields(hid_t fid, char *dsetname)
if(H5Tget_class(dtid) != H5T_COMPOUND) {
error_msg("dataset should be compound type for <list_of_fields>\n");
ret_value = FAIL;
- goto done;
+ goto done;
}
/* Make a copy of "g_list_of_fields" */
if((g_dup_fields = HDstrdup(g_list_of_fields)) == NULL) {
error_msg("error in duplicating g_list_of_fields\n");
ret_value = FAIL;
- goto done;
+ goto done;
}
/* Estimate the number of comma-separated fields in "g_list of_fields" */
@@ -474,7 +475,7 @@ process_cmpd_fields(hid_t fid, char *dsetname)
if((g_listv = (H5LD_memb_t **)HDcalloc(len, sizeof(H5LD_memb_t *))) == NULL) {
error_msg("error in allocating memory for H5LD_memb_t\n");
ret_value = FAIL;
- goto done;
+ goto done;
}
/* Process and store info for "g_listv" */
@@ -495,7 +496,7 @@ done:
return(ret_value);
} /* process_cmpd_fields() */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset
*
@@ -512,18 +513,18 @@ done:
static herr_t
check_dataset(hid_t fid, char *dsetname)
{
- hid_t did=-1; /* Dataset id */
- hid_t dcp=-1; /* Dataset creation property */
- hid_t sid=-1; /* Dataset's dataspace id */
- int ndims; /* # of dimensions in the dataspace */
- unsigned u; /* Local index variable */
- hsize_t cur_dims[H5S_MAX_RANK]; /* size of dataspace dimensions */
- hsize_t max_dims[H5S_MAX_RANK]; /* maximum size of dataspace dimensions */
- hbool_t unlim_max_dims = FALSE; /* whether dataset has unlimited or max. dimension setting */
+ hid_t did=-1; /* Dataset id */
+ hid_t dcp=-1; /* Dataset creation property */
+ hid_t sid=-1; /* Dataset's dataspace id */
+ int ndims; /* # of dimensions in the dataspace */
+ unsigned u; /* Local index variable */
+ hsize_t cur_dims[H5S_MAX_RANK]; /* size of dataspace dimensions */
+ hsize_t max_dims[H5S_MAX_RANK]; /* maximum size of dataspace dimensions */
+ hbool_t unlim_max_dims = FALSE; /* whether dataset has unlimited or max. dimension setting */
void *edata;
H5E_auto2_t func;
H5D_layout_t layout;
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
/* Disable error reporting */
H5Eget_auto2(H5E_DEFAULT, &func, &edata);
@@ -574,17 +575,17 @@ check_dataset(hid_t fid, char *dsetname)
/* Check whether dataset has unlimited dimension or max. dimension setting */
for(u = 0; u < (unsigned)ndims; u++)
- if(max_dims[u] == H5S_UNLIMITED || cur_dims[u] != max_dims[u]) {
+ if(max_dims[u] == H5S_UNLIMITED || cur_dims[u] != max_dims[u]) {
unlim_max_dims = TRUE;
- break;
- }
+ break;
+ }
if(!unlim_max_dims) {
error_msg("\"%s\" should have unlimited or max. dimension setting\n", dsetname);
ret_value = FAIL;
}
-done:
+done:
H5Eset_auto2(H5E_DEFAULT, func, edata);
/* Closing */
@@ -597,7 +598,7 @@ done:
return(ret_value);
} /* check_dataset() */
-
+
/*-------------------------------------------------------------------------
* Function: leave
*
@@ -618,7 +619,7 @@ leave(int ret)
exit(ret);
}
-
+
/*-------------------------------------------------------------------------
* Function: usage
*
@@ -630,7 +631,7 @@ leave(int ret)
*
*-------------------------------------------------------------------------
*/
-static void
+static void
usage(const char *prog)
{
HDfflush(stdout);
@@ -653,7 +654,7 @@ usage(const char *prog)
HDfprintf(stdout, " for a compound data type. <list_of_fields> can be\n");
HDfprintf(stdout, " specified as follows:\n");
HDfprintf(stdout, " 1) A comma-separated list of field names in a\n");
- HDfprintf(stdout, " compound data type. \",\" is the separator\n");
+ HDfprintf(stdout, " compound data type. \",\" is the separator\n");
HDfprintf(stdout, " for field names while \".\" is the separator\n");
HDfprintf(stdout, " for a nested field.\n");
HDfprintf(stdout, " 2) A single field name in a compound data type.\n");
@@ -672,7 +673,7 @@ usage(const char *prog)
} /* usage() */
-
+
/*-------------------------------------------------------------------------
* Function: parse_command_line
*
@@ -688,7 +689,7 @@ usage(const char *prog)
static void
parse_command_line(int argc, const char *argv[])
{
- int opt; /* Command line option */
+ int opt; /* Command line option */
int tmp;
/* no arguments */
@@ -726,7 +727,7 @@ parse_command_line(int argc, const char *argv[])
case 'S': /* --simple */
g_simple_output = TRUE;
break;
-
+
case 'l': /* --label */
g_label = TRUE;
break;
@@ -772,7 +773,7 @@ parse_command_line(int argc, const char *argv[])
leave(EXIT_FAILURE);
}
}
-
+
/* check for object to be processed */
if (argc <= opt_ind) {
@@ -782,7 +783,7 @@ parse_command_line(int argc, const char *argv[])
}
} /* parse_command_line() */
-
+
/*-------------------------------------------------------------------------
* Function: catch_signal
*
@@ -859,9 +860,9 @@ main(int argc, const char *argv[])
}
/* Mostly copied from tools/h5ls coding & modified accordingly */
- /*
- * [OBJECT] is specified as
- * [<filename>/<path_to_dataset>/<dsetname>]
+ /*
+ * [OBJECT] is specified as
+ * [<filename>/<path_to_dataset>/<dsetname>]
*
* Example: ../dir1/foo/bar/dset
* \_________/\______/
@@ -871,7 +872,7 @@ main(int argc, const char *argv[])
* succeeds. The first call uses the entire name and each subsequent call
* chops off the last component. If we reach the beginning of the name
* then there must have been something wrong with the file (perhaps it
- * doesn't exist).
+ * doesn't exist).
*/
if((fname = HDstrdup(argv[opt_ind])) == NULL) {
error_msg("memory allocation failed (file %s:line %d)\n",
@@ -913,7 +914,7 @@ main(int argc, const char *argv[])
if(fname) HDfree(fname);
if(fapl >= 0) H5Pclose(fapl);
leave(EXIT_FAILURE);
- }
+ }
if(!dname) {
error_msg("no dataset specified\n");
@@ -935,13 +936,13 @@ main(int argc, const char *argv[])
if(process_cmpd_fields(fid, dname) < 0)
h5tools_setstatus(EXIT_FAILURE);
}
- }
+ }
/* If everything is fine, start monitoring the datset */
if(h5tools_getstatus() != EXIT_FAILURE)
if(monitor_dataset(fid, dname) < 0)
h5tools_setstatus(EXIT_FAILURE);
-
+
/* Free spaces */
if(fname) HDfree(fname);
if(dname) HDfree(dname);
diff --git a/hl/tools/h5watch/testh5watch.sh.in b/hl/tools/h5watch/testh5watch.sh.in
index d31bcc3..24ff6aa 100644
--- a/hl/tools/h5watch/testh5watch.sh.in
+++ b/hl/tools/h5watch/testh5watch.sh.in
@@ -18,7 +18,7 @@
# supports SWMR.
./swmr_check_compat_vfd
rc=$?
-if [[ $rc != 0 ]] ; then
+if [ $rc != 0 ] ; then
echo
echo "The VFD specified by the HDF5_DRIVER environment variable"
echo "does not support SWMR."