diff options
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) |