Просмотр исходного кода

benchmark: affinity cast for mingw (#96)

Jethro Grassie 7 лет назад
Родитель
Сommit
41401797c9
1 измененных файлов с 9 добавлено и 9 удалено
  1. 9 9
      src/tests/affinity.cpp

+ 9 - 9
src/tests/affinity.cpp

@@ -64,7 +64,7 @@ set_thread_affinity(std::thread::native_handle_type thread,
     rc = thread_policy_set(mach_thread, THREAD_AFFINITY_POLICY,
     rc = thread_policy_set(mach_thread, THREAD_AFFINITY_POLICY,
             (thread_policy_t)&policy, 1);
             (thread_policy_t)&policy, 1);
 #elif defined(_WIN32) || defined(__CYGWIN__)
 #elif defined(_WIN32) || defined(__CYGWIN__)
-    rc = SetThreadAffinityMask(thread, 1ULL << cpuid) == 0 ? -2 : 0;
+    rc = SetThreadAffinityMask(static_cast<HANDLE>(thread), 1ULL << cpuid) == 0 ? -2 : 0;
 #else
 #else
     cpu_set_t cs;
     cpu_set_t cs;
     CPU_ZERO(&cs);
     CPU_ZERO(&cs);
@@ -98,20 +98,20 @@ cpuid_from_mask(uint64_t mask, const unsigned &thread_index)
 std::string
 std::string
 mask_to_string(uint64_t mask)
 mask_to_string(uint64_t mask)
 {
 {
-	std::ostringstream ss;
+    std::ostringstream ss;
     unsigned len = 0;
     unsigned len = 0;
     unsigned v = 0;
     unsigned v = 0;
     unsigned i = 64;
     unsigned i = 64;
     while (i--)
     while (i--)
     {
     {
         v = mask >> i;
         v = mask >> i;
-		if (1ULL & v)
-		{
-			if (len == 0) len = i + 1;
-			ss << '1';
-		}
-		else
-			if (len > 0) ss << '0';
+        if (1ULL & v)
+        {
+            if (len == 0) len = i + 1;
+            ss << '1';
+        }
+        else
+            if (len > 0) ss << '0';
     }
     }
     return ss.str();
     return ss.str();
 }
 }