diff data/model/PowerOfSqrtTwoZoomConstraint.cpp @ 1038:cc27f35aa75c cxx11

Introducing the signed 64-bit frame index type, and fixing build failures from inclusion of -Wconversion with -Werror. Not finished yet.
author Chris Cannam
date Tue, 03 Mar 2015 15:18:24 +0000
parents 59e7fe1b1003
children d4a28d1479a8 48e9f538e6e9
line wrap: on
line diff
--- a/data/model/PowerOfSqrtTwoZoomConstraint.cpp	Tue Mar 03 09:33:59 2015 +0000
+++ b/data/model/PowerOfSqrtTwoZoomConstraint.cpp	Tue Mar 03 15:18:24 2015 +0000
@@ -44,12 +44,13 @@
 	float val = 1.0, prevVal = 1.0;
 	while (val + 0.01 < blockSize) {
 	    prevVal = val;
-	    val *= sqrt(2.f);
+	    val *= sqrtf(2.f);
 	}
 	int rval;
-	if (dir == RoundUp) rval = int(val + 0.01);
-	else if (dir == RoundDown) rval = int(prevVal + 0.01);
-	else if (val - blockSize < blockSize - prevVal) rval = int(val + 0.01);
+	if (dir == RoundUp) rval = int(val + 0.01f);
+	else if (dir == RoundDown) rval = int(prevVal + 0.01f);
+	else if (val - float(blockSize) <
+                 float(blockSize) - prevVal) rval = int(val + 0.01f);
 	else rval = int(prevVal + 0.01);
 //	SVDEBUG << "returning " << rval << endl;
 	return rval;