1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-02 09:39:36 +00:00

Fix a warning with MSVC 2015

This commit is contained in:
Marco Costalba 2016-05-08 17:39:14 +02:00
parent 8d2eb34944
commit 7a01beb441

View file

@ -225,8 +225,9 @@ template<typename T, int Half = sizeof(T)/2, int End = sizeof(T) - 1>
inline void swap_byte(T& x)
{
char tmp, *c = (char*)(&x);
for (int i = 0; i < Half; ++i)
tmp = c[i], c[i] = c[End - i], c[End - i] = tmp;
if (Half) // Fix a MSVC 2015 warning
for (int i = 0; i < Half; ++i)
tmp = c[i], c[i] = c[End - i], c[End - i] = tmp;
}
template<typename T, int LE> T number(void* addr) {