From f10abf48d7f3eddd91db264f30d0bfa581c921f4 Mon Sep 17 00:00:00 2001 From: couriersud Date: Wed, 20 May 2015 21:24:59 +0200 Subject: Another round of -Wextra -Wdouble-promotion fixes. (nw) --- src/lib/util/options.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/util/options.c') diff --git a/src/lib/util/options.c b/src/lib/util/options.c index d229624017a..62c3cc0379a 100644 --- a/src/lib/util/options.c +++ b/src/lib/util/options.c @@ -642,7 +642,7 @@ bool core_options::set_value(const char *name, int value, int priority, std::str bool core_options::set_value(const char *name, float value, int priority, std::string &error_string) { std::string tempstr; - strprintf(tempstr, "%f", value); + strprintf(tempstr, "%f", (double) value); return set_value(name, tempstr.c_str(), priority, error_string); } @@ -780,7 +780,7 @@ bool core_options::validate_and_set_data(core_options::entry &curentry, const ch strcatprintf(error_string, "Illegal float value for %s: \"%s\"; reverting to %s\n", curentry.name(), data.c_str(), curentry.value()); return false; } - if (curentry.has_range() && (fval < atof(curentry.minimum()) || fval > atof(curentry.maximum()))) + if (curentry.has_range() && ((double) fval < atof(curentry.minimum()) || (double) fval > atof(curentry.maximum()))) { strcatprintf(error_string, "Out-of-range float value for %s: \"%s\" (must be between %s and %s); reverting to %s\n", curentry.name(), data.c_str(), curentry.minimum(), curentry.maximum(), curentry.value()); return false; -- cgit v1.2.3-70-g09d2