diff --git a/src/utils.h b/src/utils.h index 34478bac1e..4a47841cd9 100644 --- a/src/utils.h +++ b/src/utils.h @@ -540,7 +540,8 @@ static inline void Store16(byte* ptr, uint16_t value) { #ifdef CAN_READ_UNALIGNED *reinterpret_cast(ptr) = value; #else - ptr[1] = value; + // Cast to avoid warning C4244 when compiling with Microsoft Visual C++. + ptr[1] = static_cast(value); ptr[0] = value >> 8; #endif }