mtmd : Fix 32-bit narrowing issue in export-lora and mtmd clip #14503
+2
−2
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.
Summary
Fixes narrowing conversion errors when building on 32-bit platforms due to implicit conversion from
long long
tosize_t
in initializer lists.Under C++11 rules, non-constant expressions in initializer lists that narrow types will cause compile errors. This affects both
export-lora.cpp
andclip.cpp
:On 32-bit platforms, this cannot be implicitly converted to size_t (unsigned int) in an initializer list.
Fix
Added static_cast<size_t> to silence narrowing warnings and ensure type safety across 32/64-bit platforms.
Files affected
Notes