From 682989d5e123fd9f03a7821381072271d3c062ca Mon Sep 17 00:00:00 2001 From: Ludovic 'Archivist' Lagouardette Date: Sat, 13 Nov 2021 17:59:46 +0100 Subject: [PATCH] Made most bloomfilter constants ULL --- include/gp/containers/probabilistic/bloomfilter.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/gp/containers/probabilistic/bloomfilter.hpp b/include/gp/containers/probabilistic/bloomfilter.hpp index efffd72..79686c2 100644 --- a/include/gp/containers/probabilistic/bloomfilter.hpp +++ b/include/gp/containers/probabilistic/bloomfilter.hpp @@ -11,7 +11,7 @@ namespace gp { template class bloomfilter { - constexpr static size_t phys_size = (1 << magnitude) / 32; + constexpr static size_t phys_size = (1ull << magnitude) / 32ull; gp::array< typename gp::either< threading, std::atomic_uint32_t, @@ -22,12 +22,12 @@ namespace gp { template static void set_bit(T* value, const int v_pos) { - *value |= (1 << v_pos); + *value |= (1ull << v_pos); } template static bool get_bit(T* value, const int v_pos) { - return (*value >> v_pos) & 1; + return (*value >> v_pos) & 1ull; } public: @@ -38,7 +38,7 @@ namespace gp { void set_hash(hash_type v) { - const size_t modulo = v & ((1 << magnitude)-1); + const size_t modulo = v & ((1ull << magnitude)-1ull); const size_t p_pos = modulo / 32; const size_t v_pos = modulo % 32; @@ -47,7 +47,7 @@ namespace gp { bool test_hash(hash_type v) { - const size_t modulo = v & ((1 << magnitude)-1); + const size_t modulo = v & ((1ull << magnitude)-1ull); const size_t p_pos = modulo / 32; const size_t v_pos = modulo % 32;