summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-01-17 20:34:14 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-01-17 20:34:14 (GMT)
commit1208e94eff8223d5c68bd7d50c4b885df222122a (patch)
treee740ea0e3b23176f5e194d7e98def93ec33d5b0e /src/H5D.c
parent6f667500c1f163a7fd9cb15945078c3fef622ab1 (diff)
downloadhdf5-1208e94eff8223d5c68bd7d50c4b885df222122a.zip
hdf5-1208e94eff8223d5c68bd7d50c4b885df222122a.tar.gz
hdf5-1208e94eff8223d5c68bd7d50c4b885df222122a.tar.bz2
[svn-r6296] Purpose:
Code cleanup Description: Reduce warnings on Windows Platforms tested: FreeBSD 4.7 (sleipnir)
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 1037f4b..8b312df 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -1926,21 +1926,27 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type,
break;
case H5D_COMPACT:
- /*
- * Compact dataset is stored in dataset object header message of
- * layout.
- */
- new_dset->layout.size = H5S_get_simple_extent_npoints(space) *
- H5T_get_size(type);
- /* Verify data size is smaller than maximum header message size
- * (64KB) minus other layout message fields.
- */
- comp_data_size=H5O_MAX_SIZE-H5O_layout_meta_size(file, &(new_dset->layout));
- if(new_dset->layout.size > comp_data_size)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "compact dataset size is bigger than header message maximum size");
- if ((ndims=H5S_get_simple_extent_dims(space, new_dset->layout.dim, max_dim))<0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize dimension size of compact dataset storage");
- /* remember to check if size is small enough to fit header message */
+ {
+ hssize_t tmp_size; /* Temporary holder for raw data size */
+
+ /*
+ * Compact dataset is stored in dataset object header message of
+ * layout.
+ */
+ tmp_size = H5S_get_simple_extent_npoints(space) *
+ H5T_get_size(type);
+ H5_ASSIGN_OVERFLOW(new_dset->layout.size,tmp_size,hssize_t,size_t);
+ /* Verify data size is smaller than maximum header message size
+ * (64KB) minus other layout message fields.
+ */
+ comp_data_size=H5O_MAX_SIZE-H5O_layout_meta_size(file, &(new_dset->layout));
+ if(new_dset->layout.size > comp_data_size)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "compact dataset size is bigger than header message maximum size");
+ if ((ndims=H5S_get_simple_extent_dims(space, new_dset->layout.dim, max_dim))<0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize dimension size of compact dataset storage");
+ /* remember to check if size is small enough to fit header message */
+
+ }
break;