diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2001-06-18 20:22:10 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2001-06-18 20:22:10 (GMT) |
commit | d41b9fffdfca2e97c36bc0ad0899fbb7b055f926 (patch) | |
tree | 51ed39b08a41a4f6947af07630eb40dfdb013d87 /tools/gifconv/readhdf.c | |
parent | fcaf572430a8eda3f6519bd21311ef7a8e3c3c1f (diff) | |
download | hdf5-d41b9fffdfca2e97c36bc0ad0899fbb7b055f926.zip hdf5-d41b9fffdfca2e97c36bc0ad0899fbb7b055f926.tar.gz hdf5-d41b9fffdfca2e97c36bc0ad0899fbb7b055f926.tar.bz2 |
[svn-r4012] Purpose:
Clean up compiler warnings.
Description:
Just code neatening mostly, some casts, etc.
Platforms tested:
FreeBSD 4.3 (hawkwind)
Diffstat (limited to 'tools/gifconv/readhdf.c')
-rw-r--r-- | tools/gifconv/readhdf.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/tools/gifconv/readhdf.c b/tools/gifconv/readhdf.c index a7101c9..52a1837 100644 --- a/tools/gifconv/readhdf.c +++ b/tools/gifconv/readhdf.c @@ -35,14 +35,10 @@ int ReadHDF(BYTE** data , herr_t status; /* status variable */ hid_t dspace; /* dataspace identifier for the the dataset */ hid_t dset; /* dataset identifier */ - 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 */ hsize_t maxdims; /* dummy */ - int pal_exist = 0; /* do we have a palette? */ /* check stuff */ @@ -85,7 +81,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; } @@ -98,11 +94,8 @@ int ReadHDF(BYTE** data , } if (pal_exist) { - hsize_t pal_size[2]; - hsize_t max_pal_dims[2]; + hsize_t loc_pal_size[2]; hsize_t pal_datasize; - CHAR *pal_path; - BYTE *temp_buf; hsize_t temp_size; @@ -121,19 +114,19 @@ int ReadHDF(BYTE** data , } /* get the dimension size of the palette. */ - if (H5Sget_simple_extent_dims(pal_space , pal_size , &max_pal_dims) !=2 ) { + if (H5Sget_simple_extent_dims(pal_space , loc_pal_size , NULL) !=2 ) { fprintf(stderr , "Unable to get dimension info\n"); pal_exist = 0; return -1; } /* size needed to store the image */ - pal_datasize = pal_size[0] * pal_size[1]; + pal_datasize = loc_pal_size[0] * loc_pal_size[1]; /* 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) @@ -152,7 +145,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); |