Package: stratagus
Version: 2.1-9
Followup-For: Bug #296332

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In src/movie/vp31/FrameIni.c there is a macro:

#define ROUNDUP32(X) ( ( ( (unsigned long) X ) + 31 )&( 0xFFFFFFE0 ) )

which is, I guess, supposed to enforce some sort of alignment. Probably
nearest 32 byte boundry. However, not only does it do that, but it eats
the leading 32 bits out of the 64-bit pointer. Evil.

Changing it to:

#define ROUNDUP32(X) ( ( ( (unsigned long) X ) + 31 )&( 0xFFFFFFFFFFFFFFE0 ) )

of course fixes amd64, but I'm sure breaks ia32. 

There are also some playes where %d was used instead of %ld. Blame
damned ANSI/ISO for not assigning a %whatever for ptrdiff_t. I think
these changes will work on ia32.

Now it at least starts. Unfortunately, after playing a little while, we
get a new segfault:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1552124256 (LWP 32022)]
0x00002aaaab11fb25 in sem_post () from /lib/libpthread.so.0
(gdb) bt
#0  0x00002aaaab11fb25 in sem_post () from /lib/libpthread.so.0
#1  0x00002aaaaafd841e in SDL_SemPost () from /usr/lib/libSDL-1.2.so.0
#2  0x00002aaaaafd7ca1 in SDL_RunThread () from /usr/lib/libSDL-1.2.so.0
#3  0x00002aaaaafd7f79 in SDL_KillThread () from /usr/lib/libSDL-1.2.so.0
#4  0x00002aaaab11bb1c in start_thread () from /lib/libpthread.so.0
#5  0x00002aaaabaa99c2 in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()


Patch to get this far, and make it possible to build with noopt,nostrip
attached.

- -- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing'), (130, 'unstable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-1-amd64-k8-smp
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages stratagus depends on:
ii  bos [stratagus-data]      1.1-3          Invasion: Battle of Survival data 
ii  libbz2-1.0                1.0.3-2        high-quality block-sorting file co
ii  libc6                     2.3.6-7        GNU C Library: Shared libraries
ii  libflac7                  1.1.2-3.1      Free Lossless Audio Codec - runtim
ii  liblua50                  5.0.2-6        Main interpreter library for the L
ii  liblualib50               5.0.2-6        Extension library for the Lua 5.0 
ii  libogg0                   1.1.3-2        Ogg Bitstream Library
ii  libpng12-0                1.2.8rel-5.1   PNG library - runtime
ii  libsdl1.2debian           1.2.9-5        Simple DirectMedia Layer
ii  libvorbis0a               1.1.2-1        The Vorbis General Audio Compressi
ii  libvorbisfile3            1.1.2-1        The Vorbis General Audio Compressi
ii  libx11-6                  6.9.0.dfsg.1-6 X Window System protocol client li
ii  zlib1g                    1:1.2.3-11     compression library - runtime

stratagus recommends no packages.

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEdQou+z+IwlXqWf4RAkf2AJ96cPxqK3FO6txYv79oIzIkt084PwCbB7zr
p2N9b8+OeCqs6DqsdNLnrAY=
=KLnL
-----END PGP SIGNATURE-----
Only in stratagus-2.1.new/: build-stamp-no_opengl
Only in stratagus-2.1.new/: build-stamp-opengl
Only in stratagus-2.1.new/: config.log
Only in stratagus-2.1.new/: config.status
Only in stratagus-2.1.new/: configure-stamp-no_opengl
Only in stratagus-2.1.new/: configure-stamp-opengl
Only in stratagus-2.1.new/debian: files
Only in stratagus-2.1.new/debian: stratagus
Only in stratagus-2.1.new/debian: stratagus-gl
Only in stratagus-2.1.new/debian: stratagus-gl.postinst.debhelper
Only in stratagus-2.1.new/debian: stratagus-gl.postrm.debhelper
Only in stratagus-2.1.new/debian: stratagus-gl.prerm.debhelper
Only in stratagus-2.1.new/debian: stratagus-gl.substvars
Only in stratagus-2.1.new/debian: stratagus.postinst.debhelper
Only in stratagus-2.1.new/debian: stratagus.postrm.debhelper
Only in stratagus-2.1.new/debian: stratagus.prerm.debhelper
Only in stratagus-2.1.new/debian: stratagus.substvars
diff -rdbU3 stratagus-2.1/Makefile stratagus-2.1.new/Makefile
--- stratagus-2.1/Makefile	2006-05-24 19:39:55.000000000 -0400
+++ stratagus-2.1.new/Makefile	2006-05-24 20:55:34.000000000 -0400
@@ -356,3 +356,24 @@
 	rm $(PREFIX)/bin/stratagus
 	@echo uninstallation of stratagus complete
 
