[Scummvm-cvs-logs] SF.net SVN: scummvm:[49878] scummvm/trunk/common/translation.cpp

dhewg at users.sourceforge.net dhewg at users.sourceforge.net
Tue Jun 15 19:50:14 CEST 2010


Revision: 49878
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49878&view=rev
Author:   dhewg
Date:     2010-06-15 17:50:14 +0000 (Tue, 15 Jun 2010)

Log Message:
-----------
Fix compilation when using ICONV_USES_CONST.

Modified Paths:
--------------
    scummvm/trunk/common/translation.cpp

Modified: scummvm/trunk/common/translation.cpp
===================================================================
--- scummvm/trunk/common/translation.cpp	2010-06-15 17:49:40 UTC (rev 49877)
+++ scummvm/trunk/common/translation.cpp	2010-06-15 17:50:14 UTC (rev 49878)
@@ -129,27 +129,29 @@
 bool TranslationManager::convert(const char *message) {
 	// Preparing conversion origin
 	size_t len = strlen(message);
+#ifdef ICONV_USES_CONST
+	const char *msg = message;
+	const char **pmsg = &msg;
+#else
 	char *msgcpy = new char[len + 1];
 	strcpy(msgcpy, message);
 	char *msg = msgcpy;
-#ifdef ICONV_USES_CONST
-	const char **pmsg = &msg;
-#else
 	char **pmsg = &msg;
 #endif
 
 	// Preparing conversion destination
 	size_t len2 = _sizeconv;
 	char *conv = _convmsg;
-	char **pconv = &conv;
 
 	// Clean previous conversions
-	iconv(_conversion, NULL, NULL, pconv, &len2);
+	iconv(_conversion, NULL, NULL, &conv, &len2);
 
 	// Do the real conversion
-	size_t result = iconv(_conversion, pmsg, &len, pconv, &len2);
+	size_t result = iconv(_conversion, pmsg, &len, &conv, &len2);
 
+#ifndef ICONV_USES_CONST
 	delete[] msgcpy;
+#endif
 
 	return result != ((size_t)-1);
 }


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