diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-07-03 17:48:26 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-07-03 17:48:26 (GMT) |
commit | 1aecbad47ffb0408063242d582a7d370e289330a (patch) | |
tree | 49116315f047b829ed3a3f9b25fb68aea77cc05a /src/H5Distore.c | |
parent | 2dfde3e4fccc6e5b2f9627af688d347693d2ecef (diff) | |
download | hdf5-1aecbad47ffb0408063242d582a7d370e289330a.zip hdf5-1aecbad47ffb0408063242d582a7d370e289330a.tar.gz hdf5-1aecbad47ffb0408063242d582a7d370e289330a.tar.bz2 |
[svn-r13935] Description:
Another minor code cleanup to chunked storage "init by extent" routine.
Tested on:
Mac OS X/32 10.4.10 (amazon)
Linux/32 2.6 (chicago)
Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5Distore.c')
-rw-r--r-- | src/H5Distore.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/H5Distore.c b/src/H5Distore.c index d2520cc..3979746 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -3431,8 +3431,11 @@ H5D_istore_initialize_by_extent(H5D_io_info_t *io_info) hsize_t bytes_accessed; /* Bytes accessed in chunk */ /* Compute the # of elements to leave with existing value, in each dimension */ - for(u = 0; u < rank; u++) - count[u] = MIN((chunk_offset[u] + layout->u.chunk.dim[u]), dset_dims[u] - chunk_offset[u]); + /* And, the number of bytes in the chunk being accessed */ + for(u = 0, bytes_kept = layout->u.chunk.dim[rank]; u < rank; u++) { + count[u] = MIN(layout->u.chunk.dim[u], (dset_dims[u] - chunk_offset[u])); + bytes_kept *= count[u]; + } /* end for */ #ifdef H5D_ISTORE_DEBUG HDfputs("cache:initialize:offset:[", stdout); @@ -3470,14 +3473,8 @@ H5D_istore_initialize_by_extent(H5D_io_info_t *io_info) if(H5S_select_fill(fill->buf, (size_t)dset_dims[rank], space_chunk, chunk) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "filling selection failed") - /* The number of bytes in the chunk being accessed */ - for(u = 0, bytes_kept = 1; u < layout->u.chunk.ndims; u++) { - hsize_t sub_size; /* Size of chunk accessed in a given dimension */ - - sub_size = MIN((chunk_offset[u] + layout->u.chunk.dim[u]), dset_dims[u]) - - chunk_offset[u]; - bytes_kept *= sub_size; - } /* end for */ + /* The number of bytes accessed in the chunk */ + /* (i.e. the bytes replaced with fill values) */ bytes_accessed = bytes_per_chunk - bytes_kept; /* Release lock on chunk */ |