teeworlds: fix big endian builds (upstream patch)

[ci skip]
This commit is contained in:
q66 2019-12-03 02:21:23 +01:00 committed by Helmut Pozimski
parent fd45c92d98
commit b2155dd01a

View file

@ -0,0 +1,24 @@
This fixes big endian builds in general.
From 7dc19230d04a895cfc1085cf5b0e62326d6e2cd3 Mon Sep 17 00:00:00 2001
From: Jordy Ruiz <jordy.ruiz@univ-lille.fr>
Date: Fri, 26 Apr 2019 17:55:03 +0200
Subject: [PATCH] Fix s390x: explicit conversion to unsigned
---
src/engine/shared/datafile.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/engine/shared/datafile.cpp b/src/engine/shared/datafile.cpp
index 676800c637..c4e809738e 100644
--- src/engine/shared/datafile.cpp
+++ src/engine/shared/datafile.cpp
@@ -172,7 +172,7 @@ bool CDataFileReader::Open(class IStorage *pStorage, const char *pFilename, int
m_pDataFile = pTmpDataFile;
#if defined(CONF_ARCH_ENDIAN_BIG)
- swap_endian(m_pDataFile->m_pData, sizeof(int), min(static_cast<unsigned>(Header.m_Swaplen), Size) / sizeof(int));
+ swap_endian(m_pDataFile->m_pData, sizeof(int), min(static_cast<unsigned>(Header.m_Swaplen), static_cast<unsigned>(Size)) / sizeof(int));
#endif
//if(DEBUG)