Thread: [TuxKart-devel] fixes
Status: Alpha
Brought to you by:
sjbaker
From: Red Z. <red...@pa...> - 2004-10-20 19:32:59
|
Hi, Not sure this is the right channel but I just compiled the latest CVS. I had to made some small changes for compatiblility in order to compile with 2.95.3. (running gentoo) None of these should break anything and are very straight forward If someone would be so nice to add them or let me doit that would be nice before the next official release. So here I go -------------------------------------------------------------- /cvsroot/tuxkart/tuxkart/src/KartManager.cxx /cvsroot/tuxkart/tuxkart/src/RaceManager.cxx /cvsroot/tuxkart/tuxkart/src/StringUtils.cxx /cvsroot/tuxkart/tuxkart/src/World.cxx had to add : #include <algorithm> ------------------------------------------------------------ /cvsroot/tuxkart/tuxkart/src/start_tuxkart.cxx replace: and by && replace: or by || -------------------------------------------------------------- /cvsroot/tuxkart/tuxkart/src/StringUtils.cxx < return lhs.compare(lhs.length() - rhs.length(), rhs.length(), rhs) == > return lhs.compare(rhs, lhs.length() - rhs.length(), rhs.length()) == none of the compare methods seems std++ ? -------------------------------------------------------------- /cvsroot/tuxkart/tuxkart/src/lisp/Lexer.cxx std::streamsize n = stream.readsome(buffer, BUFFER_SIZE); This is a bit different. readsome is not availabel in older versions so I replaced it with stream.reads(buffer, BUFFER_SIZE); std::streamsize n = stream.gcount(); Which should be exactly the same. However if that's realy the case then there might be an error in the 2 places a bit further where there is an check fo stream.eof. because then stream.eof would be true before c is at the end of the read buffer. (stream is already read and reached the end but there's still data there.) So I had to put the stream.eof check to ( while(1) and if (0) ) -------------------------------------------------------------- After all of this the games runs nicely and looks real good :-) red. |
From: James G. <j....@vi...> - 2004-10-20 22:50:18
|
On Wed, 2004-10-20 at 21:57, Red Zebra wrote: > Hi, > > Not sure this is the right channel but I just compiled the latest CVS. > I had to made some small changes for compatiblility in order to > compile with 2.95.3. (running gentoo) None of these should break > anything and are very straight forward > > If someone would be so nice to add them or let me doit that would be > nice before the next official release. > > So here I go > > -------------------------------------------------------------- > /cvsroot/tuxkart/tuxkart/src/KartManager.cxx > /cvsroot/tuxkart/tuxkart/src/RaceManager.cxx > /cvsroot/tuxkart/tuxkart/src/StringUtils.cxx > /cvsroot/tuxkart/tuxkart/src/World.cxx > > had to add : > #include <algorithm> Committed... > ------------------------------------------------------------ > /cvsroot/tuxkart/tuxkart/src/start_tuxkart.cxx > replace: and by && > replace: or by || Committed... > -------------------------------------------------------------- > /cvsroot/tuxkart/tuxkart/src/StringUtils.cxx > > < return lhs.compare(lhs.length() - rhs.length(), rhs.length(), rhs) == > > return lhs.compare(rhs, lhs.length() - rhs.length(), rhs.length()) == > > none of the compare methods seems std++ ? Not committed (at least by me, someone else might commit it) because according to "The C++ Programming Language" compare can take: const basic_string& const Ch* size_type, size_type, const basic_string& size_type, size_typ[e, const basic_string&, size_type, size_type size_type, size_type, const Ch*, size_type Currently it uses the 3rd one, your one doesn't seem to be there, so I'm not quite sure if that would fix more problems than it would create? > -------------------------------------------------------------- > /cvsroot/tuxkart/tuxkart/src/lisp/Lexer.cxx > > std::streamsize n = stream.readsome(buffer, BUFFER_SIZE); > > This is a bit different. readsome is not availabel in older > versions so I replaced it with > stream.reads(buffer, BUFFER_SIZE); > std::streamsize n = stream.gcount(); > Which should be exactly the same. However if that's realy the case then > there might be an error in the 2 places a bit further where there > is an check fo stream.eof. because then stream.eof would be true > before c is at the end of the read buffer. (stream is already read > and reached the end but there's still data there.) So I > had to put the stream.eof check to ( while(1) and if (0) ) I'll leave someone else who understands that code to deal with that. Thanks, James |
From: Red Z. <red...@pa...> - 2004-10-21 23:09:18
|
Just double checked on the compare issue. Seems like older gcc ain't compliant to ansi. :-( and lib definition changed. How about just working around that and using something like memcmp(lhs.c_str(), rhs.c_str(), lhs.length() - rhs.length())==0 Red. On Wed, 2004-10-20 at 21:57, Red Zebra wrote: > Hi, > > Not sure this is the right channel but I just compiled the latest CVS. > I had to made some small changes for compatiblility in order to > compile with 2.95.3. (running gentoo) None of these should break > anything and are very straight forward > > If someone would be so nice to add them or let me doit that would be > nice before the next official release. > > So here I go > > -------------------------------------------------------------- > /cvsroot/tuxkart/tuxkart/src/KartManager.cxx > /cvsroot/tuxkart/tuxkart/src/RaceManager.cxx > /cvsroot/tuxkart/tuxkart/src/StringUtils.cxx > /cvsroot/tuxkart/tuxkart/src/World.cxx > > had to add : > #include <algorithm> Committed... > ------------------------------------------------------------ > /cvsroot/tuxkart/tuxkart/src/start_tuxkart.cxx > replace: and by && > replace: or by || Committed... > -------------------------------------------------------------- > /cvsroot/tuxkart/tuxkart/src/StringUtils.cxx > > < return lhs.compare(lhs.length() - rhs.length(), rhs.length(), rhs) == > > return lhs.compare(rhs, lhs.length() - rhs.length(), rhs.length()) == > > none of the compare methods seems std++ ? Not committed (at least by me, someone else might commit it) because according to "The C++ Programming Language" compare can take: const basic_string& const Ch* size_type, size_type, const basic_string& size_type, size_typ[e, const basic_string&, size_type, size_type size_type, size_type, const Ch*, size_type Currently it uses the 3rd one, your one doesn"t seem to be there, so I"m not quite sure if that would fix more problems than it would create? > -------------------------------------------------------------- > /cvsroot/tuxkart/tuxkart/src/lisp/Lexer.cxx > > std::streamsize n = stream.readsome(buffer, BUFFER_SIZE); > > This is a bit different. readsome is not availabel in older > versions so I replaced it with > stream.reads(buffer, BUFFER_SIZE); > std::streamsize n = stream.gcount(); > Which should be exactly the same. However if that"s realy the case then > there might be an error in the 2 places a bit further where there > is an check fo stream.eof. because then stream.eof would be true > before c is at the end of the read buffer. (stream is already read > and reached the end but there"s still data there.) So I > had to put the stream.eof check to ( while(1) and if (0) ) I"ll leave someone else who understands that code to deal with that. Thanks, James |