narrowing conversion build error using Gcc 6
Challenging Puzzle / Arcade hybrid
Status: Beta
Brought to you by:
vexorian
GCC 6 is more strict when it comes to conversions, there's some -1 stored in arrays of unsigned char in xsb_level.cpp.
I have applied the following patch in Debian:
--- a/src/xsb_level.cpp
+++ b/src/xsb_level.cpp
@@ -784,14 +784,14 @@
bool FromXyeDFS(int* mem, unsigned char x, unsigned char y)
{
- static const unsigned char dx[4] = {0,0,-1,1}, dy[4] = {-1,1,0,0};
+ static const int dx[4] = {0,0,-1,1}, dy[4] = {-1,1,0,0};
int &res = mem[y*XYE_HORZ+x];
if( res==0)
{
res = 1;
for (int t=0; t<4; t++)
{
- unsigned char nx = x+dx[t], ny=y+dy[t];
+ int nx = x+dx[t], ny=y+dy[t];
if ( (nx<XYE_HORZ) && (ny<XYE_VERT)
&& (( game::Square(x,y)->object == NULL) || ( game::Square(x,y)->object->GetType() == OT_BLOCK))
)
My fix for this is: https://sourceforge.net/p/xye/patches/7/