+
+### Fucking learn to write code that produces no warnings before turning
+### on -Werror....
+src/action/obj/action_patrol.o: src/action/obj/../action_patrol.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) -Wno-error -o $@ $<
+src/action/obj/action_resource.o: src/action/obj/../action_resource.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) -Wno-error -o $@ $<
+src/action/obj/command.o: src/action/obj/../command.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) -Wno-error -o $@ $<
+src/stratagus/obj/iolib.o: src/stratagus/obj/../iolib.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) -Wno-error -o $@ $<
+src/movie/vp31/obj/DDecode.o: src/movie/vp31/obj/../DDecode.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) -Wno-error -o $@ $<
+src/network/obj/network.o: src/network/obj/../network.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) -Wno-error -o $@ $<
+src/unit/obj/script_unit.o: src/unit/obj/../script_unit.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) -Wno-error -o $@ $<
+src/unit/obj/unit.o: src/unit/obj/../unit.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) -Wno-error -o $@ $<
+src/unit/obj/unit_draw.o: src/unit/obj/../unit_draw.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) -Wno-error -o $@ $<
Only in stratagus-2.1.new/: .Makefile.swp
Only in stratagus-2.1.new/: Rules.make
diff -rdbU3 stratagus-2.1/Rules.make.in stratagus-2.1.new/Rules.make.in
--- stratagus-2.1/Rules.make.in	2006-05-24 19:39:55.000000000 -0400
+++ stratagus-2.1.new/Rules.make.in	2006-05-24 20:43:34.000000000 -0400
@@ -55,7 +55,7 @@
     @OGG_CFLAGS@ @MAD_CFLAGS@ @FLAC_CFLAGS@ @CDAUDIO_CFLAGS@ \
     @MIKMOD_CFLAGS@ @LUA_CFLAGS@ $(CCL) \
     $(COMP_CFLAGS) @PLATFORM@ \
-    -I/usr/local/include
+    -I/usr/local/include -Wno-pointer-sign
 
 CTAGSFLAGS=-i defptvS -a -f 
 
Only in stratagus-2.1.new/src/action: obj
diff -rdbU3 stratagus-2.1/src/ai/ai_plan.c stratagus-2.1.new/src/ai/ai_plan.c
--- stratagus-2.1/src/ai/ai_plan.c	2004-06-17 21:48:11.000000000 -0400
+++ stratagus-2.1.new/src/ai/ai_plan.c	2006-05-24 20:20:20.000000000 -0400
@@ -514,8 +514,8 @@
 	int state;
 	Unit* transporter;
 
-	DebugPrint("Planning for force #%d of player #%d\n" _C_
-		force - AiPlayer->Force _C_ AiPlayer->Player->Player);
+	DebugPrint("Planning for force #%ld of player #%d\n" _C_
+		(long)(force - AiPlayer->Force) _C_ AiPlayer->Player->Player);
 
 	watermatrix = CreateMatrix();
 
Only in stratagus-2.1.new/src/ai: obj
Only in stratagus-2.1.new/src/beos: obj
diff -rdbU3 stratagus-2.1/src/editor/editloop.c stratagus-2.1.new/src/editor/editloop.c
--- stratagus-2.1/src/editor/editloop.c	2004-06-24 19:37:31.000000000 -0400
+++ stratagus-2.1.new/src/editor/editloop.c	2006-05-24 20:24:18.000000000 -0400
@@ -1781,8 +1781,8 @@
 		Assert(vp);
 		if (TheUI.MouseViewport != vp) { // viewport changed
 			TheUI.MouseViewport = vp;
-			DebugPrint("active viewport changed to %d.\n" _C_
-				TheUI.Viewports - vp);
+			DebugPrint("active viewport changed to %ld.\n" _C_
+				(long)(TheUI.Viewports - vp));
 		}
 		CursorOn = CursorOnMap;
 
Only in stratagus-2.1.new/src/editor: obj
Only in stratagus-2.1.new/src/game: obj
Only in stratagus-2.1.new/src/map: obj
Only in stratagus-2.1.new/src/missile: obj
Only in stratagus-2.1.new/src/movie: obj
diff -rdbU3 stratagus-2.1/src/movie/vp31/FrameIni.c stratagus-2.1.new/src/movie/vp31/FrameIni.c
--- stratagus-2.1/src/movie/vp31/FrameIni.c	2002-07-14 21:43:33.000000000 -0400
+++ stratagus-2.1.new/src/movie/vp31/FrameIni.c	2006-05-24 21:26:27.000000000 -0400
@@ -275,7 +275,7 @@
  *  ERRORS        :     None.
  *
  ****************************************************************************/
-#define ROUNDUP32(X) ( ( ( (unsigned long) X ) + 31 )&( 0xFFFFFFE0 ) )
+#define ROUNDUP32(X) ( ( ( (unsigned long) X ) + 31 )&( 0xFFFFFFFFFFFFFFE0 ) )
 BOOL AllocateFragmentInfo(PB_INSTANCE * pbi)
 {
 
Only in stratagus-2.1.new/src/movie/vp31: .FrameIni.c.swp
Only in stratagus-2.1.new/src/movie/vp31: obj
Only in stratagus-2.1.new/src/movie/vp31: .pb_globals.c.swp
Only in stratagus-2.1.new/src/network: obj
Only in stratagus-2.1.new/src/pathfinder: obj
Only in stratagus-2.1.new/src/sound: obj
Only in stratagus-2.1.new/src/stratagus: obj
diff -rdbU3 stratagus-2.1/src/ui/mouse.c stratagus-2.1.new/src/ui/mouse.c
--- stratagus-2.1/src/ui/mouse.c	2004-07-01 21:38:10.000000000 -0400
+++ stratagus-2.1.new/src/ui/mouse.c	2006-05-24 20:30:03.000000000 -0400
@@ -549,8 +549,8 @@
 		// viewport changed
 		if (TheUI.MouseViewport != vp) {
 			TheUI.MouseViewport = vp;
-			DebugPrint("current viewport changed to %d.\n" _C_
-				vp - TheUI.Viewports);
+			DebugPrint("current viewport changed to %ld.\n" _C_
+				(long)(vp - TheUI.Viewports));
 		}
 
 		// Note cursor on map can be in scroll area
@@ -1419,8 +1419,8 @@
 		if ((MouseButtons & LeftButton) &&
 				TheUI.SelectedViewport != TheUI.MouseViewport) {
 			TheUI.SelectedViewport = TheUI.MouseViewport;
-			DebugPrint("selected viewport changed to %d.\n" _C_
-				TheUI.SelectedViewport - TheUI.Viewports);
+			DebugPrint("selected viewport changed to %ld.\n" _C_
+				(long)(TheUI.SelectedViewport - TheUI.Viewports));
 		}
 
 		// to redraw the cursor immediately (and avoid up to 1 sec delay
Only in stratagus-2.1.new/src/ui: obj
Only in stratagus-2.1.new/src/unit: obj
diff -rdbU3 stratagus-2.1/src/unit/unittype.c stratagus-2.1.new/src/unit/unittype.c
--- stratagus-2.1/src/unit/unittype.c	2004-06-26 18:38:19.000000000 -0400
+++ stratagus-2.1.new/src/unit/unittype.c	2006-05-24 20:41:12.000000000 -0400
@@ -515,7 +515,7 @@
 	// FIXME: peon applies also to peon-with-gold and peon-with-wood
 	// FIXME: oil-tanker applies also to oil-tanker-full
 
-	DebugPrint("\tUDTA used %d bytes\n" _C_ udta-start);
+	DebugPrint("\tUDTA used %ld bytes\n" _C_ (long)(udta-start));
 
 	UpdateStats(1);
 }
Only in stratagus-2.1.new/src/video: obj
Only in stratagus-2.1.new/: stratagus-no_opengl
Only in stratagus-2.1.new/: stratagus-opengl
Only in stratagus-2.1.new/: tags

Reply via email to