Fix C++20 -Wdeprecated-enum-enum-conversion warning by using integer types for matrix::num_rows and num_cols
#415
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.
Hi! This fixes a
-Wdeprecated-enum-enum-conversionwarning on GCC and Clang we ran into when compiling basisu's files inside a C++20 project. Basisu's CMakeLists.txt specifies C++17, but this can be reproduced without a custom CMake script by runningThis produces the following warning:
Previously,
num_rowsandnum_colswere members of an anonymous union within each templated matrix type:This meant that arithmetic operations between
num_rowsandnum_colsof different matrix types were technically implicitly converting between different types, resulting in the warning above. Changing the types ofnum_rowsandnum_colstostatic const uint32_tfixes this.Thank you!