]> git.sesse.net Git - stockfish/blobdiff - src/ucioption.cpp
Use int conversion for Option class
[stockfish] / src / ucioption.cpp
index 39933ea5e8d0150b6a7472bfad0223829b9e35c0..f6342e5cb57267a50520a1a96050fe15591fe658 100644 (file)
@@ -128,9 +128,9 @@ Option::Option(double v, int minv, int maxv, OnChange f) : type("spin"), min(min
 Option::Option(const char* v, const char* cur, OnChange f) : type("combo"), min(0), max(0), on_change(f)
 { defaultValue = v; currentValue = cur; }
 
-Option::operator double() const {
+Option::operator int() const {
   assert(type == "check" || type == "spin");
-  return (type == "spin" ? stof(currentValue) : currentValue == "true");
+  return (type == "spin" ? std::stoi(currentValue) : currentValue == "true");
 }
 
 Option::operator std::string() const {