]> git.sesse.net Git - stockfish/blobdiff - src/ucioption.cpp
Remove a false comment
[stockfish] / src / ucioption.cpp
index 9b9c20da0019e5b507468cca7f9aa22b3c432954..de4e07fb38a6f37189e5793e899a17f93998a5c6 100644 (file)
@@ -17,6 +17,7 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include <cctype>
 #include <iostream>
 #include <sstream>
 
@@ -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(true);
   Options["Hash"] = Option(32, 4, 8192);
   Options["Clear Hash"] = Option(false, "button");
   Options["Ponder"] = Option(true);
@@ -85,7 +104,7 @@ void init_uci_options() {
   Options["Emergency Base Time"] = Option(200, 0, 60000);
   Options["Emergency Move Time"] = Option(70, 0, 5000);
   Options["Minimum Thinking Time"] = Option(20, 0, 5000);
-  Options["UCI_Chess960"] = Option(false); // Just a dummy but needed by GUIs
+  Options["UCI_Chess960"] = Option(false);
   Options["UCI_AnalyseMode"] = Option(false);
 
   // Set some SMP parameters accordingly to the detected CPU count