Repository navigation
fix C4244 narrowing conversion warnings on 32-bit (Win32) - #3
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 24 24
Lines 1387 1387
Branches 498 498
=====================================
Misses 1387 1387 ☔ View full report in Codecov by Harness. |
On 32-bit targets size_t and unsigned int are 32-bit while VkDeviceSize is 64-bit, so passing buffer sizes of type VkDeviceSize to host-side calls (std::vector constructor, std::memcpy) triggers C4244, which the CI build turns into an error. Change the local size variables to size_t at the declaration site. The Vulkan API calls (VkBufferCreateInfo::size, vkMapMemory) accept the wider VkDeviceSize, so the values are simply widened there, and the host-side calls receive size_t directly.
igagis-bot
force-pushed
the
fix/win32-narrowing-casts
branch
from
November 23, 2026 02:44
b1e77bd to
6d7c2ab
Compare
igagis
approved these changes
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On 32-bit targets
size_t/unsigned intare 32-bit whileVkDeviceSizeis 64-bit, so passing buffer sizes of typeVkDeviceSizeto host-side calls (std::vectorconstructor,std::memcpy) triggers C4244, which the CI build turns into an error.Changes the local size variables to
size_tat the declaration site. The Vulkan API calls (VkBufferCreateInfo::size,vkMapMemory) accept the widerVkDeviceSize, so the values are simply widened there, and the host-side calls receivesize_tdirectly.