X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmisc.cpp;h=7df4287a3203df480b706672be1552493a35b627;hb=a66c73deef420104e74b6645ee60e20b37fd8549;hp=2f99668d4457941b3d9ca0e2b5d0fba56890563a;hpb=1277a428237eec3299c6606951fac014bb3ef851;p=stockfish
diff --git a/src/misc.cpp b/src/misc.cpp
index 2f99668d..7df4287a 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() {
@@ -155,7 +146,7 @@ void dbg_print() {
std::ostream& operator<<(std::ostream& os, SyncCout sc) {
- static std::mutex m;
+ static Mutex m;
if (sc == IO_LOCK)
m.lock();
@@ -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