projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
configure: HPUX warning for empty CC
[fio.git]
/
parse.c
diff --git
a/parse.c
b/parse.c
index 0bbb0b30dafd5c8b57ac842e28bdaeba789c6022..d15d22ba3f7ed03a68e77614a02b44616d64daa5 100644
(file)
--- a/
parse.c
+++ b/
parse.c
@@
-344,6
+344,11
@@
static int opt_len(const char *str)
return (int)(postfix - str);
}
return (int)(postfix - str);
}
+static int str_match_len(const struct value_pair *vp, const char *str)
+{
+ return max(strlen(vp->ival), opt_len(str));
+}
+
#define val_store(ptr, val, off, or, data) \
do { \
ptr = td_var((data), (off)); \
#define val_store(ptr, val, off, or, data) \
do { \
ptr = td_var((data), (off)); \
@@
-361,7
+366,7
@@
static int __handle_option(struct fio_option *o, const char *ptr, void *data,
long long ull, *ullp;
long ul1, ul2;
double uf;
long long ull, *ullp;
long ul1, ul2;
double uf;
- char **cp;
+ char **cp
= NULL
;
int ret = 0, is_time = 0;
const struct value_pair *vp;
struct value_pair posval[PARSE_MAX_VP];
int ret = 0, is_time = 0;
const struct value_pair *vp;
struct value_pair posval[PARSE_MAX_VP];
@@
-388,7
+393,7
@@
static int __handle_option(struct fio_option *o, const char *ptr, void *data,
if (!vp->ival || vp->ival[0] == '\0')
continue;
all_skipped = 0;
if (!vp->ival || vp->ival[0] == '\0')
continue;
all_skipped = 0;
- if (!strncmp(vp->ival, ptr,
opt_len(
ptr))) {
+ if (!strncmp(vp->ival, ptr,
str_match_len(vp,
ptr))) {
ret = 0;
if (o->roff1) {
if (vp->or)
ret = 0;
if (o->roff1) {
if (vp->or)
@@
-536,8
+541,6
@@
static int __handle_option(struct fio_option *o, const char *ptr, void *data,
cp = td_var(data, o->off1);
*cp = strdup(ptr);
cp = td_var(data, o->off1);
*cp = strdup(ptr);
- } else {
- cp = NULL;
}
if (fn)
}
if (fn)
@@
-551,7
+554,7
@@
static int __handle_option(struct fio_option *o, const char *ptr, void *data,
if (!vp->ival || vp->ival[0] == '\0')
continue;
all_skipped = 0;
if (!vp->ival || vp->ival[0] == '\0')
continue;
all_skipped = 0;
- if (!strncmp(vp->ival, ptr,
opt_len(
ptr))) {
+ if (!strncmp(vp->ival, ptr,
str_match_len(vp,
ptr))) {
char *rest;
ret = 0;
char *rest;
ret = 0;
@@
-1093,6
+1096,9
@@
void option_init(struct fio_option *o)
o->maxval = UINT_MAX;
}
if (o->type == FIO_OPT_FLOAT_LIST) {
o->maxval = UINT_MAX;
}
if (o->type == FIO_OPT_FLOAT_LIST) {
+#ifndef NAN
+#define NAN __builtin_nanf("")
+#endif
o->minfp = NAN;
o->maxfp = NAN;
}
o->minfp = NAN;
o->maxfp = NAN;
}