[Scummvm-cvs-logs] CVS: scummvm/common file.cpp,1.18,1.19

Max Horn fingolfin at users.sourceforge.net
Tue Oct 22 16:37:04 CEST 2002


Update of /cvsroot/scummvm/scummvm/common
In directory usw-pr-cvs1:/tmp/cvs-serv30452/common

Modified Files:
	file.cpp 
Log Message:
fixed warnings (and simplified the code, gosh, aquadran, why so complicated? :-)

Index: file.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/file.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- file.cpp	22 Oct 2002 20:40:51 -0000	1.18
+++ file.cpp	22 Oct 2002 23:36:54 -0000	1.19
@@ -29,7 +29,6 @@
 
 	strcpy(buf, directory);
 	if (directory[0] != 0) {
-		strcpy(buf, directory);
 #ifdef __MORPHOS__
 		if (buf[strlen(buf)-1] != ':' && buf[strlen(buf)-1] != '/')
 #endif
@@ -41,25 +40,25 @@
 	if (file)
 		return file;
 
-	struct t_dirs {
-		char dir[20];
-	} dirs[] = {
+	const char *dirs[] = {
 		"",
-		"video/",			"VIDEO/",
-		"data/",			"DATA/",
-		"resource/",	"RESOURCE/"
+		"video/",
+		"VIDEO/",
+		"data/",
+		"DATA/",
+		"resource/",
+		"RESOURCE/"
 	};
 
 	for (uint8 l = 0; l < 7; l++) {
 		strcpy(buf, directory);
 		if (directory[0] != 0) {
-			strcpy(buf, directory);
 #ifdef __MORPHOS__
 			if (buf[strlen(buf)-1] != ':' && buf[strlen(buf)-1] != '/')
 #endif
 			strcat(buf, "/");
 		}
-		strcat(buf, dirs[l].dir);
+		strcat(buf, dirs[l]);
 		int8 len = strlen(buf);
 		strcat(buf, filename);
 





More information about the Scummvm-git-logs mailing list