summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKimmy Mu <kmu@hdfgroup.org>2020-01-28 19:28:26 (GMT)
committerKimmy Mu <kmu@hdfgroup.org>2020-01-28 19:28:26 (GMT)
commit71c050f837149a0c11e0936e661047c091deaa2f (patch)
tree05bc0afc7c0907369e7e6ac2953689229e63d76f /test
parent57dd6d9864f79a4c4d89865978628219145a1ab0 (diff)
parent406330addf45529ecdd088f4d22e9aab9a03661d (diff)
downloadhdf5-71c050f837149a0c11e0936e661047c091deaa2f.zip
hdf5-71c050f837149a0c11e0936e661047c091deaa2f.tar.gz
hdf5-71c050f837149a0c11e0936e661047c091deaa2f.tar.bz2
Merge pull request #2311 in HDFFV/hdf5 from ~KMU/hdf5:misc to develop
* commit '406330addf45529ecdd088f4d22e9aab9a03661d': rename macro change condition pick up from Dave's fix leave Wswitch-default for later fix fix Wredundant-decls, Wswitch-default, Wdeclaration-after-statement, Wsign-compare, Wmisleading-indentation, Wshadow
Diffstat (limited to 'test')
-rw-r--r--test/use_common.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/test/use_common.c b/test/use_common.c
index 9effa06..4111b24 100644
--- a/test/use_common.c
+++ b/test/use_common.c
@@ -343,44 +343,45 @@ int write_uc_file(hbool_t tosend, hid_t fid)
count[1]=dims[1];
count[2]=dims[2];
for (i=0; i<UC_opts.nplanes; i++){
- /* fill buffer with value i+1 */
- bufptr = buffer;
- for (j=0; j<dims[1]; j++)
- for (k=0; k<dims[2]; k++)
- *bufptr++ = (UC_CTYPE)i;
+ /* fill buffer with value i+1 */
+ bufptr = buffer;
+ for (j=0; j<dims[1]; j++)
+ for (k=0; k<dims[2]; k++)
+ *bufptr++ = (UC_CTYPE)i;
/* Cork the dataset's metadata in the cache, if SWMR is enabled */
- if(UC_opts.use_swmr)
+ if(UC_opts.use_swmr) {
if(H5Odisable_mdc_flushes(dsid) < 0) {
HDfprintf(stderr, "H5Odisable_mdc_flushes failed\n");
return -1;
}
+ }
- /* extend the dataset by one for new plane */
- dims[0]=i+1;
+ /* extend the dataset by one for new plane */
+ dims[0]=i+1;
if(H5Dset_extent(dsid, dims) < 0){
HDfprintf(stderr, "H5Dset_extent failed\n");
return -1;
- }
+ }
/* Get the dataset's dataspace */
if((f_sid = H5Dget_space(dsid)) < 0){
HDfprintf(stderr, "H5Dset_extent failed\n");
return -1;
- }
+ }
- start[0]=i;
+ start[0]=i;
/* Choose the next plane to write */
if(H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0){
HDfprintf(stderr, "Failed H5Sselect_hyperslab\n");
return -1;
- }
+ }
/* Write plane to the dataset */
if(H5Dwrite(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0){
HDfprintf(stderr, "Failed H5Dwrite\n");
return -1;
- }
+ }
/* Uncork the dataset's metadata from the cache, if SWMR is enabled */
if(UC_opts.use_swmr)
@@ -389,12 +390,11 @@ int write_uc_file(hbool_t tosend, hid_t fid)
return -1;
}
- /* flush file to make the just written plane available. */
- if(H5Dflush(dsid) < 0)
- {
- HDfprintf(stderr, "Failed to H5Fflush file\n");
- return -1;
- }
+ /* flush file to make the just written plane available. */
+ if(H5Dflush(dsid) < 0) {
+ HDfprintf(stderr, "Failed to H5Fflush file\n");
+ return -1;
+ }
}
/* Done writing. Free/Close all resources including data file */