diff options
author | 2015-05-20 21:24:59 +0200 | |
---|---|---|
committer | 2015-05-20 21:24:59 +0200 | |
commit | f10abf48d7f3eddd91db264f30d0bfa581c921f4 (patch) | |
tree | 697d8a63c55e89cfa6194aae8a6edd4aa1142137 /src/lib/util/options.c | |
parent | a082abcd7d85e6c851e7283eff917e8111a37413 (diff) |
Another round of -Wextra -Wdouble-promotion fixes. (nw)
Diffstat (limited to 'src/lib/util/options.c')
-rw-r--r-- | src/lib/util/options.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |