]> git.sesse.net Git - stockfish/blobdiff - src/misc.cpp
Avoid casting to char* in prefetch()
[stockfish] / src / misc.cpp
index 1674c2a602b85f02e54c1690696ff8f2630440ce..daafd3fb650cbd009cee475402474f2786d43871 100644 (file)
@@ -176,11 +176,11 @@ void start_logger(bool b) { Logger::start(b); }
 /// which can be quite slow.
 #ifdef NO_PREFETCH
 
 /// which can be quite slow.
 #ifdef NO_PREFETCH
 
-void prefetch(char*) {}
+void prefetch(void*) {}
 
 #else
 
 
 #else
 
-void prefetch(char* addr) {
+void prefetch(void* addr) {
 
 #  if defined(__INTEL_COMPILER)
    // This hack prevents prefetches from being optimized away by
 
 #  if defined(__INTEL_COMPILER)
    // This hack prevents prefetches from being optimized away by
@@ -189,7 +189,7 @@ void prefetch(char* addr) {
 #  endif
 
 #  if defined(__INTEL_COMPILER) || defined(_MSC_VER)
 #  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
 #  else
   __builtin_prefetch(addr);
 #  endif