X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fucioption.cpp;h=1dfc474a9c0a3098ce82e0aa181dfb1bfa89195a;hp=c388c5cf5340f3a1a6a5bde067eef85de637995e;hb=ce619b3b6ceb96bbf1e90f8281fdc89b9e64ec5e;hpb=315c58354e3c4e9e1f71fc3ead1c1e0b093756c9 diff --git a/src/ucioption.cpp b/src/ucioption.cpp index c388c5cf..1dfc474a 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -50,9 +50,8 @@ bool CaseInsensitiveLess::operator() (const string& s1, const string& s2) const } -// stringify() converts a numeric value of type T to a std::string -template -static string stringify(const T& v) { +// An helper to convert an integer value to a std::string +static string int_to_string(int v) { std::ostringstream ss; ss << v; @@ -82,7 +81,7 @@ OptionsMap::OptionsMap() { o["Minimum Split Depth"] = UCIOption(4, 4, 7); o["Maximum Number of Threads per Split Point"] = UCIOption(5, 4, 8); o["Threads"] = UCIOption(1, 1, MAX_THREADS); - o["Use Sleeping Threads"] = UCIOption(false); + o["Use Sleeping Threads"] = UCIOption(true); o["Hash"] = UCIOption(32, 4, 8192); o["Clear Hash"] = UCIOption(false, "button"); o["Ponder"] = UCIOption(true); @@ -100,10 +99,10 @@ OptionsMap::OptionsMap() { UCIOption& thr = o["Threads"]; UCIOption& msd = o["Minimum Split Depth"]; - thr.defaultValue = thr.currentValue = stringify(cpu_count()); + thr.defaultValue = thr.currentValue = int_to_string(cpu_count()); if (cpu_count() >= 8) - msd.defaultValue = msd.currentValue = stringify(7); + msd.defaultValue = msd.currentValue = int_to_string(7); } @@ -142,7 +141,7 @@ UCIOption::UCIOption(bool def, string t) : type(t), minValue(0), maxValue(0), id { defaultValue = currentValue = (def ? "true" : "false"); } UCIOption::UCIOption(int def, int minv, int maxv) : type("spin"), minValue(minv), maxValue(maxv), idx(Options.size()) -{ defaultValue = currentValue = stringify(def); } +{ defaultValue = currentValue = int_to_string(def); } /// set_value() updates currentValue of the Option object. Normally it's up to