X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fucioption.cpp;h=346fd42b89a5aa8a5ea988618e8640ce92b43e82;hb=d40a12f948590e280a4c0e874cb8a73b6b7929c2;hp=9b9c20da0019e5b507468cca7f9aa22b3c432954;hpb=f44aea7508d3516c474bce6d95a03b7760391cef;p=stockfish diff --git a/src/ucioption.cpp b/src/ucioption.cpp index 9b9c20da..346fd42b 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -17,6 +17,7 @@ along with this program. If not, see . */ +#include #include #include @@ -28,7 +29,25 @@ using std::string; using std::cout; using std::endl; -OptionsMap Options; +OptionsMap Options; // Global object + + +// Our case insensitive less() function as required by UCI protocol +bool CaseInsensitiveLess::operator() (const string& s1, const string& s2) const { + + int c1, c2; + size_t i = 0; + + while (i < s1.size() && i < s2.size()) + { + c1 = tolower(s1[i]); + c2 = tolower(s2[i++]); + + if (c1 != c2) + return c1 < c2; + } + return s1.size() < s2.size(); +} // stringify() converts a numeric value of type T to a std::string @@ -75,7 +94,7 @@ void init_uci_options() { Options["Minimum Split Depth"] = Option(4, 4, 7); Options["Maximum Number of Threads per Split Point"] = Option(5, 4, 8); Options["Threads"] = Option(1, 1, MAX_THREADS); - Options["Use Sleeping Master"] = Option(false); + Options["Use Sleeping Threads"] = Option(false); Options["Hash"] = Option(32, 4, 8192); Options["Clear Hash"] = Option(false, "button"); Options["Ponder"] = Option(true);