]> git.sesse.net Git - stockfish/commitdiff
Fix Hash in bench
authorlucasart <lucas.braesch@gmail.com>
Thu, 7 Aug 2014 10:51:07 +0000 (18:51 +0800)
committerlucasart <lucas.braesch@gmail.com>
Thu, 7 Aug 2014 10:51:07 +0000 (18:51 +0800)
The compiler tries to cast Options["Hash"] into a string, using:

Option::operator std::string() const {
  assert(type == "string");
  return currentValue;
}

And, as expected, the assert() fails.

std::to_string() would be the right solution, but it's C++11. And using a stringstream is too much code to
achieve so little. Let's keep it the way it was: hardcoded (ie. default hash defined in two places).

No functional change.

src/benchmark.cpp

index 7fc199f92866d26f09912df969e87f9543084857..de8b48bb4c039f480f45f5e6339b19192b8ab70b 100644 (file)
@@ -82,7 +82,7 @@ void benchmark(const Position& current, istream& is) {
   vector<string> fens;
 
   // Assign default values to missing arguments
   vector<string> fens;
 
   // Assign default values to missing arguments
-  string ttSize    = (is >> token) ? token : Options["Hash"];
+  string ttSize    = (is >> token) ? token : "16";
   string threads   = (is >> token) ? token : "1";
   string limit     = (is >> token) ? token : "13";
   string fenFile   = (is >> token) ? token : "default";
   string threads   = (is >> token) ? token : "1";
   string limit     = (is >> token) ? token : "13";
   string fenFile   = (is >> token) ? token : "default";