summaryrefslogtreecommitdiffstats
path: root/src/H5Defl.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-09-10 19:10:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-09-10 19:10:41 (GMT)
commitc465e18a68f2a77550d93366a5b6c8fac2e24502 (patch)
treebd3649f75f1507040b68d8e15c63333600816360 /src/H5Defl.c
parent068620ea815d8590982069cfb6374e07d3c8e1e6 (diff)
downloadhdf5-c465e18a68f2a77550d93366a5b6c8fac2e24502.zip
hdf5-c465e18a68f2a77550d93366a5b6c8fac2e24502.tar.gz
hdf5-c465e18a68f2a77550d93366a5b6c8fac2e24502.tar.bz2
[svn-r15609] Description:
Omnibus compiler warning cleanup & some reformatting also. Tested on: Mac OS X/32 10.5.4 (amazon) Too minor to require h5committest
Diffstat (limited to 'src/H5Defl.c')
-rw-r--r--src/H5Defl.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/H5Defl.c b/src/H5Defl.c
index 15bcd60..1fe0f37 100644
--- a/src/H5Defl.c
+++ b/src/H5Defl.c
@@ -110,7 +110,7 @@ static herr_t
H5D_efl_new(H5F_t *f, hid_t UNUSED dxpl_id, H5D_t *dset,
const H5P_genplist_t *dc_plist)
{
- const H5T_t *type = dset->shared->type; /* Convenience pointer to dataset's datatype */
+ size_t dt_size; /* Size of datatype */
hsize_t dim[H5O_LAYOUT_NDIMS]; /* Current size of data in elements */
hsize_t max_dim[H5O_LAYOUT_NDIMS]; /* Maximum size of data in elements */
hssize_t tmp_size; /* Temporary holder for raw data size */
@@ -141,6 +141,10 @@ H5D_efl_new(H5F_t *f, hid_t UNUSED dxpl_id, H5D_t *dset,
if(max_dim[i] > dim[i])
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "only the first dimension can be extendible")
+ /* Retrieve the size of the dataset's datatype */
+ if(0 == (dt_size = H5T_get_size(dset->shared->type)))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to determine datatype size")
+
/* Check for storage overflows */
max_points = H5S_get_npoints_max(dset->shared->space);
max_storage = H5O_efl_total_size(&dset->shared->dcpl_cache.efl);
@@ -148,13 +152,13 @@ H5D_efl_new(H5F_t *f, hid_t UNUSED dxpl_id, H5D_t *dset,
if(H5O_EFL_UNLIMITED != max_storage)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unlimited data space but finite storage")
} /* end if */
- else if(max_points * H5T_get_size(type) < max_points)
+ else if((max_points * dt_size) < max_points)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "data space * type size overflowed")
- else if(max_points * H5T_get_size(type) > max_storage)
+ else if((max_points * dt_size) > max_storage)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "data space size exceeds external storage size")
/* Compute the total size of dataset */
- tmp_size = H5S_GET_EXTENT_NPOINTS(dset->shared->space) * H5T_get_size(type);
+ tmp_size = H5S_GET_EXTENT_NPOINTS(dset->shared->space) * dt_size;
H5_ASSIGN_OVERFLOW(dset->shared->layout.u.contig.size, tmp_size, hssize_t, hsize_t);
/* Get the sieve buffer size for this dataset */