[x265] [PATCH] threadpool: fix warning: ‘int popCount(uint64_t)’ defined but not used [-Wunused-function]

praveen at multicorewareinc.com praveen at multicorewareinc.com
Mon May 30 14:45:49 CEST 2016


# HG changeset patch
# User Praveen Tiwari <praveen at multicorewareinc.com>
# Date 1464585837 -19800
#      Mon May 30 10:53:57 2016 +0530
# Node ID b8dbe8d7c09e7fc0b7cce236569fc5df2eb70b1e
# Parent  aeade2e8d8688ebffb8455b8948d89d6a72e2c38
threadpool: fix warning: ‘int popCount(uint64_t)’ defined but not used [-Wunused-function]
 static int popCount(uint64_t x)

diff -r aeade2e8d868 -r b8dbe8d7c09e source/common/threadpool.cpp
--- a/source/common/threadpool.cpp	Thu May 26 16:45:09 2016 +0530
+++ b/source/common/threadpool.cpp	Mon May 30 10:53:57 2016 +0530
@@ -68,6 +68,7 @@
 # define strcasecmp _stricmp
 #endif
 
+#if defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_WIN7
 const uint64_t m1 = 0x5555555555555555; //binary: 0101...
 const uint64_t m2 = 0x3333333333333333; //binary: 00110011..
 const uint64_t m3 = 0x0f0f0f0f0f0f0f0f; //binary:  4 zeros,  4 ones ...
@@ -80,6 +81,7 @@
     x = (x + (x >> 4)) & m3;
     return (x * h01) >> 56;
 }
+#endif
 
 namespace X265_NS {
 // x265 private namespace


More information about the x265-devel mailing list