]> git.sesse.net Git - stockfish/blobdiff - src/misc.cpp
Don't assume the type of Time::point
[stockfish] / src / misc.cpp
index 2f99668d4457941b3d9ca0e2b5d0fba56890563a..f09694cc043607a6cd17d0409baf1e96c9537229 100644 (file)
@@ -17,7 +17,6 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include <chrono>
 #include <fstream>
 #include <iomanip>
 #include <iostream>
@@ -27,7 +26,6 @@
 #include "thread.h"
 
 using namespace std;
-using namespace std::chrono;
 
 namespace {
 
@@ -125,17 +123,10 @@ const string engine_info(bool to_uci) {
 }
 
 
-/// Convert system time to milliseconds. That's all we need.
-
-Time::point Time::now() {
-  return duration_cast<milliseconds>(steady_clock::now().time_since_epoch()).count();
-}
-
-
 /// Debug functions used mainly to collect run-time statistics
 
 void dbg_hit_on(bool b) { ++hits[0]; if (b) ++hits[1]; }
-void dbg_hit_on_c(bool c, bool b) { if (c) dbg_hit_on(b); }
+void dbg_hit_on(bool c, bool b) { if (c) dbg_hit_on(b); }
 void dbg_mean_of(int v) { ++means[0]; means[1] += v; }
 
 void dbg_print() {
@@ -176,11 +167,11 @@ void start_logger(bool b) { Logger::start(b); }
 /// which can be quite slow.
 #ifdef NO_PREFETCH
 
-void prefetch(char*) {}
+void prefetch(void*) {}
 
 #else
 
-void prefetch(char* addr) {
+void prefetch(void* addr) {
 
 #  if defined(__INTEL_COMPILER)
    // This hack prevents prefetches from being optimized away by
@@ -189,7 +180,7 @@ void prefetch(char* addr) {
 #  endif
 
 #  if defined(__INTEL_COMPILER) || defined(_MSC_VER)
-  _mm_prefetch(addr, _MM_HINT_T0);
+  _mm_prefetch((char*)addr, _MM_HINT_T0);
 #  else
   __builtin_prefetch(addr);
 #  endif