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

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sat Sep 11 12:03:32 CEST 2010


Revision: 52675
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52675&view=rev
Author:   drmccoy
Date:     2010-09-11 10:03:31 +0000 (Sat, 11 Sep 2010)

Log Message:
-----------
COMMON: Fix int-Rational operators

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

Modified: scummvm/trunk/common/rational.cpp
===================================================================
--- scummvm/trunk/common/rational.cpp	2010-09-11 05:28:54 UTC (rev 52674)
+++ scummvm/trunk/common/rational.cpp	2010-09-11 10:03:31 UTC (rev 52675)
@@ -259,26 +259,26 @@
 }
 
 const Rational operator+(int left, const Rational &right) {
-	Rational tmp = right;
-	tmp += left;
+	Rational tmp(left);
+	tmp += right;
 	return tmp;
 }
 
 const Rational operator-(int left, const Rational &right) {
-	Rational tmp = right;
-	tmp -= left;
+	Rational tmp(left);
+	tmp -= right;
 	return tmp;
 }
 
 const Rational operator*(int left, const Rational &right) {
-	Rational tmp = right;
-	tmp *= left;
+	Rational tmp(left);
+	tmp *= right;
 	return tmp;
 }
 
 const Rational operator/(int left, const Rational &right) {
-	Rational tmp = right;
-	tmp /= left;
+	Rational tmp(left);
+	tmp /= right;
 	return tmp;
 }
 


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