[Scummvm-cvs-logs] SF.net SVN: scummvm:[53240] scummvm/trunk/engines/sword25

sev at users.sourceforge.net sev at users.sourceforge.net
Wed Oct 13 00:44:55 CEST 2010


Revision: 53240
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53240&view=rev
Author:   sev
Date:     2010-10-12 22:44:55 +0000 (Tue, 12 Oct 2010)

Log Message:
-----------
SWORD25: Portability fixes. Now compiles and runs under Linux.

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/kernel/log.cpp
    scummvm/trunk/engines/sword25/kernel/persistenceservice.cpp
    scummvm/trunk/engines/sword25/util/lua/lbaselib.c

Modified: scummvm/trunk/engines/sword25/kernel/log.cpp
===================================================================
--- scummvm/trunk/engines/sword25/kernel/log.cpp	2010-10-12 22:44:29 UTC (rev 53239)
+++ scummvm/trunk/engines/sword25/kernel/log.cpp	2010-10-12 22:44:55 UTC (rev 53240)
@@ -85,7 +85,7 @@
 	// Create the message
 	va_list ArgList;
 	va_start(ArgList, Format);
-	_vsnprintf(Message, sizeof(Message), Format, ArgList);
+	vsnprintf(Message, sizeof(Message), Format, ArgList);
 
 	// Log the message
 	_WriteLog(Message);
@@ -100,19 +100,19 @@
 	// If the issue has ceased at the beginning of a new line, the new issue to begin with the prefix
 	ExtFormat[0] = 0;
 	if (_LineBegin) {
-		_snprintf(ExtFormat, sizeof(ExtFormat), "%s%s: ", ExtFormat, Prefix);
+		snprintf(ExtFormat, sizeof(ExtFormat), "%s%s: ", ExtFormat, Prefix);
 		_LineBegin = false;
 	}
 	// Format String pass line by line and each line with the initial prefix
 	for (;;) {
 		const char *NextLine = strstr(Format, "\n");
 		if (!NextLine || *(NextLine + strlen("\n")) == 0) {
-			_snprintf(ExtFormat, sizeof(ExtFormat), "%s%s", ExtFormat, Format);
+			snprintf(ExtFormat, sizeof(ExtFormat), "%s%s", ExtFormat, Format);
 			if (NextLine) _LineBegin = true;
 			break;
 		} else {
 			strncat(ExtFormat, Format, (NextLine - Format) + strlen("\n"));
-			_snprintf(ExtFormat, sizeof(ExtFormat), "%s%s: ", ExtFormat, Prefix);
+			snprintf(ExtFormat, sizeof(ExtFormat), "%s%s: ", ExtFormat, Prefix);
 		}
 
 		Format = NextLine + strlen("\n");
@@ -121,7 +121,7 @@
 	// Create message
 	va_list ArgList;
 	va_start(ArgList, Format);
-	_vsnprintf(Message, sizeof(Message), ExtFormat, ArgList);
+	vsnprintf(Message, sizeof(Message), ExtFormat, ArgList);
 
 	// Log the message
 	_WriteLog(Message);
@@ -134,12 +134,12 @@
 	char Message[LOG_BUFFERSIZE];
 	va_list ArgList;
 	va_start(ArgList, Format);
-	_vsnprintf(Message, sizeof(Message), Format, ArgList);
+	vsnprintf(Message, sizeof(Message), Format, ArgList);
 
 	// Zweiten Prefix erzeugen, falls gew\xFCnscht
 	char SecondaryPrefix[1024];
 	if (_File && _Line)
-		_snprintf(SecondaryPrefix, sizeof(SecondaryPrefix), "(file: %s, line: %d) - ", _File, _Line);
+		snprintf(SecondaryPrefix, sizeof(SecondaryPrefix), "(file: %s, line: %d) - ", _File, _Line);
 
 	// Nachricht zeilenweise ausgeben und an jeden Zeilenanfang das Pr\xE4fix setzen
 	char *MessageWalker = Message;

Modified: scummvm/trunk/engines/sword25/kernel/persistenceservice.cpp
===================================================================
--- scummvm/trunk/engines/sword25/kernel/persistenceservice.cpp	2010-10-12 22:44:29 UTC (rev 53239)
+++ scummvm/trunk/engines/sword25/kernel/persistenceservice.cpp	2010-10-12 22:44:55 UTC (rev 53240)
@@ -339,10 +339,10 @@
 
 	// L\xE4nge der komprimierten Daten und der unkomprimierten Daten in die Datei schreiben.
 	char sBuffer[10];
-	ltoa(CompressedLength, sBuffer, 10);
+	snprintf(sBuffer, 10, "%ld", CompressedLength);
 	File->writeString(sBuffer);
 	File->writeByte(' ');
-	ltoa(Writer.GetDataSize(), sBuffer, 10);
+	snprintf(sBuffer, 10, "%uld", Writer.GetDataSize());
 	File->writeString(sBuffer);
 	File->writeByte(' ');
 

Modified: scummvm/trunk/engines/sword25/util/lua/lbaselib.c
===================================================================
--- scummvm/trunk/engines/sword25/util/lua/lbaselib.c	2010-10-12 22:44:29 UTC (rev 53239)
+++ scummvm/trunk/engines/sword25/util/lua/lbaselib.c	2010-10-12 22:44:55 UTC (rev 53240)
@@ -27,10 +27,6 @@
 ** model but changing `fputs' to put the strings at a proper place
 ** (a console window or a log file, for instance).
 */
-// -----------------------------------------------------------------------------
-// BS25
-// Aufruf der BS25 Log-Funktion
-// -----------------------------------------------------------------------------
 static int luaB_print (lua_State *L) {
   int n = lua_gettop(L);  /* number of arguments */
   int i;


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