diff --git a/parallel_hashmap/phmap.h b/parallel_hashmap/phmap.h index fe88b05..681a418 100644 --- a/parallel_hashmap/phmap.h +++ b/parallel_hashmap/phmap.h @@ -205,7 +205,7 @@ constexpr bool IsNoThrowSwappable(std::false_type /* is_swappable */) { // -------------------------------------------------------------------------- template -int TrailingZeros(T x) { +uint32_t TrailingZeros(T x) { PHMAP_IF_CONSTEXPR(sizeof(T) == 8) return base_internal::CountTrailingZerosNonZero64(static_cast(x)); else @@ -214,7 +214,7 @@ int TrailingZeros(T x) { // -------------------------------------------------------------------------- template -int LeadingZeros(T x) { +uint32_t LeadingZeros(T x) { PHMAP_IF_CONSTEXPR(sizeof(T) == 8) return base_internal::CountLeadingZeros64(static_cast(x)); else @@ -357,7 +357,7 @@ inline size_t H1(size_t hashval, const ctrl_t* ) { #endif -inline h2_t H2(size_t hashval) { return (ctrl_t)(hashval & 0x7F); } +inline h2_t H2(size_t hashval) { return (h2_t)(ctrl_t)(hashval & 0x7F); } inline bool IsEmpty(ctrl_t c) { return c == kEmpty; } inline bool IsFull(ctrl_t c) { return c >= static_cast(0); } @@ -963,7 +963,7 @@ public: return tmp; } -#if PHMAP_BIDIRECTIONAL +#if 0 // PHMAP_BIDIRECTIONAL // PRECONDITION: not a begin() iterator. iterator& operator--() { assert(ctrl_); @@ -1248,7 +1248,7 @@ public: } iterator end() { -#if PHMAP_BIDIRECTIONAL +#if 0 // PHMAP_BIDIRECTIONAL return iterator_at(capacity_); #else return {ctrl_ + capacity_}; diff --git a/parallel_hashmap/phmap_bits.h b/parallel_hashmap/phmap_bits.h index d37ede3..314e91d 100644 --- a/parallel_hashmap/phmap_bits.h +++ b/parallel_hashmap/phmap_bits.h @@ -270,7 +270,7 @@ inline void UnalignedStore64(void *p, uint64_t v) { memcpy(p, &v, sizeof v); } namespace phmap { namespace base_internal { -PHMAP_BASE_INTERNAL_FORCEINLINE int CountLeadingZeros64Slow(uint64_t n) { +PHMAP_BASE_INTERNAL_FORCEINLINE uint32_t CountLeadingZeros64Slow(uint64_t n) { int zeroes = 60; if (n >> 32) zeroes -= 32, n >>= 32; if (n >> 16) zeroes -= 16, n >>= 16; @@ -279,7 +279,7 @@ PHMAP_BASE_INTERNAL_FORCEINLINE int CountLeadingZeros64Slow(uint64_t n) { return "\4\3\2\2\1\1\1\1\0\0\0\0\0\0\0"[n] + zeroes; } -PHMAP_BASE_INTERNAL_FORCEINLINE int CountLeadingZeros64(uint64_t n) { +PHMAP_BASE_INTERNAL_FORCEINLINE uint32_t CountLeadingZeros64(uint64_t n) { #if defined(_MSC_VER) && defined(_M_X64) // MSVC does not have __buitin_clzll. Use _BitScanReverse64. unsigned long result = 0; // NOLINT(runtime/int)