On Thu, May 25, 2006 at 12:06:47AM -0400, Anthony DeRobertis wrote: > Anyway, if you conditionalize my alignment code to only be on 64-bit > platforms, I think you'll have a patch to fix this issue.
I minimalized your patch (removing the stuff to set -Wno-error, as it's only relevant with noopt), and recoded the ROUNDUP32 macro to be sizeof(long)-irrelevant. I don't have a desktop amd64 available, though, so it's hard to say if the patch will work or not. Also, I met the following problem when trying to build: src/ui/obj/menu_proc.o: In function `PasteFromClipboard': menu_proc.c:(.text+0x26ec): undefined reference to `XOpenDisplay' menu_proc.c:(.text+0x2740): undefined reference to `XCreateSimpleWindow' menu_proc.c:(.text+0x2765): undefined reference to `XConvertSelection' menu_proc.c:(.text+0x2772): undefined reference to `XNextEvent' menu_proc.c:(.text+0x27a4): undefined reference to `XCloseDisplay' menu_proc.c:(.text+0x2818): undefined reference to `XGetWindowProperty' menu_proc.c:(.text+0x2823): undefined reference to `XDestroyWindow' menu_proc.c:(.text+0x282b): undefined reference to `XCloseDisplay' menu_proc.c:(.text+0x284c): undefined reference to `XFree' menu_proc.c:(.text+0x28a2): undefined reference to `XFree' collect2: ld returned 1 exit status Now, what's that? :-) /* Steinar */ -- Homepage: http://www.sesse.net/
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(); 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; 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 )&(unsigned long)( -32L ) ) BOOL AllocateFragmentInfo(PB_INSTANCE * pbi) { 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 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); }