From b50d127a7710d790c2ba4a08f01b832c2a0b1203 Mon Sep 17 00:00:00 2001
From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
Date: Wed, 1 May 2024 23:09:13 +0100
Subject: [PATCH] refactor: Make 64-bit shift explicit
This change fixes MSVC level-3 warning C4334.
See: https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4334
All `DisableSpecificWarnings` dropped from `fuzz.vcxproj` as all
remained are inherited from `common.init.vcxproj`.
---
build_msvc/fuzz/fuzz.vcxproj | 5 -----
src/test/fuzz/poolresource.cpp | 4 ++--
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/build_msvc/fuzz/fuzz.vcxproj b/build_msvc/fuzz/fuzz.vcxproj
index e7ee211b2dc..d1311fe9d95 100644
--- a/build_msvc/fuzz/fuzz.vcxproj
+++ b/build_msvc/fuzz/fuzz.vcxproj
@@ -80,11 +80,6 @@
{18430fef-6b61-4c53-b396-718e02850f1b}
-
-
- 4018;4244;4267;4334;4715;4805
-
-
diff --git a/src/test/fuzz/poolresource.cpp b/src/test/fuzz/poolresource.cpp
index ce64ef6472c..f764d9f8dbe 100644
--- a/src/test/fuzz/poolresource.cpp
+++ b/src/test/fuzz/poolresource.cpp
@@ -63,9 +63,9 @@ public:
{
if (m_total_allocated > 0x1000000) return;
size_t alignment_bits = m_provider.ConsumeIntegralInRange(0, 7);
- size_t alignment = 1 << alignment_bits;
+ size_t alignment = size_t{1} << alignment_bits;
size_t size_bits = m_provider.ConsumeIntegralInRange(0, 16 - alignment_bits);
- size_t size = m_provider.ConsumeIntegralInRange(1U << size_bits, (1U << (size_bits + 1)) - 1U) << alignment_bits;
+ size_t size = m_provider.ConsumeIntegralInRange(size_t{1} << size_bits, (size_t{1} << (size_bits + 1)) - 1U) << alignment_bits;
Allocate(size, alignment);
}