[Scummvm-cvs-logs] SF.net SVN: scummvm:[53497] scummvm/trunk/common/algorithm.h

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri Oct 15 16:18:58 CEST 2010


Revision: 53497
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53497&view=rev
Author:   lordhoto
Date:     2010-10-15 14:18:58 +0000 (Fri, 15 Oct 2010)

Log Message:
-----------
COMMON: Silence gcc warning introduced with r53496.

Modified Paths:
--------------
    scummvm/trunk/common/algorithm.h

Modified: scummvm/trunk/common/algorithm.h
===================================================================
--- scummvm/trunk/common/algorithm.h	2010-10-15 14:14:51 UTC (rev 53496)
+++ scummvm/trunk/common/algorithm.h	2010-10-15 14:18:58 UTC (rev 53497)
@@ -242,8 +242,14 @@
  */
 template<class T>
 T gcd(T a, T b) {
+#ifdef _MSC_VER
 	if (a < 0) a = -a;
 	if (b < 0) b = -b;
+#else
+	if (a <= 0) a = -a;
+	if (b <= 0) b = -b;
+#endif
+
 	while (a > 0) {
 		T tmp = a;
 		a = b % a;


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