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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Nov 1 21:41:32 CET 2010


Revision: 54023
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54023&view=rev
Author:   fingolfin
Date:     2010-11-01 20:41:32 +0000 (Mon, 01 Nov 2010)

Log Message:
-----------
COMMON: Get rid of the debug() output formatter

Now Engine::errorString is only used by error(), as its name suggests.
This also resolves the inconsistency between debug & debugN.

Modified Paths:
--------------
    scummvm/trunk/common/debug.cpp
    scummvm/trunk/common/debug.h
    scummvm/trunk/engines/engine.cpp

Modified: scummvm/trunk/common/debug.cpp
===================================================================
--- scummvm/trunk/common/debug.cpp	2010-11-01 20:41:03 UTC (rev 54022)
+++ scummvm/trunk/common/debug.cpp	2010-11-01 20:41:32 UTC (rev 54023)
@@ -123,31 +123,15 @@
 		return (gDebugChannelsEnabled & channel) != 0;
 }
 
-
-
-static OutputFormatter s_debugOutputFormatter = 0;
-
-void setDebugOutputFormatter(OutputFormatter f) {
-	s_debugOutputFormatter = f;
-}
-
 }	// End of namespace Common
 
 
 #ifndef DISABLE_TEXT_CONSOLE
 
 static void debugHelper(const char *s, va_list va, bool caret = true) {
-	char in_buf[STRINGBUFLEN];
 	char buf[STRINGBUFLEN];
-	vsnprintf(in_buf, STRINGBUFLEN, s, va);
 
-	// Next, give the active engine (if any) a chance to augment the message,
-	// but only if not used from debugN.
-	if (caret && Common::s_debugOutputFormatter) {
-		(*Common::s_debugOutputFormatter)(buf, in_buf, STRINGBUFLEN);
-	} else {
-		strncpy(buf, in_buf, STRINGBUFLEN);
-	}
+	vsnprintf(buf, STRINGBUFLEN, s, va);
 	buf[STRINGBUFLEN-1] = '\0';
 
 	if (caret) {

Modified: scummvm/trunk/common/debug.h
===================================================================
--- scummvm/trunk/common/debug.h	2010-11-01 20:41:03 UTC (rev 54022)
+++ scummvm/trunk/common/debug.h	2010-11-01 20:41:32 UTC (rev 54023)
@@ -26,19 +26,7 @@
 #define COMMON_DEBUG_H
 
 #include "common/scummsys.h"
-#include "common/textconsole.h"
 
-namespace Common {
-
-/**
- * Set the output formatter used by debug() and related functions.
- */
-void setDebugOutputFormatter(OutputFormatter f);
-
-
-}	// End of namespace Common
-
-
 #ifdef DISABLE_TEXT_CONSOLE
 
 inline void debug(const char *s, ...) {}

Modified: scummvm/trunk/engines/engine.cpp
===================================================================
--- scummvm/trunk/engines/engine.cpp	2010-11-01 20:41:03 UTC (rev 54022)
+++ scummvm/trunk/engines/engine.cpp	2010-11-01 20:41:32 UTC (rev 54023)
@@ -99,7 +99,6 @@
 		_mainMenuDialog(NULL) {
 
 	g_engine = this;
-	Common::setDebugOutputFormatter(defaultOutputFormatter);
 	Common::setErrorOutputFormatter(defaultOutputFormatter);
 	Common::setErrorHandler(defaultErrorHandler);
 


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