Skip to content

Commit

Permalink
Rename HDato*() to ato*() (#3201)
Browse files Browse the repository at this point in the history
  • Loading branch information
derobins authored Jun 29, 2023
1 parent a90bdbb commit dd39b54
Show file tree
Hide file tree
Showing 33 changed files with 102 additions and 114 deletions.
2 changes: 1 addition & 1 deletion src/H5FDsubfiling/H5FDioc_threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ initialize_ioc_threads(void *_sf_context)

/* Allow experimentation with the number of helper threads */
if ((env_value = HDgetenv(H5FD_IOC_THREAD_POOL_SIZE)) != NULL) {
int value_check = HDatoi(env_value);
int value_check = atoi(env_value);
if (value_check > 0) {
thread_pool_size = (unsigned int)value_check;
}
Expand Down
2 changes: 1 addition & 1 deletion src/H5FDsubfiling/H5FDsubfiling.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ H5FD__subfiling_get_default_config(hid_t fapl_id, H5FD_subfiling_config_t *confi
config_out->shared_cfg.stripe_count = H5FD_SUBFILING_DEFAULT_STRIPE_COUNT;

if ((h5_require_ioc = HDgetenv("H5_REQUIRE_IOC")) != NULL) {
int value_check = HDatoi(h5_require_ioc);
int value_check = atoi(h5_require_ioc);
if (value_check == 0)
config_out->require_ioc = FALSE;
}
Expand Down
12 changes: 0 additions & 12 deletions src/H5private.h
Original file line number Diff line number Diff line change
Expand Up @@ -620,18 +620,6 @@ typedef off_t h5_stat_size_t;
#ifndef HDatexit
#define HDatexit(F) atexit(F)
#endif
#ifndef HDatof
#define HDatof(S) atof(S)
#endif
#ifndef HDatoi
#define HDatoi(S) atoi(S)
#endif
#ifndef HDatol
#define HDatol(S) atol(S)
#endif
#ifndef HDatoll
#define HDatoll(S) atoll(S)
#endif
#ifndef HDceil
#define HDceil(X) ceil(X)
#endif
Expand Down
2 changes: 1 addition & 1 deletion test/mirror_vfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2302,7 +2302,7 @@ parse_args(int argc, char **argv, struct mt_opts *opts)
if (!HDstrncmp(argv[i], "--ip=", 5))
HDstrncpy(opts->ip, argv[i] + 5, H5FD_MIRROR_MAX_IP_LEN);
else if (!HDstrncmp(argv[i], "--port=", 7))
opts->portno = HDatoi(argv[i] + 7);
opts->portno = atoi(argv[i] + 7);
else {
printf("Unrecognized option: '%s'\n", argv[i]);
return -1;
Expand Down
6 changes: 3 additions & 3 deletions test/swmr_addrem_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ main(int argc, char *argv[])
switch (argv[u][1]) {
/* # of records to write between flushing file */
case 'f':
flush_count = HDatol(argv[u + 1]);
flush_count = atol(argv[u + 1]);
if (flush_count < 0)
usage();
u += 2;
Expand All @@ -318,7 +318,7 @@ main(int argc, char *argv[])
/* Random # seed */
case 'r':
use_seed = 1;
temp = HDatoi(argv[u + 1]);
temp = atoi(argv[u + 1]);
if (temp < 0)
usage();
else
Expand All @@ -333,7 +333,7 @@ main(int argc, char *argv[])
} /* end if */
else {
/* Get the number of records to append */
nops = HDatol(argv[u]);
nops = atol(argv[u]);
if (nops <= 0)
usage();

Expand Down
4 changes: 2 additions & 2 deletions test/swmr_generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ main(int argc, char *argv[])
switch (argv[u][1]) {
/* Compress dataset chunks */
case 'c':
comp_level = HDatoi(argv[u + 1]);
comp_level = atoi(argv[u + 1]);
if (comp_level < -1 || comp_level > 9)
usage();
u += 2;
Expand All @@ -293,7 +293,7 @@ main(int argc, char *argv[])
/* Random # seed */
case 'r':
use_seed = TRUE;
temp = HDatoi(argv[u + 1]);
temp = atoi(argv[u + 1]);
if (temp < 0)
usage();
else
Expand Down
10 changes: 5 additions & 5 deletions test/swmr_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,15 +409,15 @@ main(int argc, char *argv[])
switch (argv[u][1]) {
/* # of common symbols to poll */
case 'h':
ncommon = HDatoi(argv[u + 1]);
ncommon = atoi(argv[u + 1]);
if (ncommon < 0)
usage();
u += 2;
break;

/* # of random symbols to poll */
case 'l':
nrandom = HDatoi(argv[u + 1]);
nrandom = atoi(argv[u + 1]);
if (nrandom < 0)
usage();
u += 2;
Expand All @@ -432,7 +432,7 @@ main(int argc, char *argv[])
/* Random # seed */
case 'r':
use_seed = TRUE;
temp = HDatoi(argv[u + 1]);
temp = atoi(argv[u + 1]);
if (temp < 0)
usage();
else
Expand All @@ -442,7 +442,7 @@ main(int argc, char *argv[])

/* # of seconds between polling */
case 's':
poll_time = HDatoi(argv[u + 1]);
poll_time = atoi(argv[u + 1]);
if (poll_time < 0)
usage();
u += 2;
Expand All @@ -455,7 +455,7 @@ main(int argc, char *argv[])
} /* end if */
else {
/* Get the number of records to append */
nseconds = HDatol(argv[u]);
nseconds = atol(argv[u]);
if (nseconds <= 0)
usage();

Expand Down
10 changes: 5 additions & 5 deletions test/swmr_remove_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,15 +392,15 @@ main(int argc, char *argv[])
switch (argv[u][1]) {
/* # of common symbols to poll */
case 'h':
ncommon = HDatoi(argv[u + 1]);
ncommon = atoi(argv[u + 1]);
if (ncommon < 0)
usage();
u += 2;
break;

/* # of random symbols to poll */
case 'l':
nrandom = HDatoi(argv[u + 1]);
nrandom = atoi(argv[u + 1]);
if (nrandom < 0)
usage();
u += 2;
Expand All @@ -415,7 +415,7 @@ main(int argc, char *argv[])
/* Random # seed */
case 'r':
use_seed = 1;
temp = HDatoi(argv[u + 1]);
temp = atoi(argv[u + 1]);
if (temp < 0)
usage();
else
Expand All @@ -425,7 +425,7 @@ main(int argc, char *argv[])

/* # of seconds between polling */
case 's':
poll_time = HDatoi(argv[u + 1]);
poll_time = atoi(argv[u + 1]);
if (poll_time < 0)
usage();
u += 2;
Expand All @@ -438,7 +438,7 @@ main(int argc, char *argv[])
} /* end if */
else {
/* Get the number of records to append */
nseconds = HDatol(argv[u]);
nseconds = atol(argv[u]);
if (nseconds <= 0)
usage();

Expand Down
6 changes: 3 additions & 3 deletions test/swmr_remove_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ main(int argc, char *argv[])
switch (argv[u][1]) {
/* # of records to write between flushing file */
case 'f':
flush_count = HDatol(argv[u + 1]);
flush_count = atol(argv[u + 1]);
if (flush_count < 0)
usage();
u += 2;
Expand All @@ -253,7 +253,7 @@ main(int argc, char *argv[])
/* Random # seed */
case 'r':
use_seed = 1;
temp = HDatoi(argv[u + 1]);
temp = atoi(argv[u + 1]);
random_seed = (unsigned)temp;
u += 2;
break;
Expand All @@ -271,7 +271,7 @@ main(int argc, char *argv[])
} /* end if */
else {
/* Get the number of records to append */
nshrinks = HDatol(argv[u]);
nshrinks = atol(argv[u]);
if (nshrinks <= 0)
usage();

Expand Down
6 changes: 3 additions & 3 deletions test/swmr_sparse_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ main(int argc, char *argv[])
switch (argv[u][1]) {
/* # of reads between reopens */
case 'n':
reopen_count = HDatoi(argv[u + 1]);
reopen_count = atoi(argv[u + 1]);
if (reopen_count < 0)
usage();
u += 2;
Expand All @@ -372,7 +372,7 @@ main(int argc, char *argv[])

/* # of seconds between polling */
case 's':
poll_time = HDatoi(argv[u + 1]);
poll_time = atoi(argv[u + 1]);
if (poll_time < 0)
usage();
u += 2;
Expand All @@ -385,7 +385,7 @@ main(int argc, char *argv[])
} /* end if */
else {
/* Get the number of records to read */
nrecords = HDatol(argv[u]);
nrecords = atol(argv[u]);
if (nrecords <= 0)
usage();

Expand Down
4 changes: 2 additions & 2 deletions test/swmr_sparse_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ main(int argc, char *argv[])
switch (argv[u][1]) {
/* # of records to write between flushing file */
case 'f':
flush_count = HDatol(argv[u + 1]);
flush_count = atol(argv[u + 1]);
if (flush_count < 0)
usage();
u += 2;
Expand All @@ -354,7 +354,7 @@ main(int argc, char *argv[])
} /* end if */
else {
/* Get the number of records to append */
nrecords = HDatol(argv[u]);
nrecords = atol(argv[u]);
if (nrecords <= 0)
usage();

Expand Down
8 changes: 4 additions & 4 deletions test/swmr_start_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ main(int argc, char *argv[])
switch (argv[u][1]) {
/* Compress dataset chunks */
case 'c':
comp_level = HDatoi(argv[u + 1]);
comp_level = atoi(argv[u + 1]);
if (comp_level < -1 || comp_level > 9)
usage();
u += 2;
Expand All @@ -391,7 +391,7 @@ main(int argc, char *argv[])

/* # of records to write between flushing file */
case 'f':
flush_count = HDatol(argv[u + 1]);
flush_count = atol(argv[u + 1]);
if (flush_count < 0)
usage();
u += 2;
Expand All @@ -406,7 +406,7 @@ main(int argc, char *argv[])
/* Random # seed */
case 'r':
use_seed = TRUE;
temp = HDatoi(argv[u + 1]);
temp = atoi(argv[u + 1]);
if (temp < 0)
usage();
else
Expand All @@ -421,7 +421,7 @@ main(int argc, char *argv[])
} /* end if */
else {
/* Get the number of records to append */
nrecords = HDatol(argv[u]);
nrecords = atol(argv[u]);
if (nrecords <= 0)
usage();

Expand Down
6 changes: 3 additions & 3 deletions test/swmr_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ main(int argc, char *argv[])
switch (argv[u][1]) {
/* # of records to write between flushing file */
case 'f':
flush_count = HDatol(argv[u + 1]);
flush_count = atol(argv[u + 1]);
if (flush_count < 0)
usage();
u += 2;
Expand All @@ -312,7 +312,7 @@ main(int argc, char *argv[])
/* Random # seed */
case 'r':
use_seed = TRUE;
temp = HDatoi(argv[u + 1]);
temp = atoi(argv[u + 1]);
random_seed = (unsigned)temp;
u += 2;
break;
Expand All @@ -330,7 +330,7 @@ main(int argc, char *argv[])
} /* end if */
else {
/* Get the number of records to append */
nrecords = HDatol(argv[u]);
nrecords = atol(argv[u]);
if (nrecords <= 0)
usage();

Expand Down
2 changes: 1 addition & 1 deletion test/testframe.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ ParseTestVerbosity(char *argv)
else if (*argv == 'h')
SetTestVerbosity(VERBO_HI);
else
SetTestVerbosity(HDatoi(argv));
SetTestVerbosity(atoi(argv));
}

/*
Expand Down
6 changes: 3 additions & 3 deletions test/twriteorder.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,21 @@ parse_option(int argc, char *const argv[])
HDexit(EXIT_SUCCESS);
break;
case 'b': /* number of planes to write/read */
if ((blocksize_g = HDatoi(optarg)) <= 0) {
if ((blocksize_g = atoi(optarg)) <= 0) {
fprintf(stderr, "bad blocksize %s, must be a positive integer\n", optarg);
usage(progname_g);
Hgoto_error(-1);
};
break;
case 'n': /* number of planes to write/read */
if ((nlinkedblock_g = HDatoi(optarg)) < 2) {
if ((nlinkedblock_g = atoi(optarg)) < 2) {
fprintf(stderr, "bad number of linked blocks %s, must be greater than 1.\n", optarg);
usage(progname_g);
Hgoto_error(-1);
};
break;
case 'p': /* number of planes to write/read */
if ((part_size_g = HDatoi(optarg)) <= 0) {
if ((part_size_g = atoi(optarg)) <= 0) {
fprintf(stderr, "bad partition size %s, must be a positive integer\n", optarg);
usage(progname_g);
Hgoto_error(-1);
Expand Down
4 changes: 2 additions & 2 deletions test/use_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ parse_option(int argc, char *const argv[], options_t *opts)
opts->filename = HDstrdup(optarg);
break;
case 'i': /* iterations */
if ((opts->iterations = HDatoi(optarg)) <= 0) {
if ((opts->iterations = atoi(optarg)) <= 0) {
fprintf(stderr, "bad iterations number %s, must be a positive integer\n", optarg);
usage(opts->progname);
Hgoto_error(-1);
Expand Down Expand Up @@ -101,7 +101,7 @@ parse_option(int argc, char *const argv[], options_t *opts)
}
break;
case 's': /* use swmr file open mode */
use_swmr = HDatoi(optarg);
use_swmr = atoi(optarg);
if (use_swmr != 0 && use_swmr != 1) {
fprintf(stderr, "swmr value should be 0(no) or 1(yes)\n");
usage(opts->progname);
Expand Down
Loading

0 comments on commit dd39b54

Please sign in to comment.