[Scummvm-cvs-logs] scummvm master -> b5a63d6709e87005c9b02fa02d4ae8802b7ce915

fuzzie fuzzie at fuzzie.org
Wed Aug 15 00:23:58 CEST 2012


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b5a63d6709 COMMON: Remove fprintf/stderr usage from xmlparser.


Commit: b5a63d6709e87005c9b02fa02d4ae8802b7ce915
    https://github.com/scummvm/scummvm/commit/b5a63d6709e87005c9b02fa02d4ae8802b7ce915
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2012-08-14T15:15:29-07:00

Commit Message:
COMMON: Remove fprintf/stderr usage from xmlparser.

Changed paths:
    common/xmlparser.cpp



diff --git a/common/xmlparser.cpp b/common/xmlparser.cpp
index ea3d44c..f0b7f1c 100644
--- a/common/xmlparser.cpp
+++ b/common/xmlparser.cpp
@@ -20,15 +20,11 @@
  *
  */
 
-// FIXME: Avoid using fprintf
-#define FORBIDDEN_SYMBOL_EXCEPTION_fprintf
-#define FORBIDDEN_SYMBOL_EXCEPTION_stderr
-
-
 #include "common/xmlparser.h"
 #include "common/archive.h"
 #include "common/fs.h"
 #include "common/memstream.h"
+#include "common/system.h"
 
 namespace Common {
 
@@ -123,17 +119,19 @@ bool XMLParser::parserError(const String &errStr) {
 			keyClosing = currentPosition;
 	}
 
-	fprintf(stderr, "\n  File <%s>, line %d:\n", _fileName.c_str(), lineCount);
+	Common::String errorMessage = Common::String::format("\n  File <%s>, line %d:\n", _fileName.c_str(), lineCount);
 
 	currentPosition = (keyClosing - keyOpening);
 	_stream->seek(keyOpening, SEEK_SET);
 
 	while (currentPosition--)
-		fprintf(stderr, "%c", _stream->readByte());
+		errorMessage += (char)_stream->readByte();
+
+	errorMessage += "\n\nParser error: ";
+	errorMessage += errStr;
+	errorMessage += "\n\n";
 
-	fprintf(stderr, "\n\nParser error: ");
-	fprintf(stderr, "%s", errStr.c_str());
-	fprintf(stderr, "\n\n");
+	g_system->logMessage(LogMessageType::kError, errorMessage.c_str());
 
 	return false;
 }






More information about the Scummvm-git-logs mailing list