Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf.pld@gmail.com>2019-10-01 23:42:29 +0300
committerBartosz Taudul <wolf.pld@gmail.com>2019-10-01 23:42:29 +0300
commit68f476834f6ed5e33175af0d5af8f7986f412c19 (patch)
tree963aa01f8c7ddb6d077b5c598d53bb225ab9bb0d /server/TracyPopcnt.hpp
parent65ea33a60f5dbe4fa1008f606760c37648e6fe15 (diff)
Make sure TracyCountBits() always returns uint64_t.
Diffstat (limited to 'server/TracyPopcnt.hpp')
-rw-r--r--server/TracyPopcnt.hpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/TracyPopcnt.hpp b/server/TracyPopcnt.hpp
index a84008d5..e6c4539d 100644
--- a/server/TracyPopcnt.hpp
+++ b/server/TracyPopcnt.hpp
@@ -7,9 +7,12 @@
# include <intrin.h>
# define TracyCountBits __popcnt64
#elif defined __GNUC__ || defined __clang__
-# define TracyCountBits __builtin_popcountll
+static inline uint64_t TracyCountBits( uint64_t i )
+{
+ return uint64_t( __builtin_popcountll( i ) );
+}
#else
-static inline int TracyCountBits( uint64_t i )
+static inline uint64_t TracyCountBits( uint64_t i )
{
i = i - ( (i >> 1) & 0x5555555555555555 );
i = ( i & 0x3333333333333333 ) + ( (i >> 2) & 0x3333333333333333 );