summaryrefslogtreecommitdiffstats
path: root/src/H5Defl.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-01-08 16:54:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-01-08 16:54:49 (GMT)
commit596f9b43271b088bf4f13783024f0a75ac05011c (patch)
treed1c30cb9aa9a74cda2ab95e3a94e954375398197 /src/H5Defl.c
parentde5e1d93e44fdab49ab2d6b3bad4042219ad5236 (diff)
downloadhdf5-596f9b43271b088bf4f13783024f0a75ac05011c.zip
hdf5-596f9b43271b088bf4f13783024f0a75ac05011c.tar.gz
hdf5-596f9b43271b088bf4f13783024f0a75ac05011c.tar.bz2
[svn-r16278] Description:
Update layout information in DCPL to unify all information in one underlying property and switch to using H5O_layout_t for storing it, which simplifies things considerably. Also, fix many compiler warnings. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.6 (amazon) in debug mode Mac OS X/32 10.5.6 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5Defl.c')
-rw-r--r--src/H5Defl.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/H5Defl.c b/src/H5Defl.c
index 2dcad4d..880edfd 100644
--- a/src/H5Defl.c
+++ b/src/H5Defl.c
@@ -132,7 +132,6 @@ H5D_efl_new(H5F_t *f, hid_t UNUSED dapl_id, hid_t UNUSED dxpl_id, H5D_t *dset,
* Also, only the slowest varying dimension of a simple data space
* can be extendible (currently only for external data storage).
*/
- dset->shared->layout.u.contig.addr = HADDR_UNDEF; /* Initialize to no address */
/* Check for invalid dataset dimensions */
if((ndims = H5S_get_simple_extent_dims(dset->shared->space, dim, max_dim)) < 0)
@@ -150,12 +149,12 @@ H5D_efl_new(H5F_t *f, hid_t UNUSED dapl_id, hid_t UNUSED dxpl_id, H5D_t *dset,
max_storage = H5O_efl_total_size(&dset->shared->dcpl_cache.efl);
if(H5S_UNLIMITED == max_points) {
if(H5O_EFL_UNLIMITED != max_storage)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unlimited data space but finite storage")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unlimited dataspace but finite storage")
} /* end if */
else if((max_points * dt_size) < max_points)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "data space * type size overflowed")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "dataspace * type size overflowed")
else if((max_points * dt_size) > max_storage)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "data space size exceeds external storage size")
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "dataspace size exceeds external storage size")
/* Compute the total size of dataset */
tmp_size = H5S_GET_EXTENT_NPOINTS(dset->shared->space) * dt_size;
@@ -261,12 +260,11 @@ H5D_efl_read(const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf)
#else /* NDEBUG */
to_read = MIN((size_t)(efl->slot[u].size-skip), size);
#endif /* NDEBUG */
- if ((n=HDread (fd, buf, to_read))<0) {
- HGOTO_ERROR (H5E_EFL, H5E_READERROR, FAIL, "read error in external raw data file")
- } else if ((size_t)n<to_read) {
- HDmemset (buf+n, 0, to_read-n);
- }
- HDclose (fd);
+ if((n = HDread(fd, buf, to_read)) < 0)
+ HGOTO_ERROR(H5E_EFL, H5E_READERROR, FAIL, "read error in external raw data file")
+ else if((size_t)n < to_read)
+ HDmemset(buf + n, 0, to_read - (size_t)n);
+ HDclose(fd);
fd = -1;
size -= to_read;
buf += to_read;