diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gifconv/decompress.c | 24 | ||||
-rw-r--r-- | tools/gifconv/gif.h | 1 | ||||
-rw-r--r-- | tools/gifconv/gifread.c | 10 | ||||
-rw-r--r-- | tools/gifconv/hdf2gif.c | 29 | ||||
-rw-r--r-- | tools/gifconv/hdfgifwr.c | 40 | ||||
-rw-r--r-- | tools/gifconv/readhdf.c | 11 | ||||
-rw-r--r-- | tools/gifconv/writehdf.c | 59 | ||||
-rw-r--r-- | tools/h5dump/h5dump.c | 22 | ||||
-rw-r--r-- | tools/lib/h5tools_utils.c | 5 | ||||
-rw-r--r-- | tools/lib/h5tools_utils.h | 4 |
10 files changed, 74 insertions, 131 deletions
diff --git a/tools/gifconv/decompress.c b/tools/gifconv/decompress.c index 18dbb3e..ff6c4ca 100644 --- a/tools/gifconv/decompress.c +++ b/tools/gifconv/decompress.c @@ -15,19 +15,15 @@ char *cmd; FILE *fp; +static WORD + XC = 0, YC = 0, /* Output X and Y coords of current pixel */ + CodeSize, /* Code size, read from GIF header */ + InitCodeSize, /* Starting code size, used during Clear */ + BytesPerScanline, /* Bytes per scanline in output raster */ + IWidth, IHeight; /* image dimensions */ static int BitOffset = 0, /* Bit Offset of next code */ -XC = 0, YC = 0, /* Output X and Y coords of current pixel */ Pass = 0, /* Used by output routine if WORDerlaced pic */ OutCount = 0, /* Decompressor output 'stack count' */ -RWidth, RHeight, /* screen dimensions */ -IWidth, IHeight, /* image dimensions */ -LeftOfs, TopOfs, /* image offset */ -BitsPerPixel, /* Bits per pixel, read from GIF header */ -BytesPerScanline, /* Bytes per scanline in output raster */ -ColorMapSize, /* number of colors */ -Background, /* background color */ -CodeSize, /* Code size, read from GIF header */ -InitCodeSize, /* Starting code size, used during Clear */ Code, /* Value returned by ReadCode */ MaxCode, /* limiting value for current code size */ ClearCode, /* GIF clear code */ @@ -73,7 +69,8 @@ int numused; * three BYTEs, compute the bit Offset WORDo our 24-bit chunk, shift to * bring the desired code to the bottom, then mask it off and return it. */ -ReadCode() +static int +ReadCode(void) { int RawCode, ByteOffset; @@ -87,8 +84,7 @@ ReadCode() } -AddToPixel(Index) -BYTE Index; +static void AddToPixel(BYTE Index) { if (YC<IHeight) *(Image + YC * BytesPerScanline + XC) = Index; @@ -154,7 +150,7 @@ GIFHEAD *GifHead; OutCount = 0; BitOffset = 0; - DataMask = (WORD)((1L << ((GifHead->PackedField & 0x07) +1)) -1); + DataMask = (1 << ((GifHead->PackedField & 0x07) +1)) -1; Raster = GifImageDesc->GIFImage; diff --git a/tools/gifconv/gif.h b/tools/gifconv/gif.h index 7f1d042..9e4f9e8 100644 --- a/tools/gifconv/gif.h +++ b/tools/gifconv/gif.h @@ -169,7 +169,6 @@ int WriteHDF(GIFTOMEM , CHAR * , CHAR *); */ int ReadHDF(BYTE** data , BYTE palette[256][3] , hsize_t *image_size , CHAR *h5_file , CHAR *dset_name , CHAR *pal_name); -BYTE *ReadDataSubBlocks(BYTE ** , WORD *); BYTE *Decompress (GIFIMAGEDESC * , GIFHEAD *); BYTE GetByte(BYTE *); WORD GetWord(BYTE *); diff --git a/tools/gifconv/gifread.c b/tools/gifconv/gifread.c index f2fefff..c7b7b96 100644 --- a/tools/gifconv/gifread.c +++ b/tools/gifconv/gifread.c @@ -2,6 +2,9 @@ #include <stdlib.h> #include "gif.h" +static BYTE * +ReadDataSubBlocks(BYTE **MemGif2 , WORD *DSize); + int EndianOrder; int i; @@ -53,7 +56,7 @@ BYTE **MemGif2; /* GIF image file input FILE stream */ for (i = 0 ; i < 6 ; i++) { GifHead->HeaderDump[i] = *(*MemGif2)++; } - if (strncmp(GifHead->HeaderDump , "GIF" , 3)) { + if (strncmp((const char *)GifHead->HeaderDump , "GIF" , 3)) { printf("The file does not appear to be a valid GIF file.\n"); exit(-1); } @@ -352,7 +355,9 @@ WORD *DSize; bufSize += (dataSize); /* Running total of the buffer size */ *DSize = bufSize; - /* *ptr1++ = dataSize; /* Write the data count */ +#ifdef COMMENTED_OUT + *ptr1++ = dataSize; /* Write the data count */ +#endif /* COMMENTED_OUT */ while (dataSize--) /* Read/write the Plain Text data */ *ptr1++ = *(*MemGif2)++; @@ -370,7 +375,6 @@ WORD *DSize; } - /**ptr1++ = (BYTE) NULL; /* Add NULL to simulate Terminator value */ *ptr1++ = '\0'; return(ptr2); /* Return a pointer to the sub-block data */ diff --git a/tools/gifconv/hdf2gif.c b/tools/gifconv/hdf2gif.c index 1963a20..6443627 100644 --- a/tools/gifconv/hdf2gif.c +++ b/tools/gifconv/hdf2gif.c @@ -52,7 +52,7 @@ void putword(int w, FILE *fp) fputc((w>>8)&0xff,fp); } -void usage() { +static void usage(void) { printf("Usage: h52gif <h5_file> <gif_file> -i <h5_image> [-p <h5_palette>]\n"); printf("h52gif expects *at least* one h5_image. You may repeat -i <h5_image> [-p <h5_palette>] at most 50 times (maximum of 50 images).\n"); } @@ -68,12 +68,9 @@ int main(int argc , char **argv) { CHAR *HDFName = NULL; CHAR *GIFName = NULL; - CHAR *image_path = NULL; - CHAR *pal_path = NULL; /* reference variables */ int has_local_palette; /* treated as a flag */ - int loop_times; /* number of times to loop, i'm going to treat it as a yes or no */ BYTE* b; @@ -86,10 +83,8 @@ int main(int argc , char **argv) { /*int LeftOfs, TopOfs;*/ int ColorMapSize, InitCodeSize, Background, BitsPerPixel; int j,nc; - int w,h,i; + int w,i; int numcols = 256; - int CountDown; - int curx , cury; int time_out = 0; /* time between two images in the animation */ int n_images , index; @@ -207,19 +202,7 @@ int main(int argc , char **argv) { assert(dim_sizes[1]==(hsize_t)((int)dim_sizes[1])); RWidth = (int)dim_sizes[1]; RHeight = (int)dim_sizes[0]; - w = (int)dim_sizes[1]; - h = (int)dim_sizes[0]; - -#ifdef UNUSED - /* w = dim_sizes[1]; - h = dim_sizes[0]; - - */ - LeftOfs = TopOfs = 0; -#endif /*UNUSED */ - - /* If the first image does not have a palette, I make my own global color table ** Obviously this is not the best thing to do, better steps would be: ** 1. Check for either a global palette or a global attribute called palette @@ -266,13 +249,9 @@ int main(int argc , char **argv) { ColorMapSize = 1 << BitsPerPixel; - CountDown = w * h; /* # of pixels we'll be doing */ - if (BitsPerPixel <= 1) InitCodeSize = 2; else InitCodeSize = BitsPerPixel; - curx = cury = 0; - if (!fpGif) { fprintf(stderr, "WriteGIF: file not open for writing\n" ); return (1); @@ -285,11 +264,9 @@ int main(int argc , char **argv) { /* Write out the GIF header and logical screen descriptor */ if (n_images > 1) { fwrite("GIF89a", 1, 6, fpGif); /* the GIF magic number */ - loop_times = 0; } else { fwrite("GIF87a", 1, 6, fpGif); /* the GIF magic number */ - loop_times = 1; } putword(RWidth, fpGif); /* screen descriptor */ @@ -305,7 +282,7 @@ int main(int argc , char **argv) { fputc(0, fpGif); /* future expansion byte */ - /* If loop_times is 0 , put in the application extension to make the gif anime loop + /* If time_out>0, put in the application extension to make the gif anime loop ** indefinitely */ if (time_out > 0) { diff --git a/tools/gifconv/hdfgifwr.c b/tools/gifconv/hdfgifwr.c index 7277e13..3c15477 100644 --- a/tools/gifconv/hdfgifwr.c +++ b/tools/gifconv/hdfgifwr.c @@ -73,13 +73,10 @@ typedef long int count_int; /* MONO returns total intensity of r,g,b components */ #define MONO(rd,gn,bl) (((rd)*11 + (gn)*16 + (bl)*5) >> 5) /*.33R+ .5G+ .17B*/ -static int Width, Height; -static int curx, cury; -static long CountDown; -static int Interlace; - #ifdef __STDC__ +#ifdef UNUSED static void putword(int, FILE *); +#endif /* UNUSED */ static void compress(int, FILE *, byte *, int); static void output(int); static void cl_block(void); @@ -88,15 +85,16 @@ static void char_init(void); static void char_out(int); static void flush_char(void); #else -static void putword(), compress(), output(), cl_block(), cl_hash(); +#ifdef UNUSED +static void putword(); +#endif /* UNUSED */ +static void compress(), output(), cl_block(), cl_hash(); static void char_init(), char_out(), flush_char(); #endif -static byte pc2nc[256],r1[256],g1[256],b1[256]; +static byte pc2nc[256]; -void xvbzero(s, len) - char *s; - int len; +static void xvbzero(char *s, size_t len) { for ( ; len>0; len--) *s++ = 0; } @@ -110,36 +108,18 @@ int hdfWriteGIF(fp, pic, ptype, w, h, rmap, gmap, bmap, pc2ncmap, numcols, colo int numcols, colorstyle; int BitsPerPixel; { - int RWidth, RHeight; - int LeftOfs, TopOfs; - int ColorMapSize, InitCodeSize, Background; + int InitCodeSize; int i; byte *pic8; pic8 = pic; - Interlace = 0; - Background = 0; - for (i=0; i<256; i++) { pc2nc[i] = pc2ncmap[i]; - r1[i] = rmap[i]; - g1[i] = gmap[i]; - b1[i] = bmap[i]; } - ColorMapSize = 1 << BitsPerPixel; - - RWidth = Width = w; - RHeight = Height = h; - LeftOfs = TopOfs = 0; - - CountDown = w * h; /* # of pixels we'll be doing */ - if (BitsPerPixel <= 1) InitCodeSize = 2; else InitCodeSize = BitsPerPixel; - curx = cury = 0; - if (!fp) { fprintf(stderr, "WriteGIF: file not open for writing\n" ); return (1); @@ -155,6 +135,7 @@ int hdfWriteGIF(fp, pic, ptype, w, h, rmap, gmap, bmap, pc2ncmap, numcols, colo +#ifdef UNUSED /******************************/ static void putword(w, fp) int w; @@ -166,6 +147,7 @@ FILE *fp; fputc((w>>8)&0xff,fp); } +#endif /* UNUSED */ diff --git a/tools/gifconv/readhdf.c b/tools/gifconv/readhdf.c index 602c48f..5b9c9d1 100644 --- a/tools/gifconv/readhdf.c +++ b/tools/gifconv/readhdf.c @@ -32,7 +32,6 @@ int ReadHDF(BYTE** data , CHAR *pal_name) { hid_t fHfile; /* H5 file to open */ - herr_t status; /* status variable */ hid_t dspace; /* dataspace identifier for the the dataset */ hid_t dset; /* dataset identifier */ @@ -89,7 +88,7 @@ int ReadHDF(BYTE** data , } /* get the actual image */ - if ((status = H5Dread(dset , H5Dget_type(dset) , H5S_ALL , H5S_ALL , H5P_DEFAULT , *data)) < 0) { + if (H5Dread(dset , H5Dget_type(dset) , H5S_ALL , H5S_ALL , H5P_DEFAULT , *data) < 0) { fprintf(stderr , "Unable to read data \n"); cleanup(*data); return -1; @@ -140,7 +139,7 @@ int ReadHDF(BYTE** data , } /* get the actual palette */ - if ((status = H5Dread(pal_set , H5Dget_type(pal_set) , H5S_ALL , H5S_ALL , H5P_DEFAULT , temp_buf)) < 0) { + if (H5Dread(pal_set , H5Dget_type(pal_set) , H5S_ALL , H5S_ALL , H5P_DEFAULT , temp_buf) < 0) { fprintf(stderr , "Unable to read data \n"); cleanup(*data); cleanup(temp_buf); @@ -165,9 +164,9 @@ int ReadHDF(BYTE** data , } /* close everything */ - status = H5Dclose(dset); - status = H5Sclose(dspace); - status = H5Fclose(fHfile); + H5Dclose(dset); + H5Sclose(dspace); + H5Fclose(fHfile); return 0; } diff --git a/tools/gifconv/writehdf.c b/tools/gifconv/writehdf.c index 53cf9be..1eb49fd 100644 --- a/tools/gifconv/writehdf.c +++ b/tools/gifconv/writehdf.c @@ -13,7 +13,6 @@ int write_text_attribute(hid_t dataset_id , char *attr_name , char *attr_value) hsize_t attr_dims_size; /* dimensions for the attribute */ hid_t attr_dataspace_id; /* dataspaces needed for the various attributes */ hid_t attr_attr_id; /* attribute id */ - herr_t status; /* check return status */ hid_t attr_type_id; @@ -36,15 +35,15 @@ int write_text_attribute(hid_t dataset_id , char *attr_name , char *attr_value) attr_attr_id = H5Acreate(dataset_id , attr_name , attr_type_id , attr_dataspace_id , H5P_DEFAULT); /* write out the attribute data */ - if ((status = H5Awrite(attr_attr_id , attr_type_id , attr_value)) < 0) + if (H5Awrite(attr_attr_id , attr_type_id , attr_value) < 0) return -1; /* close the attribute */ - if ((status = H5Aclose(attr_attr_id)) < 0) + if (H5Aclose(attr_attr_id) < 0) return -1; /* close the dataspace */ - if ((status = H5Sclose(attr_dataspace_id)) < 0) { + if (H5Sclose(attr_dataspace_id) < 0) { fprintf(stderr , "Unable to close attribute dataspace. Aborting \n"); return -1; } @@ -62,23 +61,14 @@ char *GIFFileName; GIFHEAD gifHead; /* GIF Header structure */ GIFIMAGEDESC* gifImageDesc; /* Logical Image Descriptor struct */ - long ImageCount , /* number of images */ - CommentCount, /* number of comments */ - ApplicationCount , /* number of application extensions */ - PlainTextCount; /* number of plain text extensions */ - + long ImageCount; /* number of images */ char ImageName[256]; /* Image name for the GR Image */ - /* CommentName[256], - ApplicationName[256], - PlainTextName[256]; */ - char GroupName[VSNAMELENMAX]; /* so that we can name the subgroups appropriately */ /* H5 variables */ hid_t file_id; /* H5 file id */ hid_t image_id; /* H5 id for the whole image */ hid_t pal_id; /* H5 id for the palette */ - herr_t status; /* status variable */ hobj_ref_t pal_ref; /* Create a reference for the palette */ /* temp counter */ @@ -93,10 +83,7 @@ char *GIFFileName; gifHead = *(GifMemoryStruct.GifHeader); /* get some data from gifHead */ - ImageCount = (WORD)gifHead.ImageCount; - CommentCount = (WORD)gifHead.CommentCount; - ApplicationCount = (WORD)gifHead.ApplicationCount; - PlainTextCount = (WORD)gifHead.PlainTextCount; + ImageCount = gifHead.ImageCount; /* get the main group name from GIFFileName */ GroupName[0]= '/'; @@ -145,7 +132,7 @@ char *GIFFileName; /* write the palette data out */ /****** Ask Elena about VOIDP ******/ - if ((status = H5Dwrite(pal_id , H5T_NATIVE_UINT8 , H5S_ALL , H5S_ALL , H5P_DEFAULT , (void *)gifHead.HDFPalette)) < 0) { + if (H5Dwrite(pal_id , H5T_NATIVE_UINT8 , H5S_ALL , H5S_ALL , H5P_DEFAULT , (void *)gifHead.HDFPalette) < 0) { fprintf(stderr , "Error writing dataset. Aborting...\n"); return -1; } @@ -183,36 +170,36 @@ char *GIFFileName; ref_dataset_id = H5Dcreate(image_id , "Palette Reference" , H5T_STD_REF_OBJ , ref_dataspace_id , H5P_DEFAULT); /* create a reference to the palette */ - if ((status = H5Rcreate(&pal_ref , image_id , "Global Palette" , H5R_OBJECT , -1)) < 0) { + if (H5Rcreate(&pal_ref , image_id , "Global Palette" , H5R_OBJECT , -1) < 0) { fprintf(stderr , "Unable to create palette reference\n"); return -1; } /* write the reference out */ - if ((status = H5Dwrite(ref_dataset_id , H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL , H5P_DEFAULT, &pal_ref)) < 0) { + if (H5Dwrite(ref_dataset_id , H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL , H5P_DEFAULT, &pal_ref) < 0) { fprintf(stderr , "Unable to write Palette Reference"); return -1; } /* close dataset */ - if ((status = H5Dclose(ref_dataset_id)) < 0) { + if (H5Dclose(ref_dataset_id) < 0) { fprintf(stderr , "Unable to close palette dataset.\n"); return -1; } /* close dataspace */ - if ((status = H5Sclose(ref_dataspace_id)) < 0) { + if (H5Sclose(ref_dataspace_id) < 0) { fprintf(stderr , "Unable to close palette dataspace.\n"); return -1; } /* close everything */ - if ((status = H5Dclose(pal_id)) < 0) { + if (H5Dclose(pal_id) < 0) { fprintf(stderr , "Unable to close palette dataset. Aborting.\n"); return -1; } - if ((status = H5Sclose(dataspace_id)) < 0) { + if (H5Sclose(dataspace_id) < 0) { fprintf(stderr , "Unable to close palette dataspace. Aborting.\n"); return -1; } @@ -258,7 +245,7 @@ char *GIFFileName; /* write out the image */ /****** Ask Elena about VOIDP ******/ - if ((status = H5Dwrite(sub_image_id , H5T_NATIVE_UINT8 , H5S_ALL , H5S_ALL , H5P_DEFAULT , (void *)(gifImageDesc->Image))) < 0) { + if (H5Dwrite(sub_image_id , H5T_NATIVE_UINT8 , H5S_ALL , H5S_ALL , H5P_DEFAULT , (void *)(gifImageDesc->Image)) < 0) { fprintf(stderr , "Error writing image. Aborting... \n"); return -1; } @@ -332,19 +319,19 @@ char *GIFFileName; /* create the attribute */ attr_attr_id = H5Acreate(sub_image_id , "PALETTE" , H5T_STD_REF_OBJ , attr_dataspace_id , H5P_DEFAULT); - if ((status = H5Awrite(attr_attr_id , H5T_STD_REF_OBJ , &pal_ref)) < 0) { + if (H5Awrite(attr_attr_id , H5T_STD_REF_OBJ , &pal_ref) < 0) { fprintf(stderr , "Unable to write attribute. Aborting \n"); return -1; } /* close the attribute */ - if ((status = H5Aclose(attr_attr_id)) < 0) { + if (H5Aclose(attr_attr_id) < 0) { fprintf(stderr , "Unable to close CLASS IMAGE attribute. Aborting.\n"); return -1; } /* close the dataspace */ - if ((status = H5Sclose(attr_dataspace_id)) < 0) { + if (H5Sclose(attr_dataspace_id) < 0) { fprintf(stderr , "Unable to close attribute dataspace. Aborting \n"); return -1; } @@ -364,31 +351,31 @@ char *GIFFileName; /* create the attribute */ attr_attr_id = H5Acreate(sub_image_id , "IMAGE_MINMAXRANGE" , H5T_NATIVE_UINT8 , attr_dataspace_id , H5P_DEFAULT); - if ((status = H5Awrite(attr_attr_id , H5T_NATIVE_UINT8 , minmax)) < 0) { + if (H5Awrite(attr_attr_id , H5T_NATIVE_UINT8 , minmax) < 0) { fprintf(stderr , "Unable to write attribute. Aborting \n"); return -1; } /* close the attribute */ - if ((status = H5Aclose(attr_attr_id)) < 0) { + if (H5Aclose(attr_attr_id) < 0) { fprintf(stderr , "Unable to close CLASS IMAGE attribute. Aborting.\n"); return -1; } /* close the dataspace */ - if ((status = H5Sclose(attr_dataspace_id)) < 0) { + if (H5Sclose(attr_dataspace_id) < 0) { fprintf(stderr , "Unable to close attribute dataspace. Aborting \n"); return -1; } /* close everything */ - if ((status = H5Dclose(sub_image_id)) < 0) { + if (H5Dclose(sub_image_id) < 0) { fprintf(stderr , "Unable to close image dataset. Aborting \n"); return -1; } - if ((status = H5Sclose(dataspace_id)) < 0) { + if (H5Sclose(dataspace_id) < 0) { fprintf(stderr , "Unable to close image dataspace. Aborting \n"); return -1; } @@ -396,13 +383,13 @@ char *GIFFileName; } /* close the main image group */ - if ((status = H5Gclose(image_id)) < 0) { + if (H5Gclose(image_id) < 0) { fprintf(stderr , "Could not close the image group. Aborting...\n"); return -1; } /* close the H5 file */ - if ((status = H5Fclose(file_id)) < 0) { + if (H5Fclose(file_id) < 0) { fprintf(stderr , "Could not close HDF5 file. Aborting...\n"); return -1; } diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index fdf9169..1fa7bc9 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -24,7 +24,7 @@ static const char *progname = "h5dump"; static int d_status = EXIT_SUCCESS; static int unamedtype = 0; /* shared data type with no name */ -static int prefix_len = 1024; +static size_t prefix_len = 1024; static table_t *group_table = NULL, *dset_table = NULL, *type_table = NULL; static char *prefix; static const char *driver = NULL; /* The driver to open the file with. */ @@ -1407,7 +1407,7 @@ dump_all(hid_t group, const char *name, void * op_data) d_status = EXIT_FAILURE; ret = FAIL; } else { - int new_len = strlen(prefix) + strlen(name) + 2; + size_t new_len = strlen(prefix) + strlen(name) + 2; if (prefix_len <= new_len) { prefix_len = new_len + 1; @@ -2277,7 +2277,7 @@ handle_groups(hid_t fid, char *group, void * UNUSED data) dump_header_format->groupblockend); d_status = EXIT_FAILURE; } else { - int new_len = strlen(group) + 1; + size_t new_len = strlen(group) + 1; if (prefix_len <= new_len) { prefix_len = new_len; @@ -3526,7 +3526,7 @@ xml_print_datatype(hid_t type) } printf("\" Size=\""); sz = H5Tget_size(type); - printf("%d", sz); + printf("%u", (unsigned)sz); printf("\" />\n"); indent -= COL; indentation(indent); @@ -3557,12 +3557,12 @@ xml_print_datatype(hid_t type) } printf("\" Size=\""); sz = H5Tget_size(type); - printf("%d", sz); + printf("%u", (unsigned)sz); H5Tget_fields(type, &spos, &epos, &esize, &mpos, &msize); - printf("\" SignBitLocation=\"%d\" ", spos); - printf("ExponentBits=\"%d\" ExponentLocation=\"%d\" ", esize, epos); - printf("MantissaBits=\"%d\" MantissaLocation=\"%d\" />\n", - msize, mpos); + printf("\" SignBitLocation=\"%u\" ", (unsigned)spos); + printf("ExponentBits=\"%u\" ExponentLocation=\"%u\" ", (unsigned)esize, (unsigned)epos); + printf("MantissaBits=\"%u\" MantissaLocation=\"%u\" />\n", + (unsigned)msize, (unsigned)mpos); indent -= COL; indentation(indent); printf("</AtomicType>\n"); @@ -3631,7 +3631,7 @@ xml_print_datatype(hid_t type) printf("ERROR_UNKNOWN"); } size = H5Tget_size(type); - printf("\" Size=\"%d\"/>\n", size); + printf("\" Size=\"%u\"/>\n", (unsigned)size); indent -= COL; indentation(indent); printf("</AtomicType>\n"); @@ -3646,7 +3646,7 @@ xml_print_datatype(hid_t type) indentation(indent); printf("<OpaqueType Tag=\"%s\" ", H5Tget_tag(type)); size = H5Tget_size(type); - printf("Size=\"%d\"/>\n", size); + printf("Size=\"%u\"/>\n", (unsigned)size); indent -= COL; indentation(indent); printf("</AtomicType>\n"); diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index e7de960..c92fcfd 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -352,10 +352,9 @@ init_table(table_t **tbl) *------------------------------------------------------------------------- */ void -init_prefix(char **prefix, int prefix_len) +init_prefix(char **prefix, size_t prefix_len) { - assert(prefix_len > 0); - *prefix = HDcalloc((size_t)prefix_len, 1); + *prefix = HDcalloc(prefix_len, 1); } diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index e66fa65..d25ed5e 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -95,7 +95,7 @@ typedef struct table_t { /*this struct stores the information that is passed to the find_objs function*/ typedef struct find_objs_t { - int prefix_len; + size_t prefix_len; char *prefix; unsigned int threshold; /* should be 0 or 1 */ table_t *group_table; @@ -120,6 +120,6 @@ extern char *get_objectname(table_t*, int); extern herr_t find_objs(hid_t group, const char *name, void *op_data); extern int search_obj(table_t *temp, unsigned long *); extern void init_table(table_t **tbl); -extern void init_prefix(char **temp, int); +extern void init_prefix(char **temp, size_t ); #endif /* H5TOOLS_UTILS_H__ */ |