aboutsummaryrefslogtreecommitdiff
path: root/src/cuckoocache.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-11-29 14:33:48 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-11-29 14:32:51 +0100
commitfa7da227daf8558be14f226c4366583fdc59ba10 (patch)
tree8eb9cc498f261c58c2947c66f908be3e9be852f9 /src/cuckoocache.h
parentb4f647fa36a3336774ab616048bc6709bdc59fa1 (diff)
downloadbitcoin-fa7da227daf8558be14f226c4366583fdc59ba10.tar.xz
refactor: Fix implicit-signed-integer-truncation in cuckoocache.h
Diffstat (limited to 'src/cuckoocache.h')
-rw-r--r--src/cuckoocache.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cuckoocache.h b/src/cuckoocache.h
index 1166466771..15cb55c3ce 100644
--- a/src/cuckoocache.h
+++ b/src/cuckoocache.h
@@ -89,7 +89,7 @@ public:
*/
inline void bit_set(uint32_t s)
{
- mem[s >> 3].fetch_or(1 << (s & 7), std::memory_order_relaxed);
+ mem[s >> 3].fetch_or(uint8_t(1 << (s & 7)), std::memory_order_relaxed);
}
/** bit_unset marks an entry as something that should not be overwritten.
@@ -100,7 +100,7 @@ public:
*/
inline void bit_unset(uint32_t s)
{
- mem[s >> 3].fetch_and(~(1 << (s & 7)), std::memory_order_relaxed);
+ mem[s >> 3].fetch_and(uint8_t(~(1 << (s & 7))), std::memory_order_relaxed);
}
/** bit_is_set queries the table for discardability at `s`.