Page 1 of 1

Changeset 2118

Posted: 07 Jun 2009 15:35
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?

Re: Changeset 2118

Posted: 07 Jun 2009 23:22
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

Re: Changeset 2118

Posted: 08 Jun 2009 02:28
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.

Re: Changeset 2118

Posted: 08 Jun 2009 06:51
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...

Posted: 08 Jun 2009 20:48
by Lakie
Changes are done in 2123.

~ Lakie

Re: Changeset 2118

Posted: 13 Jun 2009 21:19
by copperpen
The last I see are the 2112. I sem to have lost sight of the nightlies download page.

Re: Changeset 2118

Posted: 13 Jun 2009 22:40
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.

Re: Changeset 2118

Posted: 14 Jun 2009 19:20
by copperpen
Thank you for confirming that my little grey cells have not migrated early. :D