From a946678bc7f37475ecef5b4282a77bc4e0f1afa7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 21 Apr 2018 07:05:46 +0300 Subject: Add cast into macro toInt for old compilers. --- src/enums/simpletypes/intdefines.h | 2 +- src/net/messagein.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/enums/simpletypes/intdefines.h b/src/enums/simpletypes/intdefines.h index 6e030f72a..2977d87a5 100644 --- a/src/enums/simpletypes/intdefines.h +++ b/src/enums/simpletypes/intdefines.h @@ -43,7 +43,7 @@ const name name##_zero = 0; \ const name name##_one = 1 #define fromInt(val, name) static_cast(val) -#define toInt(val, name) (val) +#define toInt(val, name) static_cast(val) #define defIntEnumNeg(name) const name name##_negOne = -1 #endif // ADVGCC diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index 1226102d7..5b942a2d0 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -189,7 +189,7 @@ int32_t MessageIn::readInt32(const char *const str) uint32_t MessageIn::readUInt32(const char *const str) { - uint32_t value = -1; + uint32_t value = 0; if (mPos + 4 <= mLength) { #if SDL_BYTEORDER == SDL_BIG_ENDIAN -- cgit v1.2.3-70-g09d2