summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKimmy Mu <kmu@hdfgroup.org>2020-01-28 19:28:26 (GMT)
committerkmu <kmu@hdfgroup.org>2020-01-28 21:47:58 (GMT)
commitd4dedac70f84be791869e37d28aef73f3d72c1e4 (patch)
treedddd9405e501f01b7a65dd973ba90e06d084b8d7 /test
parent68c54e69a4f4a6a40dff7ca0c1d48ef004a4adda (diff)
downloadhdf5-d4dedac70f84be791869e37d28aef73f3d72c1e4.zip
hdf5-d4dedac70f84be791869e37d28aef73f3d72c1e4.tar.gz
hdf5-d4dedac70f84be791869e37d28aef73f3d72c1e4.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 */