1
0
forked from 0ad/0ad

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
This was SVN commit r20869.
This commit is contained in:
elexis 2018-01-14 21:18:37 +00:00
parent 8ede017904
commit b982e7f510
2 changed files with 3 additions and 1 deletions

View File

@ -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"},

View File

@ -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