Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
/*
* convert string into decimal value, noting any size suffix
*/
/*
* convert string into decimal value, noting any size suffix
*/
-static int str_to_decimal(const char *str, unsigned long long *val, int kilo)
+static int str_to_decimal(const char *str, long long *val, int kilo)
-static int check_str_bytes(const char *p, unsigned long long *val)
+static int check_str_bytes(const char *p, long long *val)
{
return str_to_decimal(p, val, 1);
}
{
return str_to_decimal(p, val, 1);
}
-static int check_str_time(const char *p, unsigned long long *val)
+static int check_str_time(const char *p, long long *val)
{
return str_to_decimal(p, val, 0);
}
{
return str_to_decimal(p, val, 0);
}
-static int check_range_bytes(const char *str, unsigned long *val)
+static int check_range_bytes(const char *str, long *val)
-static int check_int(const char *p, unsigned int *val)
+static int check_int(const char *p, int *val)
{
if (!strlen(p))
return 1;
{
if (!strlen(p))
return 1;
static int __handle_option(struct fio_option *o, const char *ptr, void *data,
int first, int more)
{
static int __handle_option(struct fio_option *o, const char *ptr, void *data,
int first, int more)
{
- unsigned int il, *ilp;
- unsigned long long ull, *ullp;
- unsigned long ul1, ul2;
+ int il, *ilp;
+ long long ull, *ullp;
+ long ul1, ul2;
char **cp;
int ret = 0, is_time = 0;
char **cp;
int ret = 0, is_time = 0;
- if (o->maxval && il > o->maxval)
+ if (o->maxval && il > (int) o->maxval)
il = o->maxval;
if (o->minval && il < o->minval)
il = o->minval;
il = o->maxval;
if (o->minval && il < o->minval)
il = o->minval;
unsigned int off3;
unsigned int off4;
unsigned int maxval; /* max and min value */
unsigned int off3;
unsigned int off4;
unsigned int maxval; /* max and min value */
void *cb; /* callback */
const char *help; /* help text for option */
const char *def; /* default setting */
void *cb; /* callback */
const char *help; /* help text for option */
const char *def; /* default setting */
* Handlers for the options
*/
typedef int (fio_opt_str_fn)(void *, const char *);
* Handlers for the options
*/
typedef int (fio_opt_str_fn)(void *, const char *);
-typedef int (fio_opt_str_val_fn)(void *, unsigned long long *);
-typedef int (fio_opt_int_fn)(void *, unsigned int *);
+typedef int (fio_opt_str_val_fn)(void *, long long *);
+typedef int (fio_opt_int_fn)(void *, int *);
typedef int (fio_opt_str_set_fn)(void *);
#define td_var(start, offset) ((void *) start + (offset))
typedef int (fio_opt_str_set_fn)(void *);
#define td_var(start, offset) ((void *) start + (offset))