Closed SpareSimian closed 2 years ago
C4244 is Loss of data, Loss of precision is a floating point thing.
Wouldn't a runtime check on size < 2GB be required as well?
Issue title corrected, thanks.
We could certainly put an assert in there to check the size argument. This is really a case of Windows using the wrong type, but it's probably necessary for compatibility. I suggest a test against std::numeric_limits
Fixed by #86
Building with MSVC compilers for 64-bit results in several C4244 warnings in api.hpp, due to passing the difference of two pointers (ptrdiff_t) to Win APIs expecting an int. The attached patch adds casts to silence the warnings.
api.hpp.diff.txt