Changeset 2118

Get help, info, news and advice about the Transport Tycoon Deluxe patch.

Moderator: TTDPatch Moderators

Post Reply
User avatar
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Changeset 2118

Post by minime »

which do not allow implicit conversion of 'const char *' to 'char *'
Come on, this behaviour is there for a good reason.

Considering grfcodec contains its own implementation of basename, which doesn't modify its argument, why not modify its signature accordingly (to a const char*, since that corresponds to how the function works), rather than casting the const away?
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. --Albert Einstein
Image Image Image
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: Changeset 2118

Post by Lakie »

I merely fixed an issue created by DaleStan, whether good or not, it was merely there to help me (and possibly others) compile GrfDiff.
I did tell DaleStan about the conversion warning but he failed to find any reasons for why it'd happen or experience it himself.

Also since I've not really looked in huge detail into how GrfDiff worked, as such, I wasn't really willing to alter the functions.

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Changeset 2118

Post by DaleStan »

I'm reluctant to back out the change since my compiler didn't complain.

And Lakie, as I said, if you told me, I did not see it.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1732
Joined: 30 Mar 2005 09:43

Re: Changeset 2118

Post by peter1138 »

Code: Select all

Index: grfdiff.cc
===================================================================
--- grfdiff.cc	(revision 2120)
+++ grfdiff.cc	(working copy)
@@ -253,7 +253,7 @@
 	fseek(grf, fpos_cur, SEEK_SET);
 }
 
-char *basename(char *filename)
+char *basename(const char *filename)
 {
 	static char bname[32];
 	fnsplit(filename, NULL, NULL, bname, NULL);
@@ -389,7 +389,7 @@
 	}
 
 	if (grd) {
-		char *noext = basename((char *)grffile[1]);
+		char *noext = basename(grffile[1]);
 		char *p;
 
 		for (p = noext; *p; p++) { *p = tolower(*p); }
Not exactly altering functions...
He's like, some kind of OpenTTD developer.
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Post by Lakie »

Changes are done in 2123.

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
copperpen
Engineer
Engineer
Posts: 35
Joined: 24 Apr 2006 21:14

Re: Changeset 2118

Post by copperpen »

The last I see are the 2112. I sem to have lost sight of the nightlies download page.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Changeset 2118

Post by wallyweb »

copperpen wrote:The last I see are the 2112. I sem to have lost sight of the nightlies download page.
The nightlies are here and it is still at r2112.
copperpen
Engineer
Engineer
Posts: 35
Joined: 24 Apr 2006 21:14

Re: Changeset 2118

Post by copperpen »

Thank you for confirming that my little grey cells have not migrated early. :D
Post Reply

Return to “General TTDPatch”

Who is online

Users browsing this forum: No registered users and 15 guests