Bug#599629: sandboxgamemaker: FTBFS: error: member stats endianswap(T) […] not allowed in union

2010-10-11 Thread Scott Howard
tags 599629 patch
tags 599629 upstream
forwarded 599629  http://forum.sandboxgamemaker.com/tracker.php?p=3&t=63
thanks

Will need some testing, but here's a patch from upstream:

Index: src/rpggame/rpgio.cpp
===
--- src/rpggame/rpgio.cpp   (revision 2693)
+++ src/rpggame/rpgio.cpp   (revision 2694)
@@ -260,7 +260,7 @@
use_armour *arm = (use_armour *) usable;

f->read(&arm->reqs, sizeof(statreq));
-   lilswap(&arm->reqs);
+   lilswap(&arm->reqs.attrs[0], 
sizeof(statreq));

arm->slots = f->getlil();
arm->skill = f->getlil();
@@ -304,7 +304,7 @@
base->mdl = readstring(f);

f->read(&base->base, sizeof(stats));
-   lilswap(&base->base);
+   lilswap(&base->base.experience, sizeof(stats));

int items = f->getlil();
loopi(items)
@@ -605,7 +605,7 @@

saveheader hdr;
f->read(&hdr, sizeof(saveheader));
-   lilswap(&hdr);
+   lilswap(&hdr.version);

if(hdr.version != GAME_VERSION || strncmp(hdr.magic, 
GAME_MAGICZ, 4))
{
@@ -900,7 +900,7 @@
use_armour *use = (use_weapon *) 
item->uses[i];

statreq tmp = use->reqs;
-   lilswap(&tmp);
+   lilswap(&tmp.attrs[0], sizeof(statreq));
f->write(&tmp, sizeof(tmp));

f->putlil(use->slots);
@@ -933,7 +933,7 @@
writestring(f, base->mdl);

stats tmp = base->base;
-   lilswap(tmp);
+   lilswap(&tmp.experience, sizeof(stats));
f->write(&tmp, sizeof(stats));

f->putlil(base->inventory.length());
@@ -1193,7 +1193,7 @@
memcpy(hdr.magic, GAME_MAGICZ, 4);
hdr.version = GAME_VERSION;

-   lilswap(&hdr);
+   lilswap(&hdr.version);
f->write(&hdr, sizeof(saveheader));

lastmap = game::curmap;



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#599629: sandboxgamemaker: FTBFS: error: member stats endianswap(T) […] not allowed in union

2010-10-09 Thread Cyril Brulebois
Source: sandboxgamemaker
Version: 2.6+dfsg-1
Severity: serious
Justification: FTBFS

Hi,

your package no longer builds on at least powerpc, s390, sparc:
| g++ -O3 -fomit-frame-pointer  -Wall -fsigned-char -Ishared -Iengine 
-Ienet/include -I/usr/X11R6/include `sdl-config --cflags` -Irpggame   -c -o 
rpggame/rpgio.o rpggame/rpgio.cpp
| In file included from shared/cube.h:69:
| shared/tools.h: In instantiation of 'endianswap(T) [with T = 
stats]::':
| shared/tools.h:878:   instantiated from 'T endianswap(T) [with T = stats]'
| rpggame/rpgio.cpp:917:   instantiated from here
| shared/tools.h:878: error: member 'stats endianswap(T) [with T = 
stats]t' with constructor not allowed in union
| shared/tools.h:878: error: member 'stats endianswap(T) [with T = 
stats]t' with destructor not allowed in union
| rpggame/rpgio.cpp:712: warning: 'rpgio::__dummy_loadgame' defined but not used
| rpggame/rpgio.cpp:1239: warning: 'rpgio::__dummy_savegame' defined but not 
used
| make[2]: *** [rpggame/rpgio.o] Error 1

Full build logs:
  
https://buildd.debian.org/status/package.php?p=sandboxgamemaker&suite=experimental

Mraw,
KiBi.



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org