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 /tools/test/perform/sio_standalone.c | |
parent | 29ab58b58dce556639ea3154e262895773a8a8df (diff) | |
download | hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.zip hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.gz hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.bz2 |
Clang-format of source files
Diffstat (limited to 'tools/test/perform/sio_standalone.c')
-rw-r--r-- | tools/test/perform/sio_standalone.c | 63 |
1 files changed, 29 insertions, 34 deletions
diff --git a/tools/test/perform/sio_standalone.c b/tools/test/perform/sio_standalone.c index ac191e5..2fb5737 100644 --- a/tools/test/perform/sio_standalone.c +++ b/tools/test/perform/sio_standalone.c @@ -10,7 +10,6 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - /* This file contains the definition of functions required to build h5perf in * STANDALONE mode. * Created: Christian Chilan, 2005/5/18. @@ -18,29 +17,28 @@ #include "sio_perf.h" - /** From h5tools_utils.c **/ /* global variables */ -int nCols = 80; +int nCols = 80; /* ``get_option'' variables */ -int opt_err = 1; /*get_option prints errors if this is on */ -int opt_ind = 1; /*token pointer */ -const char *opt_arg; /*flag argument (or value) */ - +int opt_err = 1; /*get_option prints errors if this is on */ +int opt_ind = 1; /*token pointer */ +const char *opt_arg; /*flag argument (or value) */ int get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts) { - static int sp = 1; /* character index in current token */ - int opt_opt = '?'; /* option character passed back to user */ + static int sp = 1; /* character index in current token */ + int opt_opt = '?'; /* option character passed back to user */ if (sp == 1) { /* check for more flag-like tokens */ if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') { return EOF; - } else if (HDstrcmp(argv[opt_ind], "--") == 0) { + } + else if (HDstrcmp(argv[opt_ind], "--") == 0) { opt_ind++; return EOF; } @@ -49,7 +47,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-') { /* long command line option */ const char *arg = &argv[opt_ind][2]; - int i; + int i; for (i = 0; l_opts && l_opts[i].name; i++) { size_t len = HDstrlen(l_opts[i].name); @@ -61,22 +59,21 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (l_opts[i].has_arg != no_arg) { if (arg[len] == '=') { opt_arg = &arg[len + 1]; - } else if (opt_ind < (argc - 1) && argv[opt_ind + 1][0] != '-') { + } + else if (opt_ind < (argc - 1) && argv[opt_ind + 1][0] != '-') { opt_arg = argv[++opt_ind]; - } else if (l_opts[i].has_arg == require_arg) { + } + else if (l_opts[i].has_arg == require_arg) { if (opt_err) - HDfprintf(stderr, - "%s: option required for \"--%s\" flag\n", - argv[0], arg); + HDfprintf(stderr, "%s: option required for \"--%s\" flag\n", argv[0], arg); opt_opt = '?'; } - } else { + } + else { if (arg[len] == '=') { if (opt_err) - HDfprintf(stderr, - "%s: no option required for \"%s\" flag\n", - argv[0], arg); + HDfprintf(stderr, "%s: no option required for \"%s\" flag\n", argv[0], arg); opt_opt = '?'; } @@ -98,8 +95,9 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti opt_ind++; sp = 1; - } else { - register char *cp; /* pointer into current token */ + } + else { + register char *cp; /* pointer into current token */ /* short command line option */ opt_opt = argv[opt_ind][sp]; @@ -107,8 +105,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (opt_opt == ':' || (cp = strchr(opts, opt_opt)) == 0) { if (opt_err) - HDfprintf(stderr, "%s: unknown option \"%c\"\n", - argv[0], opt_opt); + HDfprintf(stderr, "%s: unknown option \"%c\"\n", argv[0], opt_opt); /* if no chars left in this token, move to next token */ if (argv[opt_ind][++sp] == '\0') { @@ -124,20 +121,21 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (argv[opt_ind][sp + 1] != '\0') { /* flag value is rest of current token */ opt_arg = &argv[opt_ind++][sp + 1]; - } else if (++opt_ind >= argc) { + } + else if (++opt_ind >= argc) { if (opt_err) - HDfprintf(stderr, - "%s: value expected for option \"%c\"\n", - argv[0], opt_opt); + HDfprintf(stderr, "%s: value expected for option \"%c\"\n", argv[0], opt_opt); opt_opt = '?'; - } else { + } + else { /* flag value is next token */ opt_arg = argv[opt_ind++]; } sp = 1; - } else { + } + else { /* set up to look at next char in token, next time */ if (argv[opt_ind][++sp] == '\0') { /* no more in current token, so setup next token */ @@ -153,12 +151,9 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti return opt_opt; } - void print_version(const char *progname) { - printf("%s: Version %u.%u.%u%s%s\n", - progname, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE, + printf("%s: Version %u.%u.%u%s%s\n", progname, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE, H5_VERS_SUBRELEASE[0] ? "-" : "", H5_VERS_SUBRELEASE); } - |