diff options
Diffstat (limited to '')
-rw-r--r-- | src/common/common_funcs.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index c029dc7b3..052254678 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h @@ -19,13 +19,15 @@ /// Helper macros to insert unused bytes or words to properly align structs. These values will be /// zero-initialized. -#define INSERT_PADDING_BYTES(num_bytes) std::array<u8, num_bytes> CONCAT2(pad, __LINE__){}; -#define INSERT_PADDING_WORDS(num_words) std::array<u32, num_words> CONCAT2(pad, __LINE__){}; +#define INSERT_PADDING_BYTES(num_bytes) \ + std::array<u8, num_bytes> CONCAT2(pad, __LINE__) {} +#define INSERT_PADDING_WORDS(num_words) \ + std::array<u32, num_words> CONCAT2(pad, __LINE__) {} /// These are similar to the INSERT_PADDING_* macros, but are needed for padding unions. This is /// because unions can only be initialized by one member. -#define INSERT_UNION_PADDING_BYTES(num_bytes) std::array<u8, num_bytes> CONCAT2(pad, __LINE__); -#define INSERT_UNION_PADDING_WORDS(num_words) std::array<u32, num_words> CONCAT2(pad, __LINE__); +#define INSERT_UNION_PADDING_BYTES(num_bytes) std::array<u8, num_bytes> CONCAT2(pad, __LINE__) +#define INSERT_UNION_PADDING_WORDS(num_words) std::array<u32, num_words> CONCAT2(pad, __LINE__) #ifndef _MSC_VER @@ -56,7 +58,7 @@ std::string GetLastErrorMsg(); namespace Common { 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 |