File fix_abs_of_unsigned_char_on_arm.patch of Package 0ad

From 0133d6070bf4c4b2c18c79bf72b53af23403a36d Mon Sep 17 00:00:00 2001
From: elexis <elexis@3db68df2-c116-0410-a063-a993310a9797>
Date: Sun, 14 Jan 2018 21:18:37 +0000
Subject: [PATCH] Fix build on armhf with gcc 7.

The abs caused a compiler error in that environment, because wchar_t is unsigned on armhf, subtracting signed from unsigned results in unsigned and std::abs does not define an unsigned variant.

Differential Revision: https://code.wildfiregames.com/D1122
Patch By: Peter Michael Green
Uploaded By: Ludovic



git-svn-id: https://svn.wildfiregames.com/public/ps/trunk@20869 3db68df2-c116-0410-a063-a993310a9797
---
 binaries/data/mods/public/gui/credits/texts/programming.json | 2 ++
 source/gui/CDropDown.cpp                                     | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/binaries/data/mods/public/gui/credits/texts/programming.json b/binaries/data/mods/public/gui/credits/texts/programming.json
index 8b30612dfd..cac3e81da9 100644
--- a/binaries/data/mods/public/gui/credits/texts/programming.json
+++ b/binaries/data/mods/public/gui/credits/texts/programming.json
@@ -129,6 +129,7 @@
 			{"nick": "livingaftermidnight", "name": "Will Dull"},
 			{"nick": "Louhike"},
 			{"nick": "lsdh"},
+			{"nick": "Ludovic", "name": "Ludovic Rousseau"},
 			{"nick": "madmax", "name": "Abhijit Nandy"},
 			{"nick": "madpilot", "name": "Guido Falsi"},
 			{"nick": "m0l0t0ph", "name": "Christoph Gielisch"},
@@ -171,6 +172,7 @@
 			{"nick": "PeteVasi", "name": "Pete Vasiliauskas"},
 			{"nick": "pilino1234"},
 			{"nick": "PingvinBetyar", "name": "Schronk Tamás"},
+			{"nick": "plugwash", "name": "Peter Michael Green"},
 			{"nick": "Polakrity"},
 			{"nick": "Poya", "name": "Poya Manouchehri"},
 			{"name": "Quentin Pradet"},
diff --git a/source/gui/CDropDown.cpp b/source/gui/CDropDown.cpp
index 09527b2048..5f4ac2710a 100644
--- a/source/gui/CDropDown.cpp
+++ b/source/gui/CDropDown.cpp
@@ -352,7 +352,7 @@ InReaction CDropDown::ManuallyHandleEvent(const SDL_Event_* ev)
 					int diff = 0;
 					for (size_t j = 0; j < m_InputBuffer.length(); ++j)
 					{
-						diff = std::abs(pList->m_Items[i].GetRawString().LowerCase()[j] - (int)m_InputBuffer[j]);
+						diff = std::abs((int)(pList->m_Items[i].GetRawString().LowerCase()[j]) - (int)m_InputBuffer[j]);
 						if (diff == 0)
 							indexOfDifference = j+1;
 						else
openSUSE Build Service is sponsored by