diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2015-04-21 16:57:33 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2015-04-21 16:57:33 (GMT) |
commit | 11b19627b9ac9a97af2970dac92e378baeb9fc1e (patch) | |
tree | 78988ac90fce00ca5270c93d47a7d5235e97efe5 /src/H5Dio.c | |
parent | 6813b25007280afa9b8bec13c19c134029acd26c (diff) | |
parent | b32caab787236a72c25dcb1c895c32da8832deab (diff) | |
download | hdf5-11b19627b9ac9a97af2970dac92e378baeb9fc1e.zip hdf5-11b19627b9ac9a97af2970dac92e378baeb9fc1e.tar.gz hdf5-11b19627b9ac9a97af2970dac92e378baeb9fc1e.tar.bz2 |
[svn-r26867] svn merge -r26837:26866 https://svn.hdfgroup.uiuc.edu/hdf5/trunk
Diffstat (limited to 'src/H5Dio.c')
-rw-r--r-- | src/H5Dio.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c index 1c77d93..44080dc 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -302,8 +302,6 @@ H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, uint32_t direct_filters; hsize_t *direct_offset; uint32_t direct_datasize; - int ndims = 0; - hsize_t dims[H5O_LAYOUT_NDIMS]; hsize_t internal_offset[H5O_LAYOUT_NDIMS]; unsigned u; /* Local index variable */ @@ -324,12 +322,9 @@ H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, /* The library's chunking code requires the offset terminates with a zero. So transfer the * offset array to an internal offset array */ - if((ndims = H5S_get_simple_extent_dims(dset->shared->space, dims, NULL)) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve dataspace extent dims") - - for(u = 0; u < (unsigned)ndims; u++) { + for(u = 0; u < dset->shared->ndims; u++) { /* Make sure the offset doesn't exceed the dataset's dimensions */ - if(direct_offset[u] > dims[u]) + if(direct_offset[u] > dset->shared->curr_dims[u]) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "offset exceeds dimensions of dataset") /* Make sure the offset fall right on a chunk's boundary */ @@ -340,7 +335,7 @@ H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, } /* end for */ /* Terminate the offset with a zero */ - internal_offset[ndims] = 0; + internal_offset[dset->shared->ndims] = 0; /* write raw data */ if(H5D__chunk_direct_write(dset, dxpl_id, direct_filters, internal_offset, direct_datasize, buf) < 0) |