summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2021-03-10 21:51:21 (GMT)
committerGitHub <noreply@github.com>2021-03-10 21:51:21 (GMT)
commitbf4399bd25eef9886dab5dcb115e2e439e3a2ac9 (patch)
treeb54cb4ef5e607a222a5589400976c0a4e06e4821 /examples
parente5a2d01cd9e3b5fd34d265fe281f638316894f7a (diff)
downloadhdf5-bf4399bd25eef9886dab5dcb115e2e439e3a2ac9.zip
hdf5-bf4399bd25eef9886dab5dcb115e2e439e3a2ac9.tar.gz
hdf5-bf4399bd25eef9886dab5dcb115e2e439e3a2ac9.tar.bz2
Hdf5 merge issue 435 v110 (#462)
* close #195. (#196) * Update HDF5PluginMacros.cmake * Update HDF5PluginMacros.cmake * Modify temporary rpath for testing in java example scripts. (#230) * Fix undefined left shifting of negative numbers (#338) Undefined Bahavior Sanitizer errored here about left shifting negative numbers. * Update license url (#332) * Modify temporary rpath for testing in java example scripts. * Update URL in source file Copyright headers for web copy of COPYING file - src and test directories. * Fixed clang-tidy readability-misleading-indentation warnings (#427) * Fixed clang-tidy readability-misleading-indentation warnings * Reformatted src/H5Zscaleoffset.c with clang v10.0.1. Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * Fixed clang-tidy readability-redundant-control-flow warnings (#428) * Fixed clang-tidy readability-redundant-control-flow warnings Just removed useless trailing return statements. * Removed blank lines from h5diffgentest.c with clang-format v10.0.1. Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * Removed bad function pointer casts (#434) * Removed bad function pointer casts In one case fixed the actual function signature to be correct. * Reformat source with clang v10.0.1. Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * fix block coordinate printing example (#437) Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org> Co-authored-by: Sean McBride <sean@rogue-research.com> Co-authored-by: Mike Smith <grimbough@gmail.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/h5_vds.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/h5_vds.c b/examples/h5_vds.c
index 6bef06f..e036204 100644
--- a/examples/h5_vds.c
+++ b/examples/h5_vds.c
@@ -60,7 +60,7 @@ main(void)
hsize_t start_out[2], stride_out[2], count_out[2], block_out[2];
int wdata[DIM0], /* Write buffer for source dataset */
rdata[VDSDIM0][VDSDIM1], /* Read buffer for virtual dataset */
- i, j, k, l;
+ i, j, k, l, block_inc;
int fill_value = -1; /* Fill value for VDS */
H5D_layout_t layout; /* Storage layout */
size_t num_map; /* Number of mappings */
@@ -178,13 +178,14 @@ main(void)
buf = (hsize_t *)malloc(sizeof(hsize_t) * 2 * RANK2 * nblocks);
status = H5Sget_select_hyper_blocklist(vspace, (hsize_t)0, nblocks, buf);
for (l = 0; l < nblocks; l++) {
+ block_inc = 2 * RANK2 * l;
printf("(");
for (k = 0; k < RANK2 - 1; k++)
- printf("%d,", (int)buf[k]);
- printf("%d ) - (", (int)buf[k]);
+ printf("%d,", (int)buf[block_inc + k]);
+ printf("%d) - (", (int)buf[block_inc + k]);
for (k = 0; k < RANK2 - 1; k++)
- printf("%d,", (int)buf[RANK2 + k]);
- printf("%d)\n", (int)buf[RANK2 + k]);
+ printf("%d,", (int)buf[block_inc + RANK2 + k]);
+ printf("%d)\n", (int)buf[block_inc + RANK2 + k]);
}
/* We also can use new APIs to get start, stride, count and block */
if (H5Sis_regular_hyperslab(vspace)) {