Эх сурвалжийг харах

common_funcs: silence sign-conversion warnings in MakeMagic()

We can trivially resolve these by casting the characters to unsigned
values and then shifting the bits.
Lioncash 6 жил өмнө
parent
commit
61f6eaad45

+ 1 - 1
src/common/common_funcs.h

@@ -56,7 +56,7 @@ std::string GetLastErrorMsg();
 namespace Common {
 namespace Common {
 
 
 constexpr u32 MakeMagic(char a, char b, char c, char d) {
 constexpr u32 MakeMagic(char a, char b, char c, char d) {
-    return a | b << 8 | c << 16 | d << 24;
+    return u32(a) | u32(b) << 8 | u32(c) << 16 | u32(d) << 24;
 }
 }
 
 
 } // namespace Common
 } // namespace Common