X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmisc.cpp;h=f09694cc043607a6cd17d0409baf1e96c9537229;hp=2f99668d4457941b3d9ca0e2b5d0fba56890563a;hb=0b36ba74fc0a80388cac43a35962ffc73c01b071;hpb=60c121f3b1ee7d5ced3435cc1718e4e6e6fd8383 diff --git a/src/misc.cpp b/src/misc.cpp index 2f99668d..f09694cc 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -17,7 +17,6 @@ along with this program. If not, see . */ -#include #include #include #include @@ -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(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