summaryrefslogtreecommitdiffstats
path: root/test/use_append_mchunks.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-09-30 14:27:10 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-09-30 14:27:10 (GMT)
commitb2d661b508a7fc7a2592c13bc6bdc175551f075d (patch)
tree13baeb0d83a7c2a4c6299993c182b1227c2f6114 /test/use_append_mchunks.c
parent29ab58b58dce556639ea3154e262895773a8a8df (diff)
downloadhdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.zip
hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.gz
hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.bz2
Clang-format of source files
Diffstat (limited to 'test/use_append_mchunks.c')
-rw-r--r--test/use_append_mchunks.c57
1 files changed, 29 insertions, 28 deletions
diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c
index 2eb5a1d..0b2c409 100644
--- a/test/use_append_mchunks.c
+++ b/test/use_append_mchunks.c
@@ -69,25 +69,25 @@ static options_t UC_opts; /* Use Case Options */
* Return: 0 succeed; -1 fail.
*/
int
-setup_parameters(int argc, char * const argv[], options_t * opts)
+setup_parameters(int argc, char *const argv[], options_t *opts)
{
/* use case defaults */
HDmemset(opts, 0, sizeof(options_t));
- opts->chunksize = Chunksize_DFT;
- opts->use_swmr = 1; /* use swmr open */
- opts->iterations = 1;
+ opts->chunksize = Chunksize_DFT;
+ opts->use_swmr = 1; /* use swmr open */
+ opts->iterations = 1;
opts->chunkplanes = 1;
- opts->progname = USE_APPEND_MCHUNKS_PROGNAME;
- opts->fapl_id = H5I_INVALID_HID;
+ opts->progname = USE_APPEND_MCHUNKS_PROGNAME;
+ opts->fapl_id = H5I_INVALID_HID;
if (parse_option(argc, argv, opts) < 0) {
- return(-1);
+ return (-1);
}
opts->chunkdims[0] = (hsize_t)opts->chunkplanes;
opts->chunkdims[1] = opts->chunkdims[2] = (hsize_t)opts->chunksize;
- opts->dims[0] = 0;
+ opts->dims[0] = 0;
opts->max_dims[0] = H5S_UNLIMITED;
opts->dims[1] = opts->dims[2] = opts->max_dims[1] = opts->max_dims[2] = 2 * (hsize_t)opts->chunksize;
@@ -95,10 +95,9 @@ setup_parameters(int argc, char * const argv[], options_t * opts)
opts->nplanes = 2 * (hsize_t)opts->chunksize;
show_parameters(opts);
- return(0);
+ return (0);
} /* end setup_parameters() */
-
/* Overall Algorithm:
* Parse options from user;
* Generate/pre-created test files needed and close it;
@@ -109,15 +108,15 @@ setup_parameters(int argc, char * const argv[], options_t * opts)
int
main(int argc, char *argv[])
{
- pid_t childpid=0;
- pid_t mypid, tmppid;
- int child_status;
- int child_wait_option=0;
- int ret_value = 0;
- int child_ret_value;
+ pid_t childpid = 0;
+ pid_t mypid, tmppid;
+ int child_status;
+ int child_wait_option = 0;
+ int ret_value = 0;
+ int child_ret_value;
hbool_t send_wait = 0;
- hid_t fapl = -1; /* File access property list */
- hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list */
+ hid_t fid = -1; /* File ID */
if (setup_parameters(argc, argv, &UC_opts) < 0) {
Hgoto_error(1);
@@ -150,7 +149,8 @@ main(int argc, char *argv[])
if (create_uc_file(&UC_opts) < 0) {
HDfprintf(stderr, "***encounter error\n");
Hgoto_error(1);
- } else {
+ }
+ else {
HDprintf("File created.\n");
}
/* Close FAPL to prevent issues with forking later */
@@ -164,7 +164,7 @@ main(int argc, char *argv[])
/* ============ */
/* Fork process */
/* ============ */
- if (UC_opts.launch==UC_READWRITE) {
+ if (UC_opts.launch == UC_READWRITE) {
if ((childpid = fork()) < 0) {
perror("fork");
Hgoto_error(1);
@@ -214,7 +214,8 @@ main(int argc, char *argv[])
}
}
- if ((fid = H5Fopen(UC_opts.filename, H5F_ACC_RDWR | (UC_opts.use_swmr ? H5F_ACC_SWMR_WRITE : 0), fapl)) < 0) {
+ if ((fid = H5Fopen(UC_opts.filename, H5F_ACC_RDWR | (UC_opts.use_swmr ? H5F_ACC_SWMR_WRITE : 0), fapl)) <
+ 0) {
HDfprintf(stderr, "H5Fopen failed\n");
Hgoto_error(1);
}
@@ -244,12 +245,12 @@ main(int argc, char *argv[])
}
if (WIFEXITED(child_status)) {
- if ((child_ret_value=WEXITSTATUS(child_status)) != 0) {
- HDprintf("%d: child process exited with non-zero code (%d)\n",
- mypid, child_ret_value);
+ if ((child_ret_value = WEXITSTATUS(child_status)) != 0) {
+ HDprintf("%d: child process exited with non-zero code (%d)\n", mypid, child_ret_value);
Hgoto_error(1);
}
- } else {
+ }
+ else {
HDprintf("%d: child process terminated abnormally\n", mypid);
Hgoto_error(2);
}
@@ -258,11 +259,12 @@ main(int argc, char *argv[])
done:
if (ret_value != 0) {
HDprintf("Error(s) encountered\n");
- } else {
+ }
+ else {
HDprintf("All passed\n");
}
- return(ret_value);
+ return (ret_value);
} /* end main() */
#else /* H5_HAVE_FORK */
@@ -275,4 +277,3 @@ main(void)
} /* end main() */
#endif /* H5_HAVE_FORK */
-