temisu/ancient

new VS2022 warnings in 2.1.0

manxorist opened this issue · 5 comments

src\BLZWDecompressor.cpp(66,38): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
src\CompressDecompressor.cpp(117,47): warning C4018: '>=': signed/unsigned mismatch
src\CompactDecompressor.cpp(89,33): warning C4244: 'argument': conversion from 'uint16_t' to 'uint8_t', possible loss of data
src\DMSDecompressor.cpp(555,24): warning C4267: 'initializing': conversion from 'size_t' to 'uint32_t', possible loss of data
src\DMSDecompressor.cpp(571,32): warning C4244: '=': conversion from 'uint16_t' to 'uint8_t', possible loss of data
src\DMSDecompressor.cpp(587,23): warning C4267: 'initializing': conversion from 'size_t' to 'uint32_t', possible loss of data
src\FreezeDecompressor.cpp(52,16): warning C4244: '=': conversion from 'uint16_t' to 'uint8_t', possible loss of data
src\LOBDecompressor.cpp(228,54): warning C4018: '>=': signed/unsigned mismatch
src\PPDecompressor.cpp(266,26): warning C4267: 'initializing': conversion from 'size_t' to 'uint32_t', possible loss of data
src\PPDecompressor.cpp(306,18): warning C4267: 'initializing': conversion from 'size_t' to 'uint32_t', possible loss of data
src\PPDecompressor.cpp(326,36): warning C4267: '=': conversion from 'size_t' to 'uint32_t', possible loss of data
src\PPDecompressor.cpp(387,53): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data
src\PackDecompressor.cpp(171,27): warning C4244: 'argument': conversion from 'uint16_t' to 'uint8_t', possible loss of data

I'll look into them and fix the trivial ones.

Remaining warnings after #45:

src\DMSDecompressor.cpp(555,24): warning C4267: 'initializing': conversion from 'size_t' to 'uint32_t', possible loss of data
src\PPDecompressor.cpp(387,53): warning C4267: 'argument': conversion from 'size_t' to 'uint32_t', possible loss of data

It was not immediately obvious to me if extending these offset types to size_t or just assuming only 32bit offsets and casting would be appropriate.

All other cases looked simple enough.

I need to create automated vs builds, otherwise this is going to be a recurring occurence.

I’ll check the remaining issues a bit later

Automated VS2022 build workflow added (I just need to make it bomb on warnings).

Warnings should be gone now. I'll do fixed release tomorrow-ish

Thanks!

I do not necessarily need a new release. For @OpenMPT , I just merged the warning fixes, which is fine for me.