diff --git a/CorsixTH/Src/th_lua_map.cpp b/CorsixTH/Src/th_lua_map.cpp index 8436bba..a36221a 100644 --- a/CorsixTH/Src/th_lua_map.cpp +++ b/CorsixTH/Src/th_lua_map.cpp @@ -500,7 +500,7 @@ static int l_map_remove_cell_thob(lua_State *L) if(static_cast((pNode->iFlags & 0xFF000000) >> 24) == thob) { pNode->iFlags &= 0x00FFFFFF; - pNode->iFlags |= (*pNode->pExtendedObjectList & (0xFFul << 3)) << 21; + pNode->iFlags |= (*pNode->pExtendedObjectList & (UINT32_C(0xFF) << 3)) << (24 - 3); if(nr == 1) { delete pNode->pExtendedObjectList; @@ -511,11 +511,11 @@ static int l_map_remove_cell_thob(lua_State *L) // shift all thobs in pExtentedObjectList by 8 bits to the right and update the count for(int i = 0; i < nr - 1; i++) { - uint64_t mask = 0xFFull << (3 + i * 8); + uint64_t mask = UINT64_C(0xFF) << (3 + i * 8); *pNode->pExtendedObjectList &= ~mask; *pNode->pExtendedObjectList |= (*pNode->pExtendedObjectList & (mask << 8)) >> 8; } - *pNode->pExtendedObjectList &= ~(0xFFull << (3 + nr * 8)); + *pNode->pExtendedObjectList &= ~(UINT64_C(0xFF) << (3 + nr * 8)); *pNode->pExtendedObjectList &= ~7; *pNode->pExtendedObjectList |= (nr - 1); } @@ -533,7 +533,7 @@ static int l_map_remove_cell_thob(lua_State *L) //shift all thobs to the left of the found one by 8 bits to the right for(int j = i; i < nr - 1; i++) { - uint64_t mask = 0xFFull << (3 + j * 8); + uint64_t mask = UINT64_C(0xFF) << (3 + j * 8); *pNode->pExtendedObjectList &= ~mask; *pNode->pExtendedObjectList |= (*pNode->pExtendedObjectList & (mask << 8)) >> 8; } @@ -546,7 +546,7 @@ static int l_map_remove_cell_thob(lua_State *L) if(nr > 0) { //delete the last thob in the list and update the count - *pNode->pExtendedObjectList &= ~(0xFFull << (3 + nr * 8)); + *pNode->pExtendedObjectList &= ~(UINT64_C(0xFF) << (3 + nr * 8)); *pNode->pExtendedObjectList &= ~7; *pNode->pExtendedObjectList |= nr; }