diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-09-30 14:27:10 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-09-30 14:27:10 (GMT) |
commit | b2d661b508a7fc7a2592c13bc6bdc175551f075d (patch) | |
tree | 13baeb0d83a7c2a4c6299993c182b1227c2f6114 /test/use_append_chunk_mirror.c | |
parent | 29ab58b58dce556639ea3154e262895773a8a8df (diff) | |
download | hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.zip hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.gz hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.bz2 |
Clang-format of source files
Diffstat (limited to 'test/use_append_chunk_mirror.c')
-rw-r--r-- | test/use_append_chunk_mirror.c | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/test/use_append_chunk_mirror.c b/test/use_append_chunk_mirror.c index 6ee01c0..4b7845d 100644 --- a/test/use_append_chunk_mirror.c +++ b/test/use_append_chunk_mirror.c @@ -106,9 +106,9 @@ #if CONNECT_WITH_JELLY #define SERVER_IP "10.10.10.248" /* hard-coded IP address */ #else -#define SERVER_IP "127.0.0.1" /* localhost */ -#endif /* CONNECT_WITH_JELLY */ -#define SERVER_PORT 3000 /* hard-coded port number */ +#define SERVER_IP "127.0.0.1" /* localhost */ +#endif /* CONNECT_WITH_JELLY */ +#define SERVER_PORT 3000 /* hard-coded port number */ #define MIRROR_FILE_NAME "shinano.h5" /* hard-coded duplicate/mirror filename */ static options_t UC_opts; /* Use Case Options */ @@ -117,23 +117,23 @@ 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 = TRUE; - opts->iterations = 1; + opts->chunksize = Chunksize_DFT; + opts->use_swmr = TRUE; + opts->iterations = 1; opts->chunkplanes = 1; - opts->progname = THIS_PROGNAME; + opts->progname = THIS_PROGNAME; if (parse_option(argc, argv, opts) < 0) - return(-1); + return (-1); opts->chunkdims[0] = opts->chunkplanes; opts->chunkdims[1] = opts->chunkdims[2] = 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] = opts->chunksize; @@ -141,10 +141,9 @@ setup_parameters(int argc, char * const argv[], options_t * opts) opts->nplanes = (hsize_t)opts->chunksize; show_parameters(opts); - return(0); + return (0); } /* setup_parameters() */ - /* Overall Algorithm: * Parse options from user; * Generate/pre-created test files needed and close it; @@ -155,17 +154,17 @@ 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; - hbool_t send_wait = FALSE; - hid_t fid = -1; /* File ID */ - H5FD_mirror_fapl_t mirr_fa; + 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 = FALSE; + hid_t fid = -1; /* File ID */ + H5FD_mirror_fapl_t mirr_fa; H5FD_splitter_vfd_config_t split_fa; - hid_t mirr_fapl_id = H5I_INVALID_HID; + hid_t mirr_fapl_id = H5I_INVALID_HID; if (setup_parameters(argc, argv, &UC_opts) < 0) { Hgoto_error(1); @@ -176,7 +175,6 @@ main(int argc, char *argv[]) mirr_fa.handshake_port = SERVER_PORT; HDstrncpy(mirr_fa.remote_ip, SERVER_IP, H5FD_MIRROR_MAX_IP_LEN); - split_fa.wo_fapl_id = H5I_INVALID_HID; split_fa.rw_fapl_id = H5I_INVALID_HID; split_fa.magic = H5FD_SPLITTER_MAGIC; @@ -215,9 +213,9 @@ main(int argc, char *argv[]) } /* Prepare parent "splitter" driver in UC_opts */ - split_fa.wo_fapl_id = mirr_fapl_id; - split_fa.rw_fapl_id = H5P_DEFAULT; - UC_opts.fapl_id = H5Pcreate(H5P_FILE_ACCESS); + split_fa.wo_fapl_id = mirr_fapl_id; + split_fa.rw_fapl_id = H5P_DEFAULT; + UC_opts.fapl_id = H5Pcreate(H5P_FILE_ACCESS); if (UC_opts.fapl_id == H5I_INVALID_HID) { HDfprintf(stderr, "can't create creation FAPL\n"); Hgoto_error(1); @@ -237,7 +235,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"); } @@ -303,9 +302,9 @@ main(int argc, char *argv[]) } /* Prepare parent "splitter" driver in UC_opts */ - split_fa.wo_fapl_id = mirr_fapl_id; - split_fa.rw_fapl_id = H5P_DEFAULT; - UC_opts.fapl_id = H5Pcreate(H5P_FILE_ACCESS); + split_fa.wo_fapl_id = mirr_fapl_id; + split_fa.rw_fapl_id = H5P_DEFAULT; + UC_opts.fapl_id = H5Pcreate(H5P_FILE_ACCESS); if (UC_opts.fapl_id == H5I_INVALID_HID) { HDfprintf(stderr, "can't create creation FAPL\n"); Hgoto_error(1); @@ -323,7 +322,8 @@ main(int argc, char *argv[]) } } - if ((fid = H5Fopen(UC_opts.filename, H5F_ACC_RDWR | (UC_opts.use_swmr ? H5F_ACC_SWMR_WRITE : 0), UC_opts.fapl_id)) < 0) { + if ((fid = H5Fopen(UC_opts.filename, H5F_ACC_RDWR | (UC_opts.use_swmr ? H5F_ACC_SWMR_WRITE : 0), + UC_opts.fapl_id)) < 0) { HDfprintf(stderr, "H5Fopen failed\n"); Hgoto_error(1); } @@ -359,11 +359,11 @@ 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); + HDprintf("%d: child process exited with non-zero code (%d)\n", mypid, child_ret_value); Hgoto_error(2); } - } else { + } + else { HDprintf("%d: child process terminated abnormally\n", mypid); Hgoto_error(2); } @@ -372,11 +372,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); } #else /* H5_HAVE_MIRROR_VFD */ @@ -400,4 +401,3 @@ main(void) } /* end main() */ #endif /* H5_HAVE_FORK */ - |