From dfc68a4db92b53c7b76e545678c80f42158e6eed Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Tue, 29 Nov 2011 23:18:34 +0000 Subject: [PATCH] Make the int/double option type detection slightly less broken Choosing between int and double based on whether the default value is an int is dumb and broken enough, but with the "ceil" the detection didn't even work for negative numbers. Originally committed to SVN as r5937. --- aegisub/libaegisub/common/option_visit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aegisub/libaegisub/common/option_visit.cpp b/aegisub/libaegisub/common/option_visit.cpp index 4847e35f7..22ef6ce46 100644 --- a/aegisub/libaegisub/common/option_visit.cpp +++ b/aegisub/libaegisub/common/option_visit.cpp @@ -105,7 +105,7 @@ void ConfigVisitor::Visit(const json::Array& array) { void ConfigVisitor::Visit(const json::Number& number) { - if (int64_t(number) == ceil(number)) { + if (int64_t(number) == number) { AddOptionValue(new OptionValueInt(name, int64_t(number))); } else { AddOptionValue(new OptionValueDouble(name, number));