[Scummvm-cvs-logs] SF.net SVN: scummvm:[52593] scummvm/trunk/common
mthreepwood at users.sourceforge.net
mthreepwood at users.sourceforge.net
Mon Sep 6 16:59:14 CEST 2010
Revision: 52593
http://scummvm.svn.sourceforge.net/scummvm/?rev=52593&view=rev
Author: mthreepwood
Date: 2010-09-06 14:59:13 +0000 (Mon, 06 Sep 2010)
Log Message:
-----------
COMMON: Add a debugPrint function to Rational
Modified Paths:
--------------
scummvm/trunk/common/rational.cpp
scummvm/trunk/common/rational.h
Modified: scummvm/trunk/common/rational.cpp
===================================================================
--- scummvm/trunk/common/rational.cpp 2010-09-06 13:31:27 UTC (rev 52592)
+++ scummvm/trunk/common/rational.cpp 2010-09-06 14:59:13 UTC (rev 52593)
@@ -22,6 +22,7 @@
* $Id$
*/
+#include "common/debug.h"
#include "common/rational.h"
#include "common/util.h"
#include "common/algorithm.h"
@@ -289,6 +290,10 @@
return tmp;
}
+void Rational::debugPrint(int debuglevel, const char *caption) const {
+ debug(debuglevel, "%s %d/%d", caption, _num, _denom);
+}
+
bool operator==(int left, const Rational &right) {
return right == left;
}
Modified: scummvm/trunk/common/rational.h
===================================================================
--- scummvm/trunk/common/rational.h 2010-09-06 13:31:27 UTC (rev 52592)
+++ scummvm/trunk/common/rational.h 2010-09-06 14:59:13 UTC (rev 52593)
@@ -86,6 +86,8 @@
double toDouble() const;
frac_t toFrac() const;
+ void debugPrint(int debuglevel = 0, const char *caption = "Rational:") const;
+
private:
int _num;
int _denom;
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