diff options
author | Jordan Henderson <jhenderson@hdfgroup.org> | 2017-08-11 19:25:33 (GMT) |
---|---|---|
committer | Jordan Henderson <jhenderson@hdfgroup.org> | 2017-08-11 19:25:33 (GMT) |
commit | c34ee0b2a5fe8c142f58f31e44fd6eb53ecf8ba6 (patch) | |
tree | 8cc64cb219d19230d8f9454e19693610cb33a2b0 /src/H5Dint.c | |
parent | 1eb775801535d787c521caaf72d68856eeb3b09c (diff) | |
parent | a6d5bf1a86250cc660cd1ed420eeda6940792be5 (diff) | |
download | hdf5-c34ee0b2a5fe8c142f58f31e44fd6eb53ecf8ba6.zip hdf5-c34ee0b2a5fe8c142f58f31e44fd6eb53ecf8ba6.tar.gz hdf5-c34ee0b2a5fe8c142f58f31e44fd6eb53ecf8ba6.tar.bz2 |
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/hdffv/hdf5 into develop
Diffstat (limited to 'src/H5Dint.c')
-rw-r--r-- | src/H5Dint.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c index 0928afe..bdedd1e 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -745,8 +745,13 @@ H5D__cache_dataspace_info(const H5D_t *dset) dset->shared->ndims = (unsigned)sndims; /* Compute the inital 'power2up' values */ - for(u = 0; u < dset->shared->ndims; u++) - dset->shared->curr_power2up[u] = H5VM_power2up(dset->shared->curr_dims[u]); + for(u = 0; u < dset->shared->ndims; u++) { + hsize_t scaled_power2up; /* Scaled value, rounded to next power of 2 */ + + if( !(scaled_power2up = H5VM_power2up(dset->shared->curr_dims[u])) ) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") + dset->shared->curr_power2up[u] = scaled_power2up; + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -2805,8 +2810,11 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) dset->shared->cache.chunk.scaled_dims[u] > dset->shared->cache.chunk.nslots)) update_chunks = TRUE; + if( !(scaled_power2up = H5VM_power2up(scaled)) ) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get the next power of 2") + /* Check if the number of bits required to encode the scaled size value changed */ - if(dset->shared->cache.chunk.scaled_power2up[u] != (scaled_power2up = H5VM_power2up(scaled))) { + if(dset->shared->cache.chunk.scaled_power2up[u] != scaled_power2up) { /* Update the 'power2up' & 'encode_bits' values for the current dimension */ dset->shared->cache.chunk.scaled_power2up[u] = scaled_power2up; dset->shared->cache.chunk.scaled_encode_bits[u] = H5VM_log2_gen(scaled_power2up); |