diff options
author | MuQun Yang <ymuqun@hdfgroup.org> | 2002-05-03 22:38:20 (GMT) |
---|---|---|
committer | MuQun Yang <ymuqun@hdfgroup.org> | 2002-05-03 22:38:20 (GMT) |
commit | 218c644da5d74731d3d732715a4ff89a68772816 (patch) | |
tree | b1db5e23c6149dc11321e28e5eeb061f3beafbab | |
parent | 686a62c1d7d6784f469164395403a7fdf6502b5b (diff) | |
download | hdf5-218c644da5d74731d3d732715a4ff89a68772816.zip hdf5-218c644da5d74731d3d732715a4ff89a68772816.tar.gz hdf5-218c644da5d74731d3d732715a4ff89a68772816.tar.bz2 |
[svn-r5355]
Purpose:
code clean up to erase windows warnings
Description:
need to clean up more
Solution:
Platforms tested:
window 2000, linux
-rw-r--r-- | hl/tools/gif2h5/gifread.c | 2 | ||||
-rw-r--r-- | hl/tools/gif2h5/hdf2gif.c | 14 | ||||
-rw-r--r-- | hl/tools/gif2h5/hdfgifwr.c | 1 | ||||
-rw-r--r-- | hl/tools/gif2h5/readhdf.c | 8 | ||||
-rw-r--r-- | hl/tools/gif2h5/writehdf.c | 9 | ||||
-rw-r--r-- | tools/gifconv/gifread.c | 2 | ||||
-rw-r--r-- | tools/gifconv/hdf2gif.c | 14 | ||||
-rw-r--r-- | tools/gifconv/hdfgifwr.c | 1 | ||||
-rw-r--r-- | tools/gifconv/readhdf.c | 8 | ||||
-rw-r--r-- | tools/gifconv/writehdf.c | 9 |
10 files changed, 38 insertions, 30 deletions
diff --git a/hl/tools/gif2h5/gifread.c b/hl/tools/gif2h5/gifread.c index 1196241..f2fefff 100644 --- a/hl/tools/gif2h5/gifread.c +++ b/hl/tools/gif2h5/gifread.c @@ -116,7 +116,7 @@ BYTE **MemGif2; /* GIF image file input FILE stream */ { register WORD i; /* Loop counter */ WORD tableSize; /* Number of entries in the Local Color Table */ - BYTE Interlace; /* PackedField & 0x20 gives information on interlacing */ + /*BYTE Interlace; */ /* PackedField & 0x20 gives information on interlacing */ BYTE *TempPtr; int ch , ch1; diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c index 9c4133e..1efc565 100644 --- a/hl/tools/gif2h5/hdf2gif.c +++ b/hl/tools/gif2h5/hdf2gif.c @@ -10,6 +10,7 @@ #include "gif.h" #include <stdio.h> +#include <assert.h> #define MAX_FILE_LEN 256 #define MAX_NUMBER_IMAGES 50 @@ -188,12 +189,17 @@ int main(int argc , char **argv) { return -1; } - w = dim_sizes[1]; + assert(dim_sizes[0]==(hsize_t)((int)dim_sizes[0])); + assert(dim_sizes[1]==(hsize_t)((int)dim_sizes[1])); + RWidth = (int)dim_sizes[1]; + RHeight = (int)dim_sizes[0]; + +#ifdef UNUSED + w = dim_sizes[1]; h = dim_sizes[0]; - RWidth = dim_sizes[1]; - RHeight = dim_sizes[0]; LeftOfs = TopOfs = 0; +#endif /*UNUSED */ /* If the first image does not have a palette, I make my own global color table @@ -331,7 +337,7 @@ int main(int argc , char **argv) { fputc (InitCodeSize , fpGif); - i = hdfWriteGIF(fpGif , Image , 0 , dim_sizes[0] , dim_sizes[1] , r1, g1 , b1 , pc2nc , 256 , 8 , BitsPerPixel); + hdfWriteGIF(fpGif , Image , 0 , dim_sizes[0] , dim_sizes[1] , r1, g1 , b1 , pc2nc , 256 , 8 , BitsPerPixel); fputc(0x00 , fpGif); free (Image); } diff --git a/hl/tools/gif2h5/hdfgifwr.c b/hl/tools/gif2h5/hdfgifwr.c index 28d556e..24a833d 100644 --- a/hl/tools/gif2h5/hdfgifwr.c +++ b/hl/tools/gif2h5/hdfgifwr.c @@ -163,7 +163,6 @@ static unsigned long cur_accum = 0; static int cur_bits = 0; #define MAXCODE(n_bits) ( (1 << (n_bits)) - 1) -#define min(a,b) ((a>b) ? b : a) #define XV_BITS 12 /* BITS was already defined on some systems */ #define MSDOS 1 #define HSIZE 5003 /* 80% occupancy */ diff --git a/hl/tools/gif2h5/readhdf.c b/hl/tools/gif2h5/readhdf.c index b9a80cd..602c48f 100644 --- a/hl/tools/gif2h5/readhdf.c +++ b/hl/tools/gif2h5/readhdf.c @@ -38,7 +38,6 @@ int ReadHDF(BYTE** data , hid_t pal_set; /* dataset for palette */ hid_t pal_space;/* dataspace for palette */ - hsize_t pal_size; /* size of the palette */ hsize_t datasize; /* size of the image */ @@ -84,7 +83,7 @@ int ReadHDF(BYTE** data , datasize = image_size[0] * image_size[1]; /* allocate memory to store the image */ - if ((*data = (BYTE*) malloc(datasize)) == NULL) { + if ((*data = (BYTE*) malloc((size_t)datasize)) == NULL) { fprintf(stderr , "Out of memory, exiting"); return -1; } @@ -99,7 +98,6 @@ int ReadHDF(BYTE** data , if (pal_exist) { hsize_t pal_size[2]; hsize_t pal_datasize; - CHAR *pal_path; BYTE *temp_buf; hsize_t temp_size; @@ -131,7 +129,7 @@ int ReadHDF(BYTE** data , /* copy stuff into a temp buffer and then copy 256*3 elements to palette */ temp_size = H5Dget_storage_size(pal_set); - temp_buf = (BYTE*) malloc (temp_size * sizeof(BYTE)); + temp_buf = (BYTE*) malloc ((size_t)temp_size * sizeof(BYTE)); /* make sure that the palette is actually 256 X 3 so that we don't create overflows */ if (pal_datasize > 256 * 3) @@ -150,7 +148,7 @@ int ReadHDF(BYTE** data , } /* copy stuff into the actual palette */ - memcpy(palette , temp_buf , pal_datasize); + memcpy(palette , temp_buf , (size_t)pal_datasize); /* get rid of the temp memory */ cleanup(temp_buf); diff --git a/hl/tools/gif2h5/writehdf.c b/hl/tools/gif2h5/writehdf.c index f5c077f..53cf9be 100644 --- a/hl/tools/gif2h5/writehdf.c +++ b/hl/tools/gif2h5/writehdf.c @@ -23,10 +23,11 @@ int write_text_attribute(hid_t dataset_id , char *attr_name , char *attr_value) /* figure out size of the data */ attr_dims_size = strlen(attr_value) + 1; + /* set the type to string */ attr_type_id = H5Tcopy(H5T_C_S1); - H5Tset_size(attr_type_id , attr_dims_size); + H5Tset_size(attr_type_id , (size_t)attr_dims_size); /* create the dataspace for the attribute */ attr_dataspace_id = H5Screate_simple(1 , &attr_dims_size , NULL); @@ -66,10 +67,10 @@ char *GIFFileName; ApplicationCount , /* number of application extensions */ PlainTextCount; /* number of plain text extensions */ - char ImageName[256], /* Image name for the GR Image */ - CommentName[256], + char ImageName[256]; /* Image name for the GR Image */ + /* CommentName[256], ApplicationName[256], - PlainTextName[256]; + PlainTextName[256]; */ char GroupName[VSNAMELENMAX]; /* so that we can name the subgroups appropriately */ diff --git a/tools/gifconv/gifread.c b/tools/gifconv/gifread.c index 1196241..f2fefff 100644 --- a/tools/gifconv/gifread.c +++ b/tools/gifconv/gifread.c @@ -116,7 +116,7 @@ BYTE **MemGif2; /* GIF image file input FILE stream */ { register WORD i; /* Loop counter */ WORD tableSize; /* Number of entries in the Local Color Table */ - BYTE Interlace; /* PackedField & 0x20 gives information on interlacing */ + /*BYTE Interlace; */ /* PackedField & 0x20 gives information on interlacing */ BYTE *TempPtr; int ch , ch1; diff --git a/tools/gifconv/hdf2gif.c b/tools/gifconv/hdf2gif.c index 9c4133e..1efc565 100644 --- a/tools/gifconv/hdf2gif.c +++ b/tools/gifconv/hdf2gif.c @@ -10,6 +10,7 @@ #include "gif.h" #include <stdio.h> +#include <assert.h> #define MAX_FILE_LEN 256 #define MAX_NUMBER_IMAGES 50 @@ -188,12 +189,17 @@ int main(int argc , char **argv) { return -1; } - w = dim_sizes[1]; + assert(dim_sizes[0]==(hsize_t)((int)dim_sizes[0])); + assert(dim_sizes[1]==(hsize_t)((int)dim_sizes[1])); + RWidth = (int)dim_sizes[1]; + RHeight = (int)dim_sizes[0]; + +#ifdef UNUSED + w = dim_sizes[1]; h = dim_sizes[0]; - RWidth = dim_sizes[1]; - RHeight = dim_sizes[0]; LeftOfs = TopOfs = 0; +#endif /*UNUSED */ /* If the first image does not have a palette, I make my own global color table @@ -331,7 +337,7 @@ int main(int argc , char **argv) { fputc (InitCodeSize , fpGif); - i = hdfWriteGIF(fpGif , Image , 0 , dim_sizes[0] , dim_sizes[1] , r1, g1 , b1 , pc2nc , 256 , 8 , BitsPerPixel); + hdfWriteGIF(fpGif , Image , 0 , dim_sizes[0] , dim_sizes[1] , r1, g1 , b1 , pc2nc , 256 , 8 , BitsPerPixel); fputc(0x00 , fpGif); free (Image); } diff --git a/tools/gifconv/hdfgifwr.c b/tools/gifconv/hdfgifwr.c index 28d556e..24a833d 100644 --- a/tools/gifconv/hdfgifwr.c +++ b/tools/gifconv/hdfgifwr.c @@ -163,7 +163,6 @@ static unsigned long cur_accum = 0; static int cur_bits = 0; #define MAXCODE(n_bits) ( (1 << (n_bits)) - 1) -#define min(a,b) ((a>b) ? b : a) #define XV_BITS 12 /* BITS was already defined on some systems */ #define MSDOS 1 #define HSIZE 5003 /* 80% occupancy */ diff --git a/tools/gifconv/readhdf.c b/tools/gifconv/readhdf.c index b9a80cd..602c48f 100644 --- a/tools/gifconv/readhdf.c +++ b/tools/gifconv/readhdf.c @@ -38,7 +38,6 @@ int ReadHDF(BYTE** data , hid_t pal_set; /* dataset for palette */ hid_t pal_space;/* dataspace for palette */ - hsize_t pal_size; /* size of the palette */ hsize_t datasize; /* size of the image */ @@ -84,7 +83,7 @@ int ReadHDF(BYTE** data , datasize = image_size[0] * image_size[1]; /* allocate memory to store the image */ - if ((*data = (BYTE*) malloc(datasize)) == NULL) { + if ((*data = (BYTE*) malloc((size_t)datasize)) == NULL) { fprintf(stderr , "Out of memory, exiting"); return -1; } @@ -99,7 +98,6 @@ int ReadHDF(BYTE** data , if (pal_exist) { hsize_t pal_size[2]; hsize_t pal_datasize; - CHAR *pal_path; BYTE *temp_buf; hsize_t temp_size; @@ -131,7 +129,7 @@ int ReadHDF(BYTE** data , /* copy stuff into a temp buffer and then copy 256*3 elements to palette */ temp_size = H5Dget_storage_size(pal_set); - temp_buf = (BYTE*) malloc (temp_size * sizeof(BYTE)); + temp_buf = (BYTE*) malloc ((size_t)temp_size * sizeof(BYTE)); /* make sure that the palette is actually 256 X 3 so that we don't create overflows */ if (pal_datasize > 256 * 3) @@ -150,7 +148,7 @@ int ReadHDF(BYTE** data , } /* copy stuff into the actual palette */ - memcpy(palette , temp_buf , pal_datasize); + memcpy(palette , temp_buf , (size_t)pal_datasize); /* get rid of the temp memory */ cleanup(temp_buf); diff --git a/tools/gifconv/writehdf.c b/tools/gifconv/writehdf.c index f5c077f..53cf9be 100644 --- a/tools/gifconv/writehdf.c +++ b/tools/gifconv/writehdf.c @@ -23,10 +23,11 @@ int write_text_attribute(hid_t dataset_id , char *attr_name , char *attr_value) /* figure out size of the data */ attr_dims_size = strlen(attr_value) + 1; + /* set the type to string */ attr_type_id = H5Tcopy(H5T_C_S1); - H5Tset_size(attr_type_id , attr_dims_size); + H5Tset_size(attr_type_id , (size_t)attr_dims_size); /* create the dataspace for the attribute */ attr_dataspace_id = H5Screate_simple(1 , &attr_dims_size , NULL); @@ -66,10 +67,10 @@ char *GIFFileName; ApplicationCount , /* number of application extensions */ PlainTextCount; /* number of plain text extensions */ - char ImageName[256], /* Image name for the GR Image */ - CommentName[256], + char ImageName[256]; /* Image name for the GR Image */ + /* CommentName[256], ApplicationName[256], - PlainTextName[256]; + PlainTextName[256]; */ char GroupName[VSNAMELENMAX]; /* so that we can name the subgroups appropriately */ |