games/xlogical fails with bad C++ code error when compiled with gcc 4.2 Fix: Add this patch to files/patch-gamelogic.cpp: - currentMap = NULL; + currentMap = (list< class Clevel_map *>::iterator)NULL; playerName = new char[32+1]; strcpy( playerName, "nobody" );--1vfzgLrhXpFUfP6YqxS1wz3ZNaCUTERszSb53hvsXLwPGSl7 Content-Type: text/plain; name="file.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="file.diff" --- gamelogic.cpp.orig 2007-10-19 14:00:18.000000000 +0200 +++ gamelogic.cpp 2007-10-19 13:57:53.000000000 +0200 @@ -154,7 +154,7 @@ levelFile = NULL; } How-To-Repeat: cd /usr/ports/games/xlogical && make
State Changed From-To: open->feedback Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Sergio Mangialardi wrote: > Pietro Cerutti wrote: >> >> - currentMap = NULL; >> + currentMap = (list< class Clevel_map *>::iterator)NULL; > I'm sorry, but in my opinion this isn't correct. There is no general way > to initialize an iterator to NULL because iterators are not pointers > (even though iterators are often implemented by pointers). > currentMap should be set to the end of the container to which the > iterator belongs. > > Sergio. You are right. Please comment on this one: --- gamelogic.cpp.orig 2007-10-19 17:52:30.000000000 +0200 +++ gamelogic.cpp 2007-10-19 17:53:15.000000000 +0200 @@ -154,7 +154,7 @@ levelFile = NULL; } - currentMap = NULL; + currentMap = gameLevels.end( ); playerName = new char[32+1]; strcpy( playerName, "nobody" ); -- Pietro Cerutti PGP Public Key: http://gahr.ch/pgp
Sergio Mangialardi wrote: > Pietro Cerutti wrote: >> >> You are right. Please comment on this one: >> >> --- gamelogic.cpp.orig 2007-10-19 17:52:30.000000000 +0200 >> +++ gamelogic.cpp 2007-10-19 17:53:15.000000000 +0200 >> @@ -154,7 +154,7 @@ >> levelFile = NULL; >> } >> >> - currentMap = NULL; >> + currentMap = gameLevels.end( ); > This is the correct initialization of currentMap, because it is > independent of the underlying implementation of the iterator. > > Sergio. Thanks. I think the patch is ready to be committed. -- Pietro Cerutti PGP Public Key: http://gahr.ch/pgp
Responsible Changed From-To: freebsd-ports-bugs->miwi I'll take it.
Hey, I've tried to fix this port couple of days ago, but dropped it as it also had install problems. My solution was to just remove line assigning NULL to iterator. As far as I understand, uninitialized iterator should behave just as expected. -- Dmitry A. Marakasov | jabber: amdmi3@jabber.ru amdmi3@amdmi3.ru | http://www.amdmi3.ru
Dmitry Marakasov wrote: > Hey, I've tried to fix this port couple of days ago, but dropped it as it > also had install problems. My solution was to just remove line assigning > NULL to iterator. As far as I understand, uninitialized iterator should > behave just as expected. > Hey thanks. Actually, the current problem with xlogical is that the tarball is corrupted. Otherwise, the patch should be ok (look at my patch after Sergio Mangialardi's comment). I've send an e-mail to the author.. keep an eye to the PR's follow ups for updates ;-) Cheers, -- Pietro Cerutti PGP Public Key: http://gahr.ch/pgp
miwi 2007-11-06 10:26:13 UTC FreeBSD ports repository Modified files: games/xlogical Makefile Added files: games/xlogical/files patch-Makefile.am patch-acinclude.m4 patch-gamelogic.cpp patch-gpl.h patch-graph_images.cpp patch-levelmap.cpp patch-mapedit.cpp patch-menuentry.cpp patch-music_files.cpp patch-sound_files.cpp Log: - Fix build with gcc 4.2 PR: 117319 Submitted by: Pietro Cerutti <gahr@gahr.ch> Approved by: portmgr (pav) Revision Changes Path 1.3 +15 -21 ports/games/xlogical/Makefile 1.1 +10 -0 ports/games/xlogical/files/patch-Makefile.am (new) 1.1 +11 -0 ports/games/xlogical/files/patch-acinclude.m4 (new) 1.1 +499 -0 ports/games/xlogical/files/patch-gamelogic.cpp (new) 1.1 +11 -0 ports/games/xlogical/files/patch-gpl.h (new) 1.1 +11 -0 ports/games/xlogical/files/patch-graph_images.cpp (new) 1.1 +20 -0 ports/games/xlogical/files/patch-levelmap.cpp (new) 1.1 +88 -0 ports/games/xlogical/files/patch-mapedit.cpp (new) 1.1 +28 -0 ports/games/xlogical/files/patch-menuentry.cpp (new) 1.1 +11 -0 ports/games/xlogical/files/patch-music_files.cpp (new) 1.1 +11 -0 ports/games/xlogical/files/patch-sound_files.cpp (new) _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: feedback->closed Committed. Thanks!
FYI: the final patch is here: http://www.gahr.ch/FreeBSD/patches/117319_xlogical.diff -- Pietro Cerutti PGP Public Key: http://gahr.ch/pgp