summaryrefslogtreecommitdiffstats
path: root/test/use_common.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2017-05-25 10:45:53 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2017-05-25 10:45:53 (GMT)
commit946fd98b8d5b653b89cfdce279195810f389dedf (patch)
tree6d66fbbc5154e74473cda94b8247464c2325423d /test/use_common.c
parent710ed6d10a965346ff6e41cc075587c8cf91f08c (diff)
downloadhdf5-946fd98b8d5b653b89cfdce279195810f389dedf.zip
hdf5-946fd98b8d5b653b89cfdce279195810f389dedf.tar.gz
hdf5-946fd98b8d5b653b89cfdce279195810f389dedf.tar.bz2
Fixed many minor warnings.
Diffstat (limited to 'test/use_common.c')
-rw-r--r--test/use_common.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/use_common.c b/test/use_common.c
index 908cac9..5aa6692 100644
--- a/test/use_common.c
+++ b/test/use_common.c
@@ -48,6 +48,8 @@ parse_option(int argc, char * const argv[])
{
int ret_value=0;
int c;
+ int use_swmr; /* Need an int to detect errors */
+
/* command line options: See function usage for a description */
const char *nagg_options = "f:hi:l:n:s:y:z:";
@@ -96,11 +98,13 @@ parse_option(int argc, char * const argv[])
};
break;
case 's': /* use swmr file open mode */
- if ((UC_opts.use_swmr = HDatoi(optarg)) < 0) {
- fprintf(stderr, "swmr value should be 0(no) or 1(yes)\n");
- usage(progname_g);
- Hgoto_error(-1);
- };
+ use_swmr = HDatoi(optarg);
+ if (use_swmr != 0 && use_swmr != 1) {
+ HDfprintf(stderr, "swmr value should be 0(no) or 1(yes)\n");
+ usage(progname_g);
+ Hgoto_error(-1);
+ }
+ UC_opts.use_swmr = (hbool_t)use_swmr;
break;
case 'y': /* Number of planes per chunk */
if ((UC_opts.chunkplanes = HDstrtoul(optarg, NULL, 0)) <= 0) {