Skip to content
Permalink
Browse files

teeworlds: fix big endian builds (upstream patch)

[ci skip]
  • Loading branch information
q66 authored and Hoshpak committed Dec 3, 2019
1 parent fd45c92 commit b2155dd01a4ca8f70e2e08c3c15cda84b2a0836a
Showing with 24 additions and 0 deletions.
  1. +24 −0 srcpkgs/teeworlds/patches/7dc19230d04a895cfc1085cf5b0e62326d6e2cd3.patch
@@ -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)

0 comments on commit b2155dd

Please sign in to comment.
You can’t perform that action at this time.