Mercurial > hg > svcore
comparison data/model/PowerOfSqrtTwoZoomConstraint.cpp @ 690:1424aa29ae95
Seems to be a bad idea to use plain DEBUG symbol on OS/X (system wants it)
author | Chris Cannam |
---|---|
date | Tue, 14 Jun 2011 15:26:52 +0100 |
parents | 06f13a3b9e9e |
children | e802e550a1f2 |
comparison
equal
deleted
inserted
replaced
689:573d45e9487b | 690:1424aa29ae95 |
---|---|
49 size_t rval; | 49 size_t rval; |
50 if (dir == RoundUp) rval = size_t(val + 0.01); | 50 if (dir == RoundUp) rval = size_t(val + 0.01); |
51 else if (dir == RoundDown) rval = size_t(prevVal + 0.01); | 51 else if (dir == RoundDown) rval = size_t(prevVal + 0.01); |
52 else if (val - blockSize < blockSize - prevVal) rval = size_t(val + 0.01); | 52 else if (val - blockSize < blockSize - prevVal) rval = size_t(val + 0.01); |
53 else rval = size_t(prevVal + 0.01); | 53 else rval = size_t(prevVal + 0.01); |
54 // DEBUG << "returning " << rval << endl; | 54 // SVDEBUG << "returning " << rval << endl; |
55 return rval; | 55 return rval; |
56 } | 56 } |
57 | 57 |
58 unsigned int prevBase = (1 << minCachePower); | 58 unsigned int prevBase = (1 << minCachePower); |
59 unsigned int prevPower = minCachePower; | 59 unsigned int prevPower = minCachePower; |
72 } else { | 72 } else { |
73 base = (((unsigned int)((1 << minCachePower) * sqrt(2.) + 0.01)) | 73 base = (((unsigned int)((1 << minCachePower) * sqrt(2.) + 0.01)) |
74 << (power - minCachePower)); | 74 << (power - minCachePower)); |
75 } | 75 } |
76 | 76 |
77 // DEBUG << "Testing base " << base << endl; | 77 // SVDEBUG << "Testing base " << base << endl; |
78 | 78 |
79 if (base == blockSize) { | 79 if (base == blockSize) { |
80 result = base; | 80 result = base; |
81 break; | 81 break; |
82 } | 82 } |