[Scummvm-cvs-logs] SF.net SVN: scummvm: [30599] scummvm/trunk/common

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Jan 21 14:01:33 CET 2008


Revision: 30599
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30599&view=rev
Author:   fingolfin
Date:     2008-01-21 05:01:32 -0800 (Mon, 21 Jan 2008)

Log Message:
-----------
replaced the unsafe tag2str implementation by a safe one, now that it seems to be meant for general use ;)

Modified Paths:
--------------
    scummvm/trunk/common/util.cpp
    scummvm/trunk/common/util.h

Modified: scummvm/trunk/common/util.cpp
===================================================================
--- scummvm/trunk/common/util.cpp	2008-01-21 12:44:39 UTC (rev 30598)
+++ scummvm/trunk/common/util.cpp	2008-01-21 13:01:32 UTC (rev 30599)
@@ -640,12 +640,12 @@
 	return str;
 }
 
-const char *tag2str(uint32 tag) {
-	static char str[5];
+Common::String tag2string(uint32 tag) {
+	char str[5];
 	str[0] = (char)(tag >> 24);
 	str[1] = (char)(tag >> 16);
 	str[2] = (char)(tag >> 8);
 	str[3] = (char)tag;
 	str[4] = '\0';
-	return str;
+	return Common::String(str);
 }

Modified: scummvm/trunk/common/util.h
===================================================================
--- scummvm/trunk/common/util.h	2008-01-21 12:44:39 UTC (rev 30598)
+++ scummvm/trunk/common/util.h	2008-01-21 13:01:32 UTC (rev 30599)
@@ -319,7 +319,8 @@
 
 char *scumm_strrev(char *str);
 
-const char *tag2str(uint32 tag);
+Common::String tag2string(uint32 tag);
+#define tag2str(x)	tag2string(x).c_str()
 
 
 #endif


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